diff --git a/.appveyor.yml b/.appveyor.yml new file mode 100644 index 00000000..64e7ae64 --- /dev/null +++ b/.appveyor.yml @@ -0,0 +1,40 @@ +# Windows Build Configuration for AppVeyor +# http://www.appveyor.com/docs/appveyor-yml + +# build version format +version: "{build}" + +os: Visual Studio 2013 + +platform: + - Any CPU + +configuration: + - Debug + - Release + +branches: + only: + - master + +clone_depth: 5 + +matrix: + fast_finish: true # Show final status immediately if a test fails. + +# scripts that run after cloning repository +install: + - git clone https://github.com/google/googletest.git External/googletest + +build: + parallel: true # enable MSBuild parallel builds + verbosity: minimal + +build_script: + - mkdir build && cd build + - cmake .. -DCMAKE_INSTALL_PREFIX=install + - cmake --build . --config %CONFIGURATION% --target install + +test_script: + - ctest -C %CONFIGURATION% --output-on-failure + - cd ../Test && bash runtests diff --git a/.gitignore b/.gitignore index d93c2022..66cbff97 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ build/ Test/localResults/ Test/multiThread.out Test/singleThread.out +External/googletest diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..4a88dce5 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,60 @@ +# Linux and Mac Build Configuration for Travis + +language: cpp + +os: + - linux + - osx + +# Use Ubuntu 14.04 LTS (Trusty) as the Linux testing environment. +sudo: required +dist: trusty + +env: + - GLSLANG_BUILD_TYPE=Release + - GLSLANG_BUILD_TYPE=Debug + +compiler: + - clang + - gcc + +matrix: + fast_finish: true # Show final status immediately if a test fails. + exclude: + # Skip GCC builds on Mac OS X. + - os: osx + compiler: gcc + +cache: + apt: true + +branches: + only: + - master + +addons: + apt: + packages: + - clang-3.6 + - ninja-build + +install: + # Install ninja on Mac OS X. + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update && brew install ninja; fi + # Make sure that clang-3.6 is selected. + - if [[ "$TRAVIS_OS_NAME" == "linux" && "$CC" == "clang" ]]; then + export CC=clang-3.6 CXX=clang++-3.6; + fi + +before_script: + - git clone https://github.com/google/googletest.git External/googletest + +script: + - mkdir build && cd build + # We need to install the compiled binaries so the paths in the runtests script can resolve correctly. + - cmake -GNinja -DCMAKE_BUILD_TYPE=${GLSLANG_BUILD_TYPE} -DCMAKE_INSTALL_PREFIX=`pwd`/install .. + - ninja install + # Run Google-Test-based tests. + - ctest --output-on-failure + # Run runtests-based tests. + - cd ../Test && ./runtests diff --git a/CMakeLists.txt b/CMakeLists.txt index 1d723d87..f2f23559 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,17 +1,21 @@ -cmake_minimum_required(VERSION 2.8) +cmake_minimum_required(VERSION 2.8.12) +set_property(GLOBAL PROPERTY USE_FOLDERS ON) + +enable_testing() set(CMAKE_INSTALL_PREFIX "install" CACHE STRING "prefix") project(glslang) if(WIN32) + set(CMAKE_DEBUG_POSTFIX "d") include(ChooseMSVCCRT.cmake) add_definitions(-DGLSLANG_OSINCLUDE_WIN32) elseif(UNIX) add_definitions(-fPIC) add_definitions(-DGLSLANG_OSINCLUDE_UNIX) else(WIN32) - message("unkown platform") + message("unknown platform") endif(WIN32) if(CMAKE_COMPILER_IS_GNUCXX) @@ -20,7 +24,23 @@ elseif(${CMAKE_CXX_COMPILER_ID} MATCHES "Clang") add_definitions(-std=c++11) endif() +function(glslang_set_link_args TARGET) + # For MinGW compiles, statically link against the GCC and C++ runtimes. + # This avoids the need to ship those runtimes as DLLs. + if(WIN32) + if(${CMAKE_CXX_COMPILER_ID} MATCHES "GNU") + set_target_properties(${TARGET} PROPERTIES + LINK_FLAGS "-static -static-libgcc -static-libstdc++") + endif() + endif(WIN32) +endfunction(glslang_set_link_args) + +# We depend on these for later projects, so they should come first. +add_subdirectory(External) + add_subdirectory(glslang) add_subdirectory(OGLCompilersDLL) add_subdirectory(StandAlone) add_subdirectory(SPIRV) +add_subdirectory(hlsl) +add_subdirectory(gtests) diff --git a/External/CMakeLists.txt b/External/CMakeLists.txt new file mode 100644 index 00000000..5180ea56 --- /dev/null +++ b/External/CMakeLists.txt @@ -0,0 +1,34 @@ +# Suppress all warnings from external projects. +set_property(DIRECTORY APPEND PROPERTY COMPILE_OPTIONS -w) + +if (TARGET gmock) + message(STATUS "Google Mock already configured - use it") +elseif(IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/googletest) + # We need to make sure Google Test does not mess up with the + # global CRT settings on Windows. + if(WIN32) + set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) + endif(WIN32) + add_subdirectory(googletest) + set(GTEST_TARGETS + gtest + gtest_main + gmock + gmock_main + ) + foreach(target ${GTEST_TARGETS}) + set_property(TARGET ${target} PROPERTY FOLDER gtest) + endforeach() + mark_as_advanced(gmock_build_tests + BUILD_GMOCK + BUILD_GTEST + BUILD_SHARED_LIBS + gtest_build_samples + gtest_build_tests + gtest_disable_pthreads + gtest_force_shared_crt + gtest_hide_internal_symbols) +else() + message(STATUS + "Google Mock was not found - tests based on that will not build") +endif() diff --git a/LinuxDoAll.bash b/LinuxDoAll.bash deleted file mode 100755 index 4bd39a33..00000000 --- a/LinuxDoAll.bash +++ /dev/null @@ -1,34 +0,0 @@ -#! /bin/bash - -svn update - -rm -f StandAlone/glslangValidator -rm -f Test/glslangValidator -rm -f glslang/MachineIndependent/lib/libglslang.so -rm -f Install/Linux/libglslang.so -rm -f Install/Linux/glslangValidator - -cd StandAlone -make clean -cd ../glslang/MachineIndependent -make clean -cd ../.. - -# build the StandAlone app and all it's dependencies -make -C StandAlone - -# so we can find the shared library -#LD_LIBRARY_PATH=`pwd`/glslang/MachineIndependent/lib -#export LD_LIBRARY_PATH - -# install -cd Install/Linux -./install -cp glslangValidator ../../Test -LD_LIBRARY_PATH=/usr/local/lib -export LD_LIBRARY_PATH - -# run using test data -cd ../../Test -chmod +x runtests -./runtests diff --git a/OGLCompilersDLL/CMakeLists.txt b/OGLCompilersDLL/CMakeLists.txt index 60fb93b6..4954db94 100644 --- a/OGLCompilersDLL/CMakeLists.txt +++ b/OGLCompilersDLL/CMakeLists.txt @@ -1,8 +1,7 @@ -cmake_minimum_required(VERSION 2.8) - set(SOURCES InitializeDll.cpp InitializeDll.h) add_library(OGLCompiler STATIC ${SOURCES}) +set_property(TARGET OGLCompiler PROPERTY FOLDER glslang) if(WIN32) source_group("Source" FILES ${SOURCES}) diff --git a/README.md b/README.md index 7a60e280..7a14f56a 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,9 @@ regarding the feature level of glslang. glslang ======= +[![Build Status](https://travis-ci.org/KhronosGroup/glslang.svg?branch=master)](https://travis-ci.org/KhronosGroup/glslang) +[![Build status](https://ci.appveyor.com/api/projects/status/q6fi9cb0qnhkla68/branch/master?svg=true)](https://ci.appveyor.com/project/Khronoswebmaster/glslang/branch/master) + An OpenGL and OpenGL ES shader front end and validator. There are two components: @@ -43,24 +46,149 @@ There is also a non-shader extension Building -------- -CMake: The currently maintained and preferred way of building is through CMake. -In MSVC, after running CMake, you may need to use the Configuration Manager to -check the INSTALL project. +### Dependencies -The grammar in glslang/MachineIndependent/glslang.y has to be recompiled with +* [CMake][cmake]: for generating compilation targets. +* [bison][bison]: _optional_, but needed when changing the grammar (glslang.y). +* [googletest][googletest]: _optional_, but should use if making any changes to glslang. + +### Build steps + +#### 1) Check-Out External Projects + +```bash +cd +git clone https://github.com/google/googletest.git External/googletest +``` + +#### 2) Configure + +Assume the source directory is `$SOURCE_DIR` and +the build directory is `$BUILD_DIR`: + +For building on Linux (assuming using the Ninja generator): + +```bash +cd $BUILD_DIR + +cmake -GNinja -DCMAKE_BUILD_TYPE={Debug|Release|RelWithDebInfo} \ + -DCMAKE_INSTALL_PREFIX=`pwd`/install $SOURCE_DIR +``` + +For building on Windows: + +```bash +cmake $SOURCE_DIR -DCMAKE_INSTALL_PREFIX=`pwd`/install +# The CMAKE_INSTALL_PREFIX part is for testing (explained later). +``` + +The CMake GUI also works for Windows (version 3.4.1 tested). + +#### 3) Build and Install + +```bash +# for Linux: +ninja install + +# for Windows: +cmake --build . --config {Release|Debug|MinSizeRel|RelWithDebInfo} \ + --target install +``` + +If using MSVC, after running CMake to configure, use the +Configuration Manager to check the `INSTALL` project. + +### If you need to change the GLSL grammar + +The grammar in `glslang/MachineIndependent/glslang.y` has to be recompiled with bison if it changes, the output files are committed to the repo to avoid every developer needing to have bison configured to compile the project when grammar changes are quite infrequent. For windows you can get binaries from -[GnuWin32](http://gnuwin32.sourceforge.net/packages/bison.htm). +[GnuWin32][bison-gnu-win32]. The command to rebuild is: -``` +```bash bison --defines=MachineIndependent/glslang_tab.cpp.h -t MachineIndependent/glslang.y -o MachineIndependent/glslang_tab.cpp ``` +The above command is also available in the bash script at +`glslang/updateGrammar`. + +Testing +------- + +Right now, there are two test harnesses existing in glslang: one is [Google +Test](gtests/), one is the [`runtests` script](Test/runtests). The former +runs unit tests and single-shader single-threaded integration tests, while +the latter runs multiple-shader linking tests and multi-threaded tests. + +### Running tests + +The [`runtests` script](Test/runtests) requires compiled binaries to be +installed into `$BUILD_DIR/install`. Please make sure you have supplied the +correct configuration to CMake (using `-DCMAKE_INSTALL_PREFIX`) when building; +otherwise, you may want to modify the path in the `runtests` script. + +Running Google Test-backed tests: + +```bash +cd $BUILD_DIR + +# for Linux: +ctest + +# for Windows: +ctest -C {Debug|Release|RelWithDebInfo|MinSizeRel} + +# or, run the test binary directly +# (which gives more fine-grained control like filtering): +/glslangtests +``` + +Running `runtests` script-backed tests: + +```bash +cd $SOURCE_DIR/Test && ./runtests +``` + +### Contributing tests + +Test results should always be included with a pull request that modifies +functionality. + +If you are writing unit tests, please use the Google Test framework and +place the tests under the `gtests/` directory. + +Integration tests are placed in the `Test/` directory. It contains test input +and a subdirectory `baseResults/` that contains the expected results of the +tests. Both the tests and `baseResults/` are under source-code control. + +Google Test runs those integration tests by reading the test input, compiling +them, and then compare against the expected results in `baseResults/`. The +integration tests to run via Google Test is registered in various +`gtests/*.FromFile.cpp` source files. `glslangtests` provides a command-line +option `--update-mode`, which, if supplied, will overwrite the golden files +under the `baseResults/` directory with real output from that invocation. +For more information, please check `gtests/` directory's +[README](gtests/README.md). + +For the `runtests` script, it will generate current results in the +`localResults/` directory and `diff` them against the `baseResults/`. +The integration tests to run via the `runtests` script is registered +via various `Test/test-*` text files and `Test/testlist`. +When you want to update the tracked test results, they need to be +copied from `localResults/` to `baseResults/`. This can be done by +the `bump` shell script. + +The list of files tested comes from `testlist`, and lists input shaders +in this directory, which must all be public for this to work. However, +you can add your own private list of tests, not tracked here, by using +`localtestlist` to list non-tracked tests. This is automatically read +by `runtests` and included in the `diff` and `bump` process. + Programmatic Interfaces ----------------------- @@ -97,7 +225,7 @@ class TProgram See `ShaderLang.h` and the usage of it in `StandAlone/StandAlone.cpp` for more details. -### C Functional Interface (orginal) +### C Functional Interface (orignal) This interface is in roughly the first 2/3 of `ShaderLang.h`, and referred to as the `Sh*()` interface, as all the entry points start `Sh`. @@ -112,29 +240,7 @@ ShCompile(shader, compiler) -> compiler(AST) -> ``` In practice, `ShCompile()` takes shader strings, default version, and -warning/error and other options for controling compilation. - -Testing -------- - -Test results should always be included with a pull request that modifies -functionality. There is a simple process for doing this, described here: - -`Test` is an active test directory that contains test input and a -subdirectory `baseResults` that contains the expected results of the -tests. Both the tests and `baseResults` are under source-code control. -Executing the script `./runtests` will generate current results in -the `localResults` directory and `diff` them against the `baseResults`. - -When you want to update the tracked test results, they need to be -copied from `localResults` to `baseResults`. This can be done by -the `bump` shell script. - -The list of files tested comes from `testlist`, and lists input shaders -in this directory, which must all be public for this to work. However, -you can add your own private list of tests, not tracked here, by using -`localtestlist` to list non-tracked tests. This is automatically read -by `runtests` and included in the `diff` and `bump` process. +warning/error and other options for controlling compilation. Basic Internal Operation ------------------------ @@ -183,3 +289,9 @@ Basic Internal Operation - the object does not come from the pool, and you have to do normal C++ memory management of what you `new` + + +[cmake]: https://cmake.org/ +[bison]: https://www.gnu.org/software/bison/ +[googletest]: https://github.com/google/googletest +[bison-gnu-win32]: http://gnuwin32.sourceforge.net/packages/bison.htm diff --git a/SPIRV/CMakeLists.txt b/SPIRV/CMakeLists.txt index 50cda686..5c169b14 100755 --- a/SPIRV/CMakeLists.txt +++ b/SPIRV/CMakeLists.txt @@ -1,8 +1,7 @@ -cmake_minimum_required(VERSION 2.8) - set(SOURCES GlslangToSpv.cpp InReadableOrder.cpp + Logger.cpp SpvBuilder.cpp SPVRemapper.cpp doc.cpp @@ -12,6 +11,7 @@ set(HEADERS spirv.hpp GLSL.std.450.h GlslangToSpv.h + Logger.h SpvBuilder.h SPVRemapper.h spvIR.h @@ -19,6 +19,7 @@ set(HEADERS disassemble.h) add_library(SPIRV STATIC ${SOURCES} ${HEADERS}) +set_property(TARGET SPIRV PROPERTY FOLDER glslang) if(WIN32) source_group("Source" FILES ${SOURCES} ${HEADERS}) diff --git a/SPIRV/GlslangToSpv.cpp b/SPIRV/GlslangToSpv.cpp index dd5afd4b..cfbee00f 100755 --- a/SPIRV/GlslangToSpv.cpp +++ b/SPIRV/GlslangToSpv.cpp @@ -33,8 +33,6 @@ //ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE //POSSIBILITY OF SUCH DAMAGE. -// -// Author: John Kessenich, LunarG // // Visit the nodes in the glslang intermediate tree representation to // translate them to SPIR-V. @@ -52,12 +50,12 @@ namespace spv { #include "../glslang/MachineIndependent/SymbolTable.h" #include "../glslang/Include/Common.h" -#include -#include -#include -#include -#include #include +#include +#include +#include +#include +#include namespace { @@ -66,6 +64,27 @@ namespace { // or a different instruction sequence to do something gets used). const int GeneratorVersion = 1; +namespace { +class SpecConstantOpModeGuard { +public: + SpecConstantOpModeGuard(spv::Builder* builder) + : builder_(builder) { + previous_flag_ = builder->isInSpecConstCodeGenMode(); + } + ~SpecConstantOpModeGuard() { + previous_flag_ ? builder_->setToSpecConstCodeGenMode() + : builder_->setToNormalCodeGenMode(); + } + void turnOnSpecConstantOpMode() { + builder_->setToSpecConstCodeGenMode(); + } + +private: + spv::Builder* builder_; + bool previous_flag_; +}; +} + // // The main holder of information for translating glslang to SPIR-V. // @@ -73,7 +92,7 @@ const int GeneratorVersion = 1; // class TGlslangToSpvTraverser : public glslang::TIntermTraverser { public: - TGlslangToSpvTraverser(const glslang::TIntermediate*); + TGlslangToSpvTraverser(const glslang::TIntermediate*, spv::SpvBuildLogger* logger); virtual ~TGlslangToSpvTraverser(); bool visitAggregate(glslang::TVisit, glslang::TIntermAggregate*); @@ -89,8 +108,8 @@ public: void dumpSpv(std::vector& out); protected: - spv::Decoration TranslateInterpolationDecoration(const glslang::TQualifier& qualifier); - spv::BuiltIn TranslateBuiltInDecoration(glslang::TBuiltInVariable); + spv::Decoration TranslateAuxiliaryStorageDecoration(const glslang::TQualifier& qualifier); + spv::BuiltIn TranslateBuiltInDecoration(glslang::TBuiltInVariable, bool member); spv::ImageFormat TranslateImageFormat(const glslang::TType& type); spv::Id createSpvVariable(const glslang::TIntermSymbol*); spv::Id getSampledType(const glslang::TSampler&); @@ -103,6 +122,7 @@ protected: int getArrayStride(const glslang::TType& arrayType, glslang::TLayoutPacking, glslang::TLayoutMatrix); int getMatrixStride(const glslang::TType& matrixType, glslang::TLayoutPacking, glslang::TLayoutMatrix); void updateMemberOffset(const glslang::TType& structType, const glslang::TType& memberType, int& currentOffset, int& nextOffset, glslang::TLayoutPacking, glslang::TLayoutMatrix); + void declareClipCullCapability(const glslang::TTypeList& members, int member); bool isShaderEntrypoint(const glslang::TIntermAggregate* node); void makeFunctions(const glslang::TIntermSequence&); @@ -114,13 +134,14 @@ protected: spv::Id createImageTextureFunctionCall(glslang::TIntermOperator* node); spv::Id handleUserFunctionCall(const glslang::TIntermAggregate*); - spv::Id createBinaryOperation(glslang::TOperator op, spv::Decoration precision, spv::Id typeId, spv::Id left, spv::Id right, glslang::TBasicType typeProxy, bool reduceComparison = true); - spv::Id createBinaryMatrixOperation(spv::Op, spv::Decoration precision, spv::Id typeId, spv::Id left, spv::Id right); - spv::Id createUnaryOperation(glslang::TOperator op, spv::Decoration precision, spv::Id typeId, spv::Id operand,glslang::TBasicType typeProxy); - spv::Id createUnaryMatrixOperation(spv::Op, spv::Decoration precision, spv::Id typeId, spv::Id operand,glslang::TBasicType typeProxy); - spv::Id createConversion(glslang::TOperator op, spv::Decoration precision, spv::Id destTypeId, spv::Id operand); + spv::Id createBinaryOperation(glslang::TOperator op, spv::Decoration precision, spv::Decoration noContraction, spv::Id typeId, spv::Id left, spv::Id right, glslang::TBasicType typeProxy, bool reduceComparison = true); + spv::Id createBinaryMatrixOperation(spv::Op, spv::Decoration precision, spv::Decoration noContraction, spv::Id typeId, spv::Id left, spv::Id right); + spv::Id createUnaryOperation(glslang::TOperator op, spv::Decoration precision, spv::Decoration noContraction, spv::Id typeId, spv::Id operand,glslang::TBasicType typeProxy); + spv::Id createUnaryMatrixOperation(spv::Op, spv::Decoration precision, spv::Decoration noContraction, spv::Id typeId, spv::Id operand,glslang::TBasicType typeProxy); + spv::Id createConversion(glslang::TOperator op, spv::Decoration precision, spv::Decoration noContraction, spv::Id destTypeId, spv::Id operand, glslang::TBasicType typeProxy); spv::Id makeSmearedConstant(spv::Id constant, int vectorSize); spv::Id createAtomicOperation(glslang::TOperator op, spv::Decoration precision, spv::Id typeId, std::vector& operands, glslang::TBasicType typeProxy); + spv::Id createInvocationsOperation(glslang::TOperator, spv::Id typeId, spv::Id operand); spv::Id createMiscOperation(glslang::TOperator op, spv::Decoration precision, spv::Id typeId, std::vector& operands, glslang::TBasicType typeProxy); spv::Id createNoArgOperation(glslang::TOperator op); spv::Id getSymbolId(const glslang::TIntermSymbol* node); @@ -130,7 +151,6 @@ protected: void addMemberDecoration(spv::Id id, int member, spv::Decoration dec, unsigned value); spv::Id createSpvConstant(const glslang::TIntermTyped&); spv::Id createSpvConstantFromConstUnionArray(const glslang::TType& type, const glslang::TConstUnionArray&, int& nextConst, bool specConstant); - spv::Id createSpvConstantFromConstSubTree(const glslang::TIntermTyped* subTree); bool isTrivialLeaf(const glslang::TIntermTyped* node); bool isTrivial(const glslang::TIntermTyped* node); spv::Id createShortCircuit(glslang::TOperator, glslang::TIntermTyped& left, glslang::TIntermTyped& right); @@ -139,6 +159,8 @@ protected: spv::Instruction* entryPoint; int sequenceDepth; + spv::SpvBuildLogger* logger; + // There is a 1:1 mapping between a spv builder and a module; this is thread safe spv::Builder builder; bool inMain; @@ -161,15 +183,22 @@ protected: // // Translate glslang profile to SPIR-V source language. -spv::SourceLanguage TranslateSourceLanguage(EProfile profile) +spv::SourceLanguage TranslateSourceLanguage(glslang::EShSource source, EProfile profile) { - switch (profile) { - case ENoProfile: - case ECoreProfile: - case ECompatibilityProfile: - return spv::SourceLanguageGLSL; - case EEsProfile: - return spv::SourceLanguageESSL; + switch (source) { + case glslang::EShSourceGlsl: + switch (profile) { + case ENoProfile: + case ECoreProfile: + case ECompatibilityProfile: + return spv::SourceLanguageGLSL; + case EEsProfile: + return spv::SourceLanguageESSL; + default: + return spv::SourceLanguageUnknown; + } + case glslang::EShSourceHlsl: + return spv::SourceLanguageHLSL; default: return spv::SourceLanguageUnknown; } @@ -214,7 +243,7 @@ spv::StorageClass TranslateStorageClass(const glslang::TType& type) case glslang::EvqGlobal: return spv::StorageClassPrivate; case glslang::EvqConstReadOnly: return spv::StorageClassFunction; case glslang::EvqTemporary: return spv::StorageClassFunction; - default: + default: assert(0); return spv::StorageClassFunction; } @@ -325,18 +354,26 @@ spv::Decoration TranslateLayoutDecoration(const glslang::TType& type, glslang::T // Translate glslang type to SPIR-V interpolation decorations. // Returns spv::Decoration(spv::BadValue) when no decoration // should be applied. -spv::Decoration TGlslangToSpvTraverser::TranslateInterpolationDecoration(const glslang::TQualifier& qualifier) +spv::Decoration TranslateInterpolationDecoration(const glslang::TQualifier& qualifier) { - if (qualifier.smooth) { + if (qualifier.smooth) // Smooth decoration doesn't exist in SPIR-V 1.0 return (spv::Decoration)spv::BadValue; - } - if (qualifier.nopersp) + else if (qualifier.nopersp) return spv::DecorationNoPerspective; - else if (qualifier.patch) - return spv::DecorationPatch; else if (qualifier.flat) return spv::DecorationFlat; + else + return (spv::Decoration)spv::BadValue; +} + +// Translate glslang type to SPIR-V auxiliary storage decorations. +// Returns spv::Decoration(spv::BadValue) when no decoration +// should be applied. +spv::Decoration TGlslangToSpvTraverser::TranslateAuxiliaryStorageDecoration(const glslang::TQualifier& qualifier) +{ + if (qualifier.patch) + return spv::DecorationPatch; else if (qualifier.centroid) return spv::DecorationCentroid; else if (qualifier.sample) { @@ -355,8 +392,17 @@ spv::Decoration TranslateInvariantDecoration(const glslang::TQualifier& qualifie return (spv::Decoration)spv::BadValue; } +// If glslang type is noContraction, return SPIR-V NoContraction decoration. +spv::Decoration TranslateNoContractionDecoration(const glslang::TQualifier& qualifier) +{ + if (qualifier.noContraction) + return spv::DecorationNoContraction; + else + return (spv::Decoration)spv::BadValue; +} + // Translate glslang built-in variable to SPIR-V built in decoration. -spv::BuiltIn TGlslangToSpvTraverser::TranslateBuiltInDecoration(glslang::TBuiltInVariable builtIn) +spv::BuiltIn TGlslangToSpvTraverser::TranslateBuiltInDecoration(glslang::TBuiltInVariable builtIn, bool member) { switch (builtIn) { case glslang::EbvPointSize: @@ -373,12 +419,20 @@ spv::BuiltIn TGlslangToSpvTraverser::TranslateBuiltInDecoration(glslang::TBuiltI } return spv::BuiltInPointSize; + // These *Distance capabilities logically belong here, but if the member is declared and + // then never used, consumers of SPIR-V prefer the capability not be declared. + // They are now generated when used, rather than here when declared. + // Potentially, the specification should be more clear what the minimum + // use needed is to trigger the capability. + // case glslang::EbvClipDistance: - builder.addCapability(spv::CapabilityClipDistance); + if (! member) + builder.addCapability(spv::CapabilityClipDistance); return spv::BuiltInClipDistance; case glslang::EbvCullDistance: - builder.addCapability(spv::CapabilityCullDistance); + if (! member) + builder.addCapability(spv::CapabilityCullDistance); return spv::BuiltInCullDistance; case glslang::EbvViewportIndex: @@ -406,7 +460,7 @@ spv::BuiltIn TGlslangToSpvTraverser::TranslateBuiltInDecoration(glslang::TBuiltI case glslang::EbvBaseInstance: case glslang::EbvDrawId: // TODO: Add SPIR-V builtin ID. - spv::MissingFunctionality("Draw parameters"); + logger->missingFunctionality("shader draw parameters"); return (spv::BuiltIn)spv::BadValue; case glslang::EbvPrimitiveId: return spv::BuiltInPrimitiveId; case glslang::EbvInvocationId: return spv::BuiltInInvocationId; @@ -426,6 +480,16 @@ spv::BuiltIn TGlslangToSpvTraverser::TranslateBuiltInDecoration(glslang::TBuiltI case glslang::EbvLocalInvocationId: return spv::BuiltInLocalInvocationId; case glslang::EbvLocalInvocationIndex: return spv::BuiltInLocalInvocationIndex; case glslang::EbvGlobalInvocationId: return spv::BuiltInGlobalInvocationId; + case glslang::EbvSubGroupSize: + case glslang::EbvSubGroupInvocation: + case glslang::EbvSubGroupEqMask: + case glslang::EbvSubGroupGeMask: + case glslang::EbvSubGroupGtMask: + case glslang::EbvSubGroupLeMask: + case glslang::EbvSubGroupLtMask: + // TODO: Add SPIR-V builtin ID. + logger->missingFunctionality("shader ballot"); + return (spv::BuiltIn)spv::BadValue; default: return (spv::BuiltIn)spv::BadValue; } } @@ -518,7 +582,7 @@ spv::ImageFormat TGlslangToSpvTraverser::TranslateImageFormat(const glslang::TTy } } -// Return whether or not the given type is something that should be tied to a +// Return whether or not the given type is something that should be tied to a // descriptor set. bool IsDescriptorResource(const glslang::TType& type) { @@ -579,20 +643,20 @@ bool HasNonLayoutQualifiers(const glslang::TQualifier& qualifier) // Implement the TGlslangToSpvTraverser class. // -TGlslangToSpvTraverser::TGlslangToSpvTraverser(const glslang::TIntermediate* glslangIntermediate) - : TIntermTraverser(true, false, true), shaderEntry(0), sequenceDepth(0), - builder((glslang::GetKhronosToolId() << 16) | GeneratorVersion), +TGlslangToSpvTraverser::TGlslangToSpvTraverser(const glslang::TIntermediate* glslangIntermediate, spv::SpvBuildLogger* buildLogger) + : TIntermTraverser(true, false, true), shaderEntry(0), sequenceDepth(0), logger(buildLogger), + builder((glslang::GetKhronosToolId() << 16) | GeneratorVersion, logger), inMain(false), mainTerminated(false), linkageOnly(false), glslangIntermediate(glslangIntermediate) { spv::ExecutionModel executionModel = TranslateExecutionModel(glslangIntermediate->getStage()); builder.clearAccessChain(); - builder.setSource(TranslateSourceLanguage(glslangIntermediate->getProfile()), glslangIntermediate->getVersion()); + builder.setSource(TranslateSourceLanguage(glslangIntermediate->getSource(), glslangIntermediate->getProfile()), glslangIntermediate->getVersion()); stdBuiltins = builder.import("GLSL.std.450"); builder.setMemoryModel(spv::AddressingModelLogical, spv::MemoryModelGLSL450); - shaderEntry = builder.makeMain(); - entryPoint = builder.addEntryPoint(executionModel, shaderEntry, "main"); + shaderEntry = builder.makeEntrypoint(glslangIntermediate->getEntryPoint().c_str()); + entryPoint = builder.addEntryPoint(executionModel, shaderEntry, glslangIntermediate->getEntryPoint().c_str()); // Add the source extensions const auto& sourceExtensions = glslangIntermediate->getRequestedExtensions(); @@ -742,7 +806,7 @@ TGlslangToSpvTraverser::~TGlslangToSpvTraverser() // // -// Symbols can turn into +// Symbols can turn into // - uniform/input reads // - output writes // - complex lvalue base setups: foo.bar[3].... , where we see foo and start up an access chain @@ -750,6 +814,10 @@ TGlslangToSpvTraverser::~TGlslangToSpvTraverser() // void TGlslangToSpvTraverser::visitSymbol(glslang::TIntermSymbol* symbol) { + SpecConstantOpModeGuard spec_constant_op_mode_setter(&builder); + if (symbol->getType().getQualifier().isSpecConstant()) + spec_constant_op_mode_setter.turnOnSpecConstantOpMode(); + // getSymbolId() will set up all the IO decorations on the first call. // Formal function parameters were mapped during makeFunctions(). spv::Id id = getSymbolId(symbol); @@ -787,6 +855,10 @@ void TGlslangToSpvTraverser::visitSymbol(glslang::TIntermSymbol* symbol) bool TGlslangToSpvTraverser::visitBinary(glslang::TVisit /* visit */, glslang::TIntermBinary* node) { + SpecConstantOpModeGuard spec_constant_op_mode_setter(&builder); + if (node->getType().getQualifier().isSpecConstant()) + spec_constant_op_mode_setter.turnOnSpecConstantOpMode(); + // First, handle special cases switch (node->getOp()) { case glslang::EOpAssign: @@ -825,7 +897,8 @@ bool TGlslangToSpvTraverser::visitBinary(glslang::TVisit /* visit */, glslang::T spv::Id leftRValue = accessChainLoad(node->getLeft()->getType()); // do the operation - rValue = createBinaryOperation(node->getOp(), TranslatePrecisionDecoration(node->getType()), + rValue = createBinaryOperation(node->getOp(), TranslatePrecisionDecoration(node->getType()), + TranslateNoContractionDecoration(node->getType().getQualifier()), convertGlslangToSpvType(node->getType()), leftRValue, rValue, node->getType().getBasicType()); @@ -870,6 +943,10 @@ bool TGlslangToSpvTraverser::visitBinary(glslang::TVisit /* visit */, glslang::T } else { // normal case for indexing array or structure or block builder.accessChainPush(builder.makeIntConstant(index)); + + // Add capabilities here for accessing clip/cull distance + if (node->getLeft()->getType().isStruct() && ! node->getLeft()->getType().isArray()) + declareClipCullCapability(*node->getLeft()->getType().getStruct(), index); } } return false; @@ -944,12 +1021,13 @@ bool TGlslangToSpvTraverser::visitBinary(glslang::TVisit /* visit */, glslang::T // get result spv::Id result = createBinaryOperation(node->getOp(), TranslatePrecisionDecoration(node->getType()), + TranslateNoContractionDecoration(node->getType().getQualifier()), convertGlslangToSpvType(node->getType()), left, right, node->getLeft()->getType().getBasicType()); builder.clearAccessChain(); if (! result) { - spv::MissingFunctionality("unknown glslang binary operation"); + logger->missingFunctionality("unknown glslang binary operation"); return true; // pick up a child as the place-holder result } else { builder.setAccessChainRValue(result); @@ -959,6 +1037,10 @@ bool TGlslangToSpvTraverser::visitBinary(glslang::TVisit /* visit */, glslang::T bool TGlslangToSpvTraverser::visitUnary(glslang::TVisit /* visit */, glslang::TIntermUnary* node) { + SpecConstantOpModeGuard spec_constant_op_mode_setter(&builder); + if (node->getType().getQualifier().isSpecConstant()) + spec_constant_op_mode_setter.turnOnSpecConstantOpMode(); + spv::Id result = spv::NoResult; // try texturing first @@ -1006,14 +1088,15 @@ bool TGlslangToSpvTraverser::visitUnary(glslang::TVisit /* visit */, glslang::TI operand = accessChainLoad(node->getOperand()->getType()); spv::Decoration precision = TranslatePrecisionDecoration(node->getType()); + spv::Decoration noContraction = TranslateNoContractionDecoration(node->getType().getQualifier()); // it could be a conversion if (! result) - result = createConversion(node->getOp(), precision, convertGlslangToSpvType(node->getType()), operand); + result = createConversion(node->getOp(), precision, noContraction, convertGlslangToSpvType(node->getType()), operand, node->getOperand()->getBasicType()); // if not, then possibly an operation if (! result) - result = createUnaryOperation(node->getOp(), precision, convertGlslangToSpvType(node->getType()), operand, node->getOperand()->getBasicType()); + result = createUnaryOperation(node->getOp(), precision, noContraction, convertGlslangToSpvType(node->getType()), operand, node->getOperand()->getBasicType()); if (result) { builder.clearAccessChain(); @@ -1030,9 +1113,13 @@ bool TGlslangToSpvTraverser::visitUnary(glslang::TVisit /* visit */, glslang::TI case glslang::EOpPreDecrement: { // we need the integer value "1" or the floating point "1.0" to add/subtract - spv::Id one = node->getBasicType() == glslang::EbtFloat ? - builder.makeFloatConstant(1.0F) : - builder.makeIntConstant(1); + spv::Id one = 0; + if (node->getBasicType() == glslang::EbtFloat) + one = builder.makeFloatConstant(1.0F); + else if (node->getBasicType() == glslang::EbtInt64 || node->getBasicType() == glslang::EbtUint64) + one = builder.makeInt64Constant(1); + else + one = builder.makeIntConstant(1); glslang::TOperator op; if (node->getOp() == glslang::EOpPreIncrement || node->getOp() == glslang::EOpPostIncrement) @@ -1040,9 +1127,10 @@ bool TGlslangToSpvTraverser::visitUnary(glslang::TVisit /* visit */, glslang::TI else op = glslang::EOpSub; - spv::Id result = createBinaryOperation(op, TranslatePrecisionDecoration(node->getType()), - convertGlslangToSpvType(node->getType()), operand, one, - node->getType().getBasicType()); + spv::Id result = createBinaryOperation(op, TranslatePrecisionDecoration(node->getType()), + TranslateNoContractionDecoration(node->getType().getQualifier()), + convertGlslangToSpvType(node->getType()), operand, one, + node->getType().getBasicType()); assert(result != spv::NoResult); // The result of operation is always stored, but conditionally the @@ -1066,13 +1154,17 @@ bool TGlslangToSpvTraverser::visitUnary(glslang::TVisit /* visit */, glslang::TI return false; default: - spv::MissingFunctionality("unknown glslang unary"); + logger->missingFunctionality("unknown glslang unary"); return true; // pick up operand as placeholder result } } bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TIntermAggregate* node) { + SpecConstantOpModeGuard spec_constant_op_mode_setter(&builder); + if (node->getType().getQualifier().isSpecConstant()) + spec_constant_op_mode_setter.turnOnSpecConstantOpMode(); + spv::Id result = spv::NoResult; // try texturing @@ -1173,7 +1265,7 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt builder.clearAccessChain(); builder.setAccessChainRValue(result); } else - spv::MissingFunctionality("missing user function; linker needs to catch that"); + logger->missingFunctionality("missing user function; linker needs to catch that"); return false; } @@ -1217,6 +1309,14 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt case glslang::EOpConstructUVec2: case glslang::EOpConstructUVec3: case glslang::EOpConstructUVec4: + case glslang::EOpConstructInt64: + case glslang::EOpConstructI64Vec2: + case glslang::EOpConstructI64Vec3: + case glslang::EOpConstructI64Vec4: + case glslang::EOpConstructUint64: + case glslang::EOpConstructU64Vec2: + case glslang::EOpConstructU64Vec3: + case glslang::EOpConstructU64Vec4: case glslang::EOpConstructStruct: case glslang::EOpConstructTextureSampler: { @@ -1263,7 +1363,7 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt break; } case glslang::EOpMul: - // compontent-wise matrix multiply + // compontent-wise matrix multiply binOp = glslang::EOpMul; break; case glslang::EOpOuterProduct: @@ -1272,9 +1372,9 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt break; case glslang::EOpDot: { - // for scalar dot product, use multiply + // for scalar dot product, use multiply glslang::TIntermSequence& glslangOperands = node->getSequence(); - if (! glslangOperands[0]->getAsTyped()->isVector()) + if (glslangOperands[0]->getAsTyped()->getVectorSize() == 1) binOp = glslang::EOpMul; break; } @@ -1327,8 +1427,8 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt right->traverse(this); spv::Id rightId = accessChainLoad(right->getType()); - result = createBinaryOperation(binOp, precision, - convertGlslangToSpvType(node->getType()), leftId, rightId, + result = createBinaryOperation(binOp, precision, TranslateNoContractionDecoration(node->getType().getQualifier()), + convertGlslangToSpvType(node->getType()), leftId, rightId, left->getType().getBasicType(), reduceComparison); // code above should only make binOp that exists in createBinaryOperation @@ -1401,7 +1501,11 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt result = createNoArgOperation(node->getOp()); break; case 1: - result = createUnaryOperation(node->getOp(), precision, convertGlslangToSpvType(node->getType()), operands.front(), glslangOperands[0]->getAsTyped()->getBasicType()); + result = createUnaryOperation( + node->getOp(), precision, + TranslateNoContractionDecoration(node->getType().getQualifier()), + convertGlslangToSpvType(node->getType()), operands.front(), + glslangOperands[0]->getAsTyped()->getBasicType()); break; default: result = createMiscOperation(node->getOp(), precision, convertGlslangToSpvType(node->getType()), operands, node->getBasicType()); @@ -1413,7 +1517,7 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt return false; if (! result) { - spv::MissingFunctionality("unknown glslang aggregate"); + logger->missingFunctionality("unknown glslang aggregate"); return true; // pick up a child as a placeholder operand } else { builder.clearAccessChain(); @@ -1492,7 +1596,7 @@ bool TGlslangToSpvTraverser::visitSwitch(glslang::TVisit /* visit */, glslang::T codeSegments.push_back(child); } - // handle the case where the last code segment is missing, due to no code + // handle the case where the last code segment is missing, due to no code // statements between the last case and the end of the switch statement if ((caseValues.size() && (int)codeSegments.size() == valueIndexToSegment[caseValues.size() - 1]) || (int)codeSegments.size() == defaultSegment) @@ -1627,7 +1731,7 @@ bool TGlslangToSpvTraverser::visitBranch(glslang::TVisit /* visit */, glslang::T spv::Id TGlslangToSpvTraverser::createSpvVariable(const glslang::TIntermSymbol* node) { - // First, steer off constants, which are not SPIR-V variables, but + // First, steer off constants, which are not SPIR-V variables, but // can still have a mapping to a SPIR-V Id. // This includes specialization constants. if (node->getQualifier().isConstant()) { @@ -1697,8 +1801,16 @@ spv::Id TGlslangToSpvTraverser::convertGlslangToSpvType(const glslang::TType& ty case glslang::EbtUint: spvType = builder.makeUintType(32); break; + case glslang::EbtInt64: + builder.addCapability(spv::CapabilityInt64); + spvType = builder.makeIntType(64); + break; + case glslang::EbtUint64: + builder.addCapability(spv::CapabilityInt64); + spvType = builder.makeUintType(64); + break; case glslang::EbtAtomicUint: - spv::TbdFunctionality("Is atomic_uint an opaque handle in the uniform storage class, or an addresses in the atomic storage class?"); + logger->tbdFunctionality("Is atomic_uint an opaque handle in the uniform storage class, or an addresses in the atomic storage class?"); spvType = builder.makeUintType(32); break; case glslang::EbtSampler: @@ -1786,7 +1898,11 @@ spv::Id TGlslangToSpvTraverser::convertGlslangToSpvType(const glslang::TType& ty builder.addMemberName(spvType, member, glslangType.getFieldName().c_str()); addMemberDecoration(spvType, member, TranslateLayoutDecoration(glslangType, subQualifier.layoutMatrix)); addMemberDecoration(spvType, member, TranslatePrecisionDecoration(glslangType)); - addMemberDecoration(spvType, member, TranslateInterpolationDecoration(subQualifier)); + // Add interpolation and auxiliary storage decorations only to top-level members of Input and Output storage classes + if (type.getQualifier().storage == glslang::EvqVaryingIn || type.getQualifier().storage == glslang::EvqVaryingOut) { + addMemberDecoration(spvType, member, TranslateInterpolationDecoration(subQualifier)); + addMemberDecoration(spvType, member, TranslateAuxiliaryStorageDecoration(subQualifier)); + } addMemberDecoration(spvType, member, TranslateInvariantDecoration(subQualifier)); if (qualifier.storage == glslang::EvqBuffer) { @@ -1801,8 +1917,14 @@ spv::Id TGlslangToSpvTraverser::convertGlslangToSpvType(const glslang::TType& ty // probably move to the linker stage of the front end proper, and just have the // answer sitting already distributed throughout the individual member locations. int location = -1; // will only decorate if present or inherited - if (subQualifier.hasLocation()) // no inheritance, or override of inheritance + if (subQualifier.hasLocation()) { // no inheritance, or override of inheritance + // struct members should not have explicit locations + assert(type.getBasicType() != glslang::EbtStruct); location = subQualifier.layoutLocation; + } else if (type.getBasicType() != glslang::EbtBlock) { + // If it is a not a Block, (...) Its members are assigned consecutive locations (...) + // The members, and their nested types, must not themselves have Location decorations. + } else if (qualifier.hasLocation()) // inheritance location = qualifier.layoutLocation + locationOffset; if (qualifier.hasLocation()) // track for upcoming inheritance @@ -1828,7 +1950,7 @@ spv::Id TGlslangToSpvTraverser::convertGlslangToSpvType(const glslang::TType& ty builder.addMemberDecoration(spvType, member, spv::DecorationMatrixStride, getMatrixStride(glslangType, explicitLayout, subQualifier.layoutMatrix)); // built-in variable decorations - spv::BuiltIn builtIn = TranslateBuiltInDecoration(glslangType.getQualifier().builtIn); + spv::BuiltIn builtIn = TranslateBuiltInDecoration(glslangType.getQualifier().builtIn, true); if (builtIn != spv::BadValue) addMemberDecoration(spvType, member, spv::DecorationBuiltIn, (int)builtIn); } @@ -1923,7 +2045,7 @@ spv::Id TGlslangToSpvTraverser::makeArraySizeId(const glslang::TArraySizes& arra specNode->traverse(this); return accessChainLoad(specNode->getAsTyped()->getType()); } - + // Otherwise, need a compile-time (front end) size, get it: int size = arraySizes.getDimSize(dim); assert(size > 0); @@ -2070,7 +2192,7 @@ void TGlslangToSpvTraverser::updateMemberOffset(const glslang::TType& /*structTy // Getting this far means we need explicit offsets if (currentOffset < 0) currentOffset = 0; - + // Now, currentOffset is valid (either 0, or from a previous nextOffset), // but possibly not yet correctly aligned. @@ -2081,9 +2203,19 @@ void TGlslangToSpvTraverser::updateMemberOffset(const glslang::TType& /*structTy nextOffset = currentOffset + memberSize; } +void TGlslangToSpvTraverser::declareClipCullCapability(const glslang::TTypeList& members, int member) +{ + if (members[member].type->getQualifier().builtIn == glslang::EbvClipDistance) + builder.addCapability(spv::CapabilityClipDistance); + if (members[member].type->getQualifier().builtIn == glslang::EbvCullDistance) + builder.addCapability(spv::CapabilityCullDistance); +} + bool TGlslangToSpvTraverser::isShaderEntrypoint(const glslang::TIntermAggregate* node) { - return node->getName() == "main("; + // have to ignore mangling and just look at the base name + size_t firstOpen = node->getName().find('('); + return node->getName().compare(0, firstOpen, glslangIntermediate->getEntryPoint().c_str()) == 0; } // Make all the functions, skeletally, without actually visiting their bodies. @@ -2098,7 +2230,7 @@ void TGlslangToSpvTraverser::makeFunctions(const glslang::TIntermSequence& glslF // so that it's available to call. // Translating the body will happen later. // - // Typically (except for a "const in" parameter), an address will be passed to the + // Typically (except for a "const in" parameter), an address will be passed to the // function. What it is an address of varies: // // - "in" parameters not marked as "const" can be written to without modifying the argument, @@ -2168,7 +2300,7 @@ void TGlslangToSpvTraverser::visitFunctions(const glslang::TIntermSequence& glsl void TGlslangToSpvTraverser::handleFunctionEntry(const glslang::TIntermAggregate* node) { - // SPIR-V functions should already be in the functionMap from the prepass + // SPIR-V functions should already be in the functionMap from the prepass // that called makeFunctions(). spv::Function* function = functionMap[node->getName().c_str()]; spv::Block* functionBlock = function->getEntryBlock(); @@ -2426,6 +2558,13 @@ spv::Id TGlslangToSpvTraverser::createImageTextureFunctionCall(glslang::TIntermO bias = true; } + // See if the sampler param should really be just the SPV image part + if (cracked.fetch) { + // a fetch needs to have the image extracted first + if (builder.isSampledImage(params.sampler)) + params.sampler = builder.createUnaryOp(spv::OpImage, builder.getImageType(params.sampler), params.sampler); + } + // set the rest of the arguments params.coords = arguments[1]; @@ -2520,12 +2659,13 @@ spv::Id TGlslangToSpvTraverser::handleUserFunctionCall(const glslang::TIntermAgg std::vector rValues; std::vector argTypes; for (int a = 0; a < (int)glslangArgs.size(); ++a) { + const glslang::TType& paramType = glslangArgs[a]->getAsTyped()->getType(); // build l-value builder.clearAccessChain(); glslangArgs[a]->traverse(this); - argTypes.push_back(&glslangArgs[a]->getAsTyped()->getType()); - // keep outputs as l-values, evaluate input-only as r-values - if (qualifiers[a] != glslang::EvqConstReadOnly) { + argTypes.push_back(¶mType); + // keep outputs as and samplers l-values, evaluate input-only as r-values + if (qualifiers[a] != glslang::EvqConstReadOnly || paramType.getBasicType() == glslang::EbtSampler) { // save l-value lValues.push_back(builder.getAccessChain()); } else { @@ -2542,10 +2682,14 @@ spv::Id TGlslangToSpvTraverser::handleUserFunctionCall(const glslang::TIntermAgg int rValueCount = 0; std::vector spvArgs; for (int a = 0; a < (int)glslangArgs.size(); ++a) { + const glslang::TType& paramType = glslangArgs[a]->getAsTyped()->getType(); spv::Id arg; - if (qualifiers[a] != glslang::EvqConstReadOnly) { + if (paramType.getBasicType() == glslang::EbtSampler) { + builder.setAccessChain(lValues[lValueCount]); + arg = builder.accessChainGetLValue(); + ++lValueCount; + } else if (qualifiers[a] != glslang::EvqConstReadOnly) { // need space to hold the copy - const glslang::TType& paramType = glslangArgs[a]->getAsTyped()->getType(); arg = builder.createVariable(spv::StorageClassFunction, convertGlslangToSpvType(paramType), "param"); if (qualifiers[a] == glslang::EvqIn || qualifiers[a] == glslang::EvqInOut) { // need to copy the input into output space @@ -2582,12 +2726,14 @@ spv::Id TGlslangToSpvTraverser::handleUserFunctionCall(const glslang::TIntermAgg } // Translate AST operation to SPV operation, already having SPV-based operands/types. -spv::Id TGlslangToSpvTraverser::createBinaryOperation(glslang::TOperator op, spv::Decoration precision, +spv::Id TGlslangToSpvTraverser::createBinaryOperation(glslang::TOperator op, spv::Decoration precision, + spv::Decoration noContraction, spv::Id typeId, spv::Id left, spv::Id right, glslang::TBasicType typeProxy, bool reduceComparison) { - bool isUnsigned = typeProxy == glslang::EbtUint; + bool isUnsigned = typeProxy == glslang::EbtUint || typeProxy == glslang::EbtUint64; bool isFloat = typeProxy == glslang::EbtFloat || typeProxy == glslang::EbtDouble; + bool isBool = typeProxy == glslang::EbtBool; spv::Op binOp = spv::OpNop; bool needMatchingVectors = true; // for non-matrix ops, would a scalar need to smear to match a vector? @@ -2617,7 +2763,7 @@ spv::Id TGlslangToSpvTraverser::createBinaryOperation(glslang::TOperator op, spv break; case glslang::EOpVectorTimesScalar: case glslang::EOpVectorTimesScalarAssign: - if (isFloat) { + if (isFloat && (builder.isVector(left) || builder.isVector(right))) { if (builder.isVector(right)) std::swap(left, right); assert(builder.isScalar(right)); @@ -2718,13 +2864,15 @@ spv::Id TGlslangToSpvTraverser::createBinaryOperation(glslang::TOperator op, spv if (binOp != spv::OpNop) { assert(comparison == false); if (builder.isMatrix(left) || builder.isMatrix(right)) - return createBinaryMatrixOperation(binOp, precision, typeId, left, right); + return createBinaryMatrixOperation(binOp, precision, noContraction, typeId, left, right); // No matrix involved; make both operands be the same number of components, if needed if (needMatchingVectors) builder.promoteScalar(precision, left, right); - return builder.setPrecision(builder.createBinOp(binOp, typeId, left, right), precision); + spv::Id result = builder.createBinOp(binOp, typeId, left, right); + addDecoration(result, noContraction); + return builder.setPrecision(result, precision); } if (! comparison) @@ -2775,6 +2923,8 @@ spv::Id TGlslangToSpvTraverser::createBinaryOperation(glslang::TOperator op, spv case glslang::EOpVectorEqual: if (isFloat) binOp = spv::OpFOrdEqual; + else if (isBool) + binOp = spv::OpLogicalEqual; else binOp = spv::OpIEqual; break; @@ -2782,6 +2932,8 @@ spv::Id TGlslangToSpvTraverser::createBinaryOperation(glslang::TOperator op, spv case glslang::EOpVectorNotEqual: if (isFloat) binOp = spv::OpFOrdNotEqual; + else if (isBool) + binOp = spv::OpLogicalNotEqual; else binOp = spv::OpINotEqual; break; @@ -2789,8 +2941,11 @@ spv::Id TGlslangToSpvTraverser::createBinaryOperation(glslang::TOperator op, spv break; } - if (binOp != spv::OpNop) - return builder.setPrecision(builder.createBinOp(binOp, typeId, left, right), precision); + if (binOp != spv::OpNop) { + spv::Id result = builder.createBinOp(binOp, typeId, left, right); + addDecoration(result, noContraction); + return builder.setPrecision(result, precision); + } return 0; } @@ -2809,7 +2964,7 @@ spv::Id TGlslangToSpvTraverser::createBinaryOperation(glslang::TOperator op, spv // matrix op scalar op in {+, -, /} // scalar op matrix op in {+, -, /} // -spv::Id TGlslangToSpvTraverser::createBinaryMatrixOperation(spv::Op op, spv::Decoration precision, spv::Id typeId, spv::Id left, spv::Id right) +spv::Id TGlslangToSpvTraverser::createBinaryMatrixOperation(spv::Op op, spv::Decoration precision, spv::Decoration noContraction, spv::Id typeId, spv::Id left, spv::Id right) { bool firstClass = true; @@ -2845,8 +3000,11 @@ spv::Id TGlslangToSpvTraverser::createBinaryMatrixOperation(spv::Op op, spv::Dec break; } - if (firstClass) - return builder.setPrecision(builder.createBinOp(op, typeId, left, right), precision); + if (firstClass) { + spv::Id result = builder.createBinOp(op, typeId, left, right); + addDecoration(result, noContraction); + return builder.setPrecision(result, precision); + } // Handle component-wise +, -, *, and / for all combinations of type. // The result type of all of them is the same type as the (a) matrix operand. @@ -2881,8 +3039,9 @@ spv::Id TGlslangToSpvTraverser::createBinaryMatrixOperation(spv::Op op, spv::Dec indexes.push_back(c); spv::Id leftVec = leftMat ? builder.createCompositeExtract( left, vecType, indexes) : smearVec; spv::Id rightVec = rightMat ? builder.createCompositeExtract(right, vecType, indexes) : smearVec; - results.push_back(builder.createBinOp(op, vecType, leftVec, rightVec)); - builder.setPrecision(results.back(), precision); + spv::Id result = builder.createBinOp(op, vecType, leftVec, rightVec); + addDecoration(result, noContraction); + results.push_back(builder.setPrecision(result, precision)); } // put the pieces together @@ -2894,11 +3053,11 @@ spv::Id TGlslangToSpvTraverser::createBinaryMatrixOperation(spv::Op op, spv::Dec } } -spv::Id TGlslangToSpvTraverser::createUnaryOperation(glslang::TOperator op, spv::Decoration precision, spv::Id typeId, spv::Id operand, glslang::TBasicType typeProxy) +spv::Id TGlslangToSpvTraverser::createUnaryOperation(glslang::TOperator op, spv::Decoration precision, spv::Decoration noContraction, spv::Id typeId, spv::Id operand, glslang::TBasicType typeProxy) { spv::Op unaryOp = spv::OpNop; int libCall = -1; - bool isUnsigned = typeProxy == glslang::EbtUint; + bool isUnsigned = typeProxy == glslang::EbtUint || typeProxy == glslang::EbtUint64; bool isFloat = typeProxy == glslang::EbtFloat || typeProxy == glslang::EbtDouble; switch (op) { @@ -2906,7 +3065,7 @@ spv::Id TGlslangToSpvTraverser::createUnaryOperation(glslang::TOperator op, spv: if (isFloat) { unaryOp = spv::OpFNegate; if (builder.isMatrixType(typeId)) - return createUnaryMatrixOperation(unaryOp, precision, typeId, operand, typeProxy); + return createUnaryMatrixOperation(unaryOp, precision, noContraction, typeId, operand, typeProxy); } else unaryOp = spv::OpSNegate; break; @@ -3029,6 +3188,10 @@ spv::Id TGlslangToSpvTraverser::createUnaryOperation(glslang::TOperator op, spv: case glslang::EOpFloatBitsToUint: case glslang::EOpIntBitsToFloat: case glslang::EOpUintBitsToFloat: + case glslang::EOpDoubleBitsToInt64: + case glslang::EOpDoubleBitsToUint64: + case glslang::EOpInt64BitsToDouble: + case glslang::EOpUint64BitsToDouble: unaryOp = spv::OpBitcast; break; @@ -3069,6 +3232,14 @@ spv::Id TGlslangToSpvTraverser::createUnaryOperation(glslang::TOperator op, spv: libCall = spv::GLSLstd450UnpackDouble2x32; break; + case glslang::EOpPackInt2x32: + case glslang::EOpUnpackInt2x32: + case glslang::EOpPackUint2x32: + case glslang::EOpUnpackUint2x32: + logger->missingFunctionality("shader int64"); + libCall = spv::GLSLstd450Bad; // TODO: This is a placeholder. + break; + case glslang::EOpDPdx: unaryOp = spv::OpDPdx; break; @@ -3152,6 +3323,17 @@ spv::Id TGlslangToSpvTraverser::createUnaryOperation(glslang::TOperator op, spv: libCall = spv::GLSLstd450FindSMsb; break; + case glslang::EOpBallot: + case glslang::EOpReadFirstInvocation: + logger->missingFunctionality("shader ballot"); + libCall = spv::GLSLstd450Bad; + break; + + case glslang::EOpAnyInvocation: + case glslang::EOpAllInvocations: + case glslang::EOpAllInvocationsEqual: + return createInvocationsOperation(op, typeId, operand); + default: return 0; } @@ -3161,14 +3343,16 @@ spv::Id TGlslangToSpvTraverser::createUnaryOperation(glslang::TOperator op, spv: std::vector args; args.push_back(operand); id = builder.createBuiltinCall(typeId, stdBuiltins, libCall, args); - } else + } else { id = builder.createUnaryOp(unaryOp, typeId, operand); + } + addDecoration(id, noContraction); return builder.setPrecision(id, precision); } // Create a unary operation on a matrix -spv::Id TGlslangToSpvTraverser::createUnaryMatrixOperation(spv::Op op, spv::Decoration precision, spv::Id typeId, spv::Id operand, glslang::TBasicType /* typeProxy */) +spv::Id TGlslangToSpvTraverser::createUnaryMatrixOperation(spv::Op op, spv::Decoration precision, spv::Decoration noContraction, spv::Id typeId, spv::Id operand, glslang::TBasicType /* typeProxy */) { // Handle unary operations vector by vector. // The result type is the same type as the original type. @@ -3180,35 +3364,40 @@ spv::Id TGlslangToSpvTraverser::createUnaryMatrixOperation(spv::Op op, spv::Deco // get the types sorted out int numCols = builder.getNumColumns(operand); int numRows = builder.getNumRows(operand); - spv::Id scalarType = builder.getScalarTypeId(typeId); - spv::Id vecType = builder.makeVectorType(scalarType, numRows); + spv::Id srcVecType = builder.makeVectorType(builder.getScalarTypeId(builder.getTypeId(operand)), numRows); + spv::Id destVecType = builder.makeVectorType(builder.getScalarTypeId(typeId), numRows); std::vector results; // do each vector op for (int c = 0; c < numCols; ++c) { std::vector indexes; indexes.push_back(c); - spv::Id vec = builder.createCompositeExtract(operand, vecType, indexes); - results.push_back(builder.createUnaryOp(op, vecType, vec)); - builder.setPrecision(results.back(), precision); + spv::Id srcVec = builder.createCompositeExtract(operand, srcVecType, indexes); + spv::Id destVec = builder.createUnaryOp(op, destVecType, srcVec); + addDecoration(destVec, noContraction); + results.push_back(builder.setPrecision(destVec, precision)); } // put the pieces together return builder.setPrecision(builder.createCompositeConstruct(typeId, results), precision); } -spv::Id TGlslangToSpvTraverser::createConversion(glslang::TOperator op, spv::Decoration precision, spv::Id destType, spv::Id operand) +spv::Id TGlslangToSpvTraverser::createConversion(glslang::TOperator op, spv::Decoration precision, spv::Decoration noContraction, spv::Id destType, spv::Id operand, glslang::TBasicType typeProxy) { spv::Op convOp = spv::OpNop; spv::Id zero = 0; spv::Id one = 0; + spv::Id type = 0; int vectorSize = builder.isVectorType(destType) ? builder.getNumTypeComponents(destType) : 0; switch (op) { case glslang::EOpConvIntToBool: case glslang::EOpConvUintToBool: - zero = builder.makeUintConstant(0); + case glslang::EOpConvInt64ToBool: + case glslang::EOpConvUint64ToBool: + zero = (op == glslang::EOpConvInt64ToBool || + op == glslang::EOpConvUint64ToBool) ? builder.makeUint64Constant(0) : builder.makeUintConstant(0); zero = makeSmearedConstant(zero, vectorSize); return builder.createBinOp(spv::OpINotEqual, destType, operand, zero); @@ -3233,45 +3422,124 @@ spv::Id TGlslangToSpvTraverser::createConversion(glslang::TOperator op, spv::Dec one = builder.makeDoubleConstant(1.0); break; case glslang::EOpConvBoolToInt: - zero = builder.makeIntConstant(0); - one = builder.makeIntConstant(1); + case glslang::EOpConvBoolToInt64: + zero = (op == glslang::EOpConvBoolToInt64) ? builder.makeInt64Constant(0) : builder.makeIntConstant(0); + one = (op == glslang::EOpConvBoolToInt64) ? builder.makeInt64Constant(1) : builder.makeIntConstant(1); convOp = spv::OpSelect; break; case glslang::EOpConvBoolToUint: - zero = builder.makeUintConstant(0); - one = builder.makeUintConstant(1); + case glslang::EOpConvBoolToUint64: + zero = (op == glslang::EOpConvBoolToUint64) ? builder.makeUint64Constant(0) : builder.makeUintConstant(0); + one = (op == glslang::EOpConvBoolToUint64) ? builder.makeUint64Constant(1) : builder.makeUintConstant(1); convOp = spv::OpSelect; break; case glslang::EOpConvIntToFloat: case glslang::EOpConvIntToDouble: + case glslang::EOpConvInt64ToFloat: + case glslang::EOpConvInt64ToDouble: convOp = spv::OpConvertSToF; break; case glslang::EOpConvUintToFloat: case glslang::EOpConvUintToDouble: + case glslang::EOpConvUint64ToFloat: + case glslang::EOpConvUint64ToDouble: convOp = spv::OpConvertUToF; break; case glslang::EOpConvDoubleToFloat: case glslang::EOpConvFloatToDouble: convOp = spv::OpFConvert; + if (builder.isMatrixType(destType)) + return createUnaryMatrixOperation(convOp, precision, noContraction, destType, operand, typeProxy); break; case glslang::EOpConvFloatToInt: case glslang::EOpConvDoubleToInt: + case glslang::EOpConvFloatToInt64: + case glslang::EOpConvDoubleToInt64: convOp = spv::OpConvertFToS; break; case glslang::EOpConvUintToInt: case glslang::EOpConvIntToUint: + case glslang::EOpConvUint64ToInt64: + case glslang::EOpConvInt64ToUint64: + if (builder.isInSpecConstCodeGenMode()) { + // Build zero scalar or vector for OpIAdd. + zero = (op == glslang::EOpConvUintToInt64 || + op == glslang::EOpConvIntToUint64) ? builder.makeUint64Constant(0) : builder.makeUintConstant(0); + zero = makeSmearedConstant(zero, vectorSize); + // Use OpIAdd, instead of OpBitcast to do the conversion when + // generating for OpSpecConstantOp instruction. + return builder.createBinOp(spv::OpIAdd, destType, operand, zero); + } + // For normal run-time conversion instruction, use OpBitcast. convOp = spv::OpBitcast; break; case glslang::EOpConvFloatToUint: case glslang::EOpConvDoubleToUint: + case glslang::EOpConvFloatToUint64: + case glslang::EOpConvDoubleToUint64: convOp = spv::OpConvertFToU; break; + + case glslang::EOpConvIntToInt64: + case glslang::EOpConvInt64ToInt: + convOp = spv::OpSConvert; + break; + + case glslang::EOpConvUintToUint64: + case glslang::EOpConvUint64ToUint: + convOp = spv::OpUConvert; + break; + + case glslang::EOpConvIntToUint64: + case glslang::EOpConvInt64ToUint: + case glslang::EOpConvUint64ToInt: + case glslang::EOpConvUintToInt64: + // OpSConvert/OpUConvert + OpBitCast + switch (op) { + case glslang::EOpConvIntToUint64: + convOp = spv::OpSConvert; + type = builder.makeIntType(64); + break; + case glslang::EOpConvInt64ToUint: + convOp = spv::OpSConvert; + type = builder.makeIntType(32); + break; + case glslang::EOpConvUint64ToInt: + convOp = spv::OpUConvert; + type = builder.makeUintType(32); + break; + case glslang::EOpConvUintToInt64: + convOp = spv::OpUConvert; + type = builder.makeUintType(64); + break; + default: + assert(0); + break; + } + + if (vectorSize > 0) + type = builder.makeVectorType(type, vectorSize); + + operand = builder.createUnaryOp(convOp, type, operand); + + if (builder.isInSpecConstCodeGenMode()) { + // Build zero scalar or vector for OpIAdd. + zero = (op == glslang::EOpConvIntToUint64 || + op == glslang::EOpConvUintToInt64) ? builder.makeUint64Constant(0) : builder.makeUintConstant(0); + zero = makeSmearedConstant(zero, vectorSize); + // Use OpIAdd, instead of OpBitcast to do the conversion when + // generating for OpSpecConstantOp instruction. + return builder.createBinOp(spv::OpIAdd, destType, operand, zero); + } + // For normal run-time conversion instruction, use OpBitcast. + convOp = spv::OpBitcast; + break; default: break; } @@ -3380,9 +3648,37 @@ spv::Id TGlslangToSpvTraverser::createAtomicOperation(glslang::TOperator op, spv return builder.createOp(opCode, typeId, spvAtomicOperands); } +// Create group invocation operations. +spv::Id TGlslangToSpvTraverser::createInvocationsOperation(glslang::TOperator op, spv::Id typeId, spv::Id operand) +{ + builder.addCapability(spv::CapabilityGroups); + + std::vector operands; + operands.push_back(builder.makeUintConstant(spv::ScopeSubgroup)); + operands.push_back(operand); + + switch (op) { + case glslang::EOpAnyInvocation: + case glslang::EOpAllInvocations: + return builder.createOp(op == glslang::EOpAnyInvocation ? spv::OpGroupAny : spv::OpGroupAll, typeId, operands); + + case glslang::EOpAllInvocationsEqual: + { + spv::Id groupAll = builder.createOp(spv::OpGroupAll, typeId, operands); + spv::Id groupAny = builder.createOp(spv::OpGroupAny, typeId, operands); + + return builder.createBinOp(spv::OpLogicalOr, typeId, groupAll, + builder.createUnaryOp(spv::OpLogicalNot, typeId, groupAny)); + } + default: + logger->missingFunctionality("invocation operation"); + return spv::NoResult; + } +} + spv::Id TGlslangToSpvTraverser::createMiscOperation(glslang::TOperator op, spv::Decoration precision, spv::Id typeId, std::vector& operands, glslang::TBasicType typeProxy) { - bool isUnsigned = typeProxy == glslang::EbtUint; + bool isUnsigned = typeProxy == glslang::EbtUint || typeProxy == glslang::EbtUint64; bool isFloat = typeProxy == glslang::EbtFloat || typeProxy == glslang::EbtDouble; spv::Op opCode = spv::OpNop; @@ -3524,6 +3820,11 @@ spv::Id TGlslangToSpvTraverser::createMiscOperation(glslang::TOperator op, spv:: libCall = spv::GLSLstd450Ldexp; break; + case glslang::EOpReadInvocation: + logger->missingFunctionality("shader ballot"); + libCall = spv::GLSLstd450Bad; + break; + default: return 0; } @@ -3593,7 +3894,8 @@ spv::Id TGlslangToSpvTraverser::createNoArgOperation(glslang::TOperator op) builder.createNoResultOp(spv::OpEndPrimitive); return 0; case glslang::EOpBarrier: - builder.createMemoryBarrier(spv::ScopeDevice, spv::MemorySemanticsAllMemory); + if (glslangIntermediate->getProfile() != EEsProfile) + builder.createMemoryBarrier(spv::ScopeDevice, spv::MemorySemanticsAllMemory); builder.createControlBarrier(spv::ScopeDevice, spv::ScopeDevice, spv::MemorySemanticsMaskNone); return 0; case glslang::EOpMemoryBarrier: @@ -3615,7 +3917,7 @@ spv::Id TGlslangToSpvTraverser::createNoArgOperation(glslang::TOperator op) builder.createMemoryBarrier(spv::ScopeDevice, spv::MemorySemanticsCrossWorkgroupMemoryMask); return 0; default: - spv::MissingFunctionality("unknown operation with no arguments"); + logger->missingFunctionality("unknown operation with no arguments"); return 0; } } @@ -3636,10 +3938,9 @@ spv::Id TGlslangToSpvTraverser::getSymbolId(const glslang::TIntermSymbol* symbol if (! symbol->getType().isStruct()) { addDecoration(id, TranslatePrecisionDecoration(symbol->getType())); addDecoration(id, TranslateInterpolationDecoration(symbol->getType().getQualifier())); + addDecoration(id, TranslateAuxiliaryStorageDecoration(symbol->getType().getQualifier())); if (symbol->getType().getQualifier().hasSpecConstantId()) addDecoration(id, spv::DecorationSpecId, symbol->getType().getQualifier().layoutSpecConstantId); - if (symbol->getQualifier().hasLocation()) - builder.addDecoration(id, spv::DecorationLocation, symbol->getQualifier().layoutLocation); if (symbol->getQualifier().hasIndex()) builder.addDecoration(id, spv::DecorationIndex, symbol->getQualifier().layoutIndex); if (symbol->getQualifier().hasComponent()) @@ -3655,6 +3956,8 @@ spv::Id TGlslangToSpvTraverser::getSymbolId(const glslang::TIntermSymbol* symbol } } + if (symbol->getQualifier().hasLocation()) + builder.addDecoration(id, spv::DecorationLocation, symbol->getQualifier().layoutLocation); addDecoration(id, TranslateInvariantDecoration(symbol->getType().getQualifier())); if (symbol->getQualifier().hasStream() && glslangIntermediate->isMultiStream()) { builder.addCapability(spv::CapabilityGeometryStreams); @@ -3686,7 +3989,7 @@ spv::Id TGlslangToSpvTraverser::getSymbolId(const glslang::TIntermSymbol* symbol } // built-in variable decorations - spv::BuiltIn builtIn = TranslateBuiltInDecoration(symbol->getQualifier().builtIn); + spv::BuiltIn builtIn = TranslateBuiltInDecoration(symbol->getQualifier().builtIn, false); if (builtIn != spv::BadValue) addDecoration(id, spv::DecorationBuiltIn, (int)builtIn); @@ -3735,6 +4038,7 @@ spv::Id TGlslangToSpvTraverser::createSpvConstant(const glslang::TIntermTyped& n { assert(node.getQualifier().isConstant()); + // Handle front-end constants first (non-specialization constants). if (! node.getQualifier().specConstant) { // hand off to the non-spec-constant path assert(node.getAsConstantUnion() != nullptr || node.getAsSymbolNode() != nullptr); @@ -3745,31 +4049,39 @@ spv::Id TGlslangToSpvTraverser::createSpvConstant(const glslang::TIntermTyped& n // We now know we have a specialization constant to build - if (node.getAsSymbolNode() && node.getQualifier().hasSpecConstantId()) { - // this is a direct literal assigned to a layout(constant_id=) declaration - int nextConst = 0; - return createSpvConstantFromConstUnionArray(node.getType(), node.getAsConstantUnion() ? node.getAsConstantUnion()->getConstArray() : node.getAsSymbolNode()->getConstArray(), - nextConst, true); - } else { - // gl_WorkgroupSize is a special case until the front-end handles hierarchical specialization constants, - // even then, it's specialization ids are handled by special case syntax in GLSL: layout(local_size_x = ... - if (node.getType().getQualifier().builtIn == glslang::EbvWorkGroupSize) { - std::vector dimConstId; - for (int dim = 0; dim < 3; ++dim) { - bool specConst = (glslangIntermediate->getLocalSizeSpecId(dim) != glslang::TQualifier::layoutNotSet); - dimConstId.push_back(builder.makeUintConstant(glslangIntermediate->getLocalSize(dim), specConst)); - if (specConst) - addDecoration(dimConstId.back(), spv::DecorationSpecId, glslangIntermediate->getLocalSizeSpecId(dim)); - } - return builder.makeCompositeConstant(builder.makeVectorType(builder.makeUintType(32), 3), dimConstId, true); - } else if (auto* sn = node.getAsSymbolNode()){ - return createSpvConstantFromConstSubTree(sn->getConstSubtree()); - } else { - spv::MissingFunctionality("Neither a front-end constant nor a spec constant."); - exit(1); - return spv::NoResult; + // gl_WorkGroupSize is a special case until the front-end handles hierarchical specialization constants, + // even then, it's specialization ids are handled by special case syntax in GLSL: layout(local_size_x = ... + if (node.getType().getQualifier().builtIn == glslang::EbvWorkGroupSize) { + std::vector dimConstId; + for (int dim = 0; dim < 3; ++dim) { + bool specConst = (glslangIntermediate->getLocalSizeSpecId(dim) != glslang::TQualifier::layoutNotSet); + dimConstId.push_back(builder.makeUintConstant(glslangIntermediate->getLocalSize(dim), specConst)); + if (specConst) + addDecoration(dimConstId.back(), spv::DecorationSpecId, glslangIntermediate->getLocalSizeSpecId(dim)); + } + return builder.makeCompositeConstant(builder.makeVectorType(builder.makeUintType(32), 3), dimConstId, true); + } + + // An AST node labelled as specialization constant should be a symbol node. + // Its initializer should either be a sub tree with constant nodes, or a constant union array. + if (auto* sn = node.getAsSymbolNode()) { + if (auto* sub_tree = sn->getConstSubtree()) { + // Traverse the constant constructor sub tree like generating normal run-time instructions. + // During the AST traversal, if the node is marked as 'specConstant', SpecConstantOpModeGuard + // will set the builder into spec constant op instruction generating mode. + sub_tree->traverse(this); + return accessChainLoad(sub_tree->getType()); + } else if (auto* const_union_array = &sn->getConstArray()){ + int nextConst = 0; + return createSpvConstantFromConstUnionArray(sn->getType(), *const_union_array, nextConst, true); } } + + // Neither a front-end constant node, nor a specialization constant node with constant union array or + // constant sub tree as initializer. + logger->missingFunctionality("Neither a front-end constant nor a spec constant."); + exit(1); + return spv::NoResult; } // Use 'consts' as the flattened glslang source of scalar constants to recursively @@ -3798,7 +4110,7 @@ spv::Id TGlslangToSpvTraverser::createSpvConstantFromConstUnionArray(const glsla glslang::TVector::const_iterator iter; for (iter = glslangType.getStruct()->begin(); iter != glslangType.getStruct()->end(); ++iter) spvConsts.push_back(createSpvConstantFromConstUnionArray(*iter->type, consts, nextConst, false)); - } else if (glslangType.isVector()) { + } else if (glslangType.getVectorSize() > 1) { for (unsigned int i = 0; i < (unsigned int)glslangType.getVectorSize(); ++i) { bool zero = nextConst >= consts.size(); switch (glslangType.getBasicType()) { @@ -3808,6 +4120,12 @@ spv::Id TGlslangToSpvTraverser::createSpvConstantFromConstUnionArray(const glsla case glslang::EbtUint: spvConsts.push_back(builder.makeUintConstant(zero ? 0 : consts[nextConst].getUConst())); break; + case glslang::EbtInt64: + spvConsts.push_back(builder.makeInt64Constant(zero ? 0 : consts[nextConst].getI64Const())); + break; + case glslang::EbtUint64: + spvConsts.push_back(builder.makeUint64Constant(zero ? 0 : consts[nextConst].getU64Const())); + break; case glslang::EbtFloat: spvConsts.push_back(builder.makeFloatConstant(zero ? 0.0F : (float)consts[nextConst].getDConst())); break; @@ -3834,6 +4152,12 @@ spv::Id TGlslangToSpvTraverser::createSpvConstantFromConstUnionArray(const glsla case glslang::EbtUint: scalar = builder.makeUintConstant(zero ? 0 : consts[nextConst].getUConst(), specConstant); break; + case glslang::EbtInt64: + scalar = builder.makeInt64Constant(zero ? 0 : consts[nextConst].getI64Const(), specConstant); + break; + case glslang::EbtUint64: + scalar = builder.makeUint64Constant(zero ? 0 : consts[nextConst].getU64Const(), specConstant); + break; case glslang::EbtFloat: scalar = builder.makeFloatConstant(zero ? 0.0F : (float)consts[nextConst].getDConst(), specConstant); break; @@ -3854,66 +4178,6 @@ spv::Id TGlslangToSpvTraverser::createSpvConstantFromConstUnionArray(const glsla return builder.makeCompositeConstant(typeId, spvConsts); } -// Create constant ID from const initializer sub tree. -spv::Id TGlslangToSpvTraverser::createSpvConstantFromConstSubTree( - const glslang::TIntermTyped* subTree) { - const glslang::TType& glslangType = subTree->getType(); - spv::Id typeId = convertGlslangToSpvType(glslangType); - bool is_spec_const = subTree->getType().getQualifier().isSpecConstant(); - if (const glslang::TIntermAggregate* an = subTree->getAsAggregate()) { - // Aggregate node, we should generate OpConstantComposite or - // OpSpecConstantComposite instruction. - std::vector const_constituents; - for (auto NI = an->getSequence().begin(); NI != an->getSequence().end(); - NI++) { - const_constituents.push_back( - createSpvConstantFromConstSubTree((*NI)->getAsTyped())); - } - // Note that constructors are aggregate nodes, so expressions like: - // float x = float(y) will become an aggregate node. If 'x' is declared - // as a constant, the aggregate node representing 'float(y)' will be - // processed here. - if (builder.isVectorType(typeId) || builder.isMatrixType(typeId) || - builder.isAggregateType(typeId)) { - return builder.makeCompositeConstant(typeId, const_constituents, is_spec_const); - } else { - assert(builder.isScalarType(typeId) && const_constituents.size() == 1); - return const_constituents.front(); - } - - } else if (const glslang::TIntermBinary* bn = subTree->getAsBinaryNode()) { - // Binary operation node, we should generate OpSpecConstantOp - // This case should only happen when Specialization Constants are involved. - spv::MissingFunctionality("OpSpecConstantOp not implemented"); - return spv::NoResult; - - } else if (const glslang::TIntermUnary* un = subTree->getAsUnaryNode()) { - // Unary operation node, similar to binary operation node, should only - // happen when specialization constants are involved. - spv::MissingFunctionality("OpSpecConstantOp not implemented"); - return spv::NoResult; - - } else if (const glslang::TIntermConstantUnion* cn = subTree->getAsConstantUnion()) { - // ConstantUnion node, should redirect to - // createSpvConstantFromConstUnionArray - int nextConst = 0; - return createSpvConstantFromConstUnionArray( - glslangType, cn->getConstArray(), nextConst, is_spec_const); - - } else if (const glslang::TIntermSymbol* sn = subTree->getAsSymbolNode()) { - // Symbol node. Call getSymbolId(). This should cover both cases 1) the - // symbol has already been assigned an ID, 2) need a new ID for this - // symbol. - return getSymbolId(sn); - - } else { - spv::MissingFunctionality( - "createSpvConstantFromConstSubTree() not covered TIntermTyped* const " - "initializer subtree."); - return spv::NoResult; - } -} - // Return true if the node is a constant or symbol whose reading has no // non-trivial observable cost or effect. bool TGlslangToSpvTraverser::isTrivialLeaf(const glslang::TIntermTyped* node) @@ -3943,7 +4207,7 @@ bool TGlslangToSpvTraverser::isTrivialLeaf(const glslang::TIntermTyped* node) default: return false; } -} +} // A node is trivial if it is a single operation with no side effects. // Error on the side of saying non-trivial. @@ -4069,6 +4333,12 @@ void OutputSpv(const std::vector& spirv, const char* baseName) // Set up the glslang traversal // void GlslangToSpv(const glslang::TIntermediate& intermediate, std::vector& spirv) +{ + spv::SpvBuildLogger logger; + GlslangToSpv(intermediate, spirv, &logger); +} + +void GlslangToSpv(const glslang::TIntermediate& intermediate, std::vector& spirv, spv::SpvBuildLogger* logger) { TIntermNode* root = intermediate.getTreeRoot(); @@ -4077,7 +4347,7 @@ void GlslangToSpv(const glslang::TIntermediate& intermediate, std::vectortraverse(&it); diff --git a/SPIRV/GlslangToSpv.h b/SPIRV/GlslangToSpv.h index d8a18893..8d006f38 100644 --- a/SPIRV/GlslangToSpv.h +++ b/SPIRV/GlslangToSpv.h @@ -34,10 +34,16 @@ #include "../glslang/Include/intermediate.h" +#include +#include + +#include "Logger.h" + namespace glslang { void GetSpirvVersion(std::string&); void GlslangToSpv(const glslang::TIntermediate& intermediate, std::vector& spirv); +void GlslangToSpv(const glslang::TIntermediate& intermediate, std::vector& spirv, spv::SpvBuildLogger* logger); void OutputSpv(const std::vector& spirv, const char* baseName); -}; +} diff --git a/SPIRV/InReadableOrder.cpp b/SPIRV/InReadableOrder.cpp index 142d716b..86aae6d0 100644 --- a/SPIRV/InReadableOrder.cpp +++ b/SPIRV/InReadableOrder.cpp @@ -32,10 +32,6 @@ //ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE //POSSIBILITY OF SUCH DAMAGE. -// -// Author: Dejan Mircevski, Google -// - // The SPIR-V spec requires code blocks to appear in an order satisfying the // dominator-tree direction (ie, dominator before the dominated). This is, // actually, easy to achieve: any pre-order CFG traversal algorithm will do it. diff --git a/SPIRV/Logger.cpp b/SPIRV/Logger.cpp new file mode 100644 index 00000000..48bd4e3a --- /dev/null +++ b/SPIRV/Logger.cpp @@ -0,0 +1,68 @@ +// +// Copyright (C) 2016 Google, Inc. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. + +#include "Logger.h" + +#include +#include +#include + +namespace spv { + +void SpvBuildLogger::tbdFunctionality(const std::string& f) +{ + if (std::find(std::begin(tbdFeatures), std::end(tbdFeatures), f) == std::end(tbdFeatures)) + tbdFeatures.push_back(f); +} + +void SpvBuildLogger::missingFunctionality(const std::string& f) +{ + if (std::find(std::begin(missingFeatures), std::end(missingFeatures), f) == std::end(missingFeatures)) + missingFeatures.push_back(f); +} + +std::string SpvBuildLogger::getAllMessages() const { + std::ostringstream messages; + for (auto it = tbdFeatures.cbegin(); it != tbdFeatures.cend(); ++it) + messages << "TBD functionality: " << *it << "\n"; + for (auto it = missingFeatures.cbegin(); it != missingFeatures.cend(); ++it) + messages << "Missing functionality: " << *it << "\n"; + for (auto it = warnings.cbegin(); it != warnings.cend(); ++it) + messages << "warning: " << *it << "\n"; + for (auto it = errors.cbegin(); it != errors.cend(); ++it) + messages << "error: " << *it << "\n"; + return messages.str(); +} + +} // end spv namespace diff --git a/SPIRV/Logger.h b/SPIRV/Logger.h new file mode 100644 index 00000000..2e4ddaf5 --- /dev/null +++ b/SPIRV/Logger.h @@ -0,0 +1,74 @@ +// +// Copyright (C) 2016 Google, Inc. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. + +#ifndef GLSLANG_SPIRV_LOGGER_H +#define GLSLANG_SPIRV_LOGGER_H + +#include +#include + +namespace spv { + +// A class for holding all SPIR-V build status messages, including +// missing/TBD functionalities, warnings, and errors. +class SpvBuildLogger { +public: + SpvBuildLogger() {} + + // Registers a TBD functionality. + void tbdFunctionality(const std::string& f); + // Registers a missing functionality. + void missingFunctionality(const std::string& f); + + // Logs a warning. + void warning(const std::string& w) { warnings.push_back(w); } + // Logs an error. + void error(const std::string& e) { errors.push_back(e); } + + // Returns all messages accumulated in the order of: + // TBD functionalities, missing functionalities, warnings, errors. + std::string getAllMessages() const; + +private: + SpvBuildLogger(const SpvBuildLogger&); + + std::vector tbdFeatures; + std::vector missingFeatures; + std::vector warnings; + std::vector errors; +}; + +} // end spv namespace + +#endif // GLSLANG_SPIRV_LOGGER_H diff --git a/SPIRV/SPVRemapper.cpp b/SPIRV/SPVRemapper.cpp index 965867ef..1bbd5892 100755 --- a/SPIRV/SPVRemapper.cpp +++ b/SPIRV/SPVRemapper.cpp @@ -573,7 +573,7 @@ namespace spv { op_fn_nop); // Window size for context-sensitive canonicalization values - // Emperical best size from a single data set. TODO: Would be a good tunable. + // Empirical best size from a single data set. TODO: Would be a good tunable. // We essentially perform a little convolution around each instruction, // to capture the flavor of nearby code, to hopefully match to similar // code in other modules. @@ -926,8 +926,17 @@ namespace spv { // Count function variable use process( [&](spv::Op opCode, unsigned start) { - if (opCode == spv::OpVariable) { ++varUseCount[asId(start+2)]; return true; } - return false; + if (opCode == spv::OpVariable) { + ++varUseCount[asId(start+2)]; + return true; + } else if (opCode == spv::OpEntryPoint) { + const int wordCount = asWordCount(start); + for (int i = 4; i < wordCount; i++) { + ++varUseCount[asId(start+i)]; + } + return true; + } else + return false; }, [&](spv::Id& id) { if (varUseCount[id]) ++varUseCount[id]; } diff --git a/SPIRV/SpvBuilder.cpp b/SPIRV/SpvBuilder.cpp index 8787082b..b7e5ef0c 100644 --- a/SPIRV/SpvBuilder.cpp +++ b/SPIRV/SpvBuilder.cpp @@ -33,20 +33,16 @@ //ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE //POSSIBILITY OF SUCH DAMAGE. -// -// Author: John Kessenich, LunarG -// - // // Helper for making SPIR-V IR. Generally, this is documented in the header // SpvBuilder.h. // #include -#include #include #include +#include #include "SpvBuilder.h" @@ -56,15 +52,17 @@ namespace spv { -Builder::Builder(unsigned int magicNumber) - : source(SourceLanguageUnknown), - sourceVersion(0), - addressModel(AddressingModelLogical), - memoryModel(MemoryModelGLSL450), - builderNumber(magicNumber), - buildPoint(0), - uniqueId(0), - mainFunction(0) +Builder::Builder(unsigned int magicNumber, SpvBuildLogger* buildLogger) : + source(SourceLanguageUnknown), + sourceVersion(0), + addressModel(AddressingModelLogical), + memoryModel(MemoryModelGLSL450), + builderNumber(magicNumber), + buildPoint(0), + uniqueId(0), + mainFunction(0), + generatingOpCodeForSpecConst(false), + logger(buildLogger) { clearAccessChain(); } @@ -616,7 +614,7 @@ Id Builder::findScalarConstant(Op typeClass, Op opcode, Id typeId, unsigned valu return 0; } -// Version of findScalarConstant (see above) for scalars that take two operands (e.g. a 'double'). +// Version of findScalarConstant (see above) for scalars that take two operands (e.g. a 'double' or 'int64'). Id Builder::findScalarConstant(Op typeClass, Op opcode, Id typeId, unsigned v1, unsigned v2) const { Instruction* constant; @@ -656,6 +654,21 @@ bool Builder::isConstantOpCode(Op opcode) const } } +// Return true if consuming 'opcode' means consuming a specialization constant. +bool Builder::isSpecConstantOpCode(Op opcode) const +{ + switch (opcode) { + case OpSpecConstantTrue: + case OpSpecConstantFalse: + case OpSpecConstant: + case OpSpecConstantComposite: + case OpSpecConstantOp: + return true; + default: + return false; + } +} + Id Builder::makeBoolConstant(bool b, bool specConstant) { Id typeId = makeBoolType(); @@ -710,6 +723,31 @@ Id Builder::makeIntConstant(Id typeId, unsigned value, bool specConstant) return c->getResultId(); } +Id Builder::makeInt64Constant(Id typeId, unsigned long long value, bool specConstant) +{ + Op opcode = specConstant ? OpSpecConstant : OpConstant; + + unsigned op1 = value & 0xFFFFFFFF; + unsigned op2 = value >> 32; + + // See if we already made it. Applies only to regular constants, because specialization constants + // must remain distinct for the purpose of applying a SpecId decoration. + if (! specConstant) { + Id existing = findScalarConstant(OpTypeInt, opcode, typeId, op1, op2); + if (existing) + return existing; + } + + Instruction* c = new Instruction(getUniqueId(), typeId, opcode); + c->addImmediateOperand(op1); + c->addImmediateOperand(op2); + constantsTypesGlobals.push_back(std::unique_ptr(c)); + groupedConstants[OpTypeInt].push_back(c); + module.mapInstruction(c); + + return c->getResultId(); +} + Id Builder::makeFloatConstant(float f, bool specConstant) { Op opcode = specConstant ? OpSpecConstant : OpConstant; @@ -924,7 +962,7 @@ void Builder::addMemberDecoration(Id id, unsigned int member, Decoration decorat } // Comments in header -Function* Builder::makeMain() +Function* Builder::makeEntrypoint(const char* entryPoint) { assert(!mainFunction); @@ -932,8 +970,7 @@ Function* Builder::makeMain() std::vector params; std::vector precisions; - mainFunction = - makeFunctionEntry(NoPrecision, makeVoidType(), "main", params, precisions, &entry); + mainFunction = makeFunctionEntry(NoPrecision, makeVoidType(), entryPoint, params, precisions, &entry); return mainFunction; } @@ -1104,6 +1141,11 @@ Id Builder::createArrayLength(Id base, unsigned int member) Id Builder::createCompositeExtract(Id composite, Id typeId, unsigned index) { + // Generate code for spec constants if in spec constant operation + // generation mode. + if (generatingOpCodeForSpecConst) { + return createSpecConstantOp(OpCompositeExtract, typeId, std::vector(1, composite), std::vector(1, index)); + } Instruction* extract = new Instruction(getUniqueId(), typeId, OpCompositeExtract); extract->addIdOperand(composite); extract->addImmediateOperand(index); @@ -1114,6 +1156,11 @@ Id Builder::createCompositeExtract(Id composite, Id typeId, unsigned index) Id Builder::createCompositeExtract(Id composite, Id typeId, std::vector& indexes) { + // Generate code for spec constants if in spec constant operation + // generation mode. + if (generatingOpCodeForSpecConst) { + return createSpecConstantOp(OpCompositeExtract, typeId, std::vector(1, composite), indexes); + } Instruction* extract = new Instruction(getUniqueId(), typeId, OpCompositeExtract); extract->addIdOperand(composite); for (int i = 0; i < (int)indexes.size(); ++i) @@ -1212,6 +1259,11 @@ void Builder::createMemoryBarrier(unsigned executionScope, unsigned memorySemant // An opcode that has one operands, a result id, and a type Id Builder::createUnaryOp(Op opCode, Id typeId, Id operand) { + // Generate code for spec constants if in spec constant operation + // generation mode. + if (generatingOpCodeForSpecConst) { + return createSpecConstantOp(opCode, typeId, std::vector(1, operand), std::vector()); + } Instruction* op = new Instruction(getUniqueId(), typeId, opCode); op->addIdOperand(operand); buildPoint->addInstruction(std::unique_ptr(op)); @@ -1221,6 +1273,13 @@ Id Builder::createUnaryOp(Op opCode, Id typeId, Id operand) Id Builder::createBinOp(Op opCode, Id typeId, Id left, Id right) { + // Generate code for spec constants if in spec constant operation + // generation mode. + if (generatingOpCodeForSpecConst) { + std::vector operands(2); + operands[0] = left; operands[1] = right; + return createSpecConstantOp(opCode, typeId, operands, std::vector()); + } Instruction* op = new Instruction(getUniqueId(), typeId, opCode); op->addIdOperand(left); op->addIdOperand(right); @@ -1231,6 +1290,16 @@ Id Builder::createBinOp(Op opCode, Id typeId, Id left, Id right) Id Builder::createTriOp(Op opCode, Id typeId, Id op1, Id op2, Id op3) { + // Generate code for spec constants if in spec constant operation + // generation mode. + if (generatingOpCodeForSpecConst) { + std::vector operands(3); + operands[0] = op1; + operands[1] = op2; + operands[2] = op3; + return createSpecConstantOp( + opCode, typeId, operands, std::vector()); + } Instruction* op = new Instruction(getUniqueId(), typeId, opCode); op->addIdOperand(op1); op->addIdOperand(op2); @@ -1250,6 +1319,20 @@ Id Builder::createOp(Op opCode, Id typeId, const std::vector& operands) return op->getResultId(); } +Id Builder::createSpecConstantOp(Op opCode, Id typeId, const std::vector& operands, const std::vector& literals) +{ + Instruction* op = new Instruction(getUniqueId(), typeId, OpSpecConstantOp); + op->addImmediateOperand((unsigned) opCode); + for (auto it = operands.cbegin(); it != operands.cend(); ++it) + op->addIdOperand(*it); + for (auto it = literals.cbegin(); it != literals.cend(); ++it) + op->addImmediateOperand(*it); + module.mapInstruction(op); + constantsTypesGlobals.push_back(std::unique_ptr(op)); + + return op->getResultId(); +} + Id Builder::createFunctionCall(spv::Function* function, std::vector& args) { Instruction* op = new Instruction(getUniqueId(), function->getReturnType(), OpFunctionCall); @@ -1268,6 +1351,11 @@ Id Builder::createRvalueSwizzle(Decoration precision, Id typeId, Id source, if (channels.size() == 1) return setPrecision(createCompositeExtract(source, typeId, channels.front()), precision); + if (generatingOpCodeForSpecConst) { + std::vector operands(2); + operands[0] = operands[1] = source; + return setPrecision(createSpecConstantOp(OpVectorShuffle, typeId, operands, channels), precision); + } Instruction* swizzle = new Instruction(getUniqueId(), typeId, OpVectorShuffle); assert(isVector(source)); swizzle->addIdOperand(source); @@ -1335,10 +1423,25 @@ Id Builder::smearScalar(Decoration precision, Id scalar, Id vectorType) if (numComponents == 1) return scalar; - Instruction* smear = new Instruction(getUniqueId(), vectorType, OpCompositeConstruct); - for (int c = 0; c < numComponents; ++c) - smear->addIdOperand(scalar); - buildPoint->addInstruction(std::unique_ptr(smear)); + Instruction* smear = nullptr; + if (generatingOpCodeForSpecConst) { + auto members = std::vector(numComponents, scalar); + // Sometime even in spec-constant-op mode, the temporary vector created by + // promoting a scalar might not be a spec constant. This should depend on + // the scalar. + // e.g.: + // const vec2 spec_const_result = a_spec_const_vec2 + a_front_end_const_scalar; + // In such cases, the temporary vector created from a_front_end_const_scalar + // is not a spec constant vector, even though the binary operation node is marked + // as 'specConstant' and we are in spec-constant-op mode. + auto result_id = makeCompositeConstant(vectorType, members, isSpecConstant(scalar)); + smear = module.getInstruction(result_id); + } else { + smear = new Instruction(getUniqueId(), vectorType, OpCompositeConstruct); + for (int c = 0; c < numComponents; ++c) + smear->addIdOperand(scalar); + buildPoint->addInstruction(std::unique_ptr(smear)); + } return setPrecision(smear->getResultId(), precision); } @@ -1413,8 +1516,10 @@ Id Builder::createTextureCall(Decoration precision, Id resultType, bool sparse, { if (isConstant(parameters.offset)) mask = (ImageOperandsMask)(mask | ImageOperandsConstOffsetMask); - else + else { + addCapability(CapabilityImageGatherExtended); mask = (ImageOperandsMask)(mask | ImageOperandsOffsetMask); + } texArgs[numArgs++] = parameters.offset; } if (parameters.offsets) @@ -1723,6 +1828,20 @@ Id Builder::createCompositeConstruct(Id typeId, std::vector& constituents) assert(isAggregateType(typeId) || (getNumTypeConstituents(typeId) > 1 && getNumTypeConstituents(typeId) == (int)constituents.size())); + if (generatingOpCodeForSpecConst) { + // Sometime, even in spec-constant-op mode, the constant composite to be + // constructed may not be a specialization constant. + // e.g.: + // const mat2 m2 = mat2(a_spec_const, a_front_end_const, another_front_end_const, third_front_end_const); + // The first column vector should be a spec constant one, as a_spec_const is a spec constant. + // The second column vector should NOT be spec constant, as it does not contain any spec constants. + // To handle such cases, we check the constituents of the constant vector to determine whether this + // vector should be created as a spec constant. + return makeCompositeConstant(typeId, constituents, + std::any_of(constituents.begin(), constituents.end(), + [&](spv::Id id) { return isSpecConstant(id); })); + } + Instruction* op = new Instruction(getUniqueId(), typeId, OpCompositeConstruct); for (int c = 0; c < (int)constituents.size(); ++c) op->addIdOperand(constituents[c]); @@ -1788,6 +1907,9 @@ Id Builder::createMatrixConstructor(Decoration precision, const std::vector& int numCols = getTypeNumColumns(resultTypeId); int numRows = getTypeNumRows(resultTypeId); + Instruction* instr = module.getInstruction(componentTypeId); + Id bitCount = instr->getIdOperand(0); + // Will use a two step process // 1. make a compile-time 2D array of values // 2. construct a matrix from that array @@ -1796,12 +1918,10 @@ Id Builder::createMatrixConstructor(Decoration precision, const std::vector& // initialize the array to the identity matrix Id ids[maxMatrixSize][maxMatrixSize]; - Id one = makeFloatConstant(1.0); - Id zero = makeFloatConstant(0.0); - for (int col = 0; col < 4; ++col) - { - for (int row = 0; row < 4; ++row) - { + Id one = (bitCount == 64 ? makeDoubleConstant(1.0) : makeFloatConstant(1.0)); + Id zero = (bitCount == 64 ? makeDoubleConstant(0.0) : makeFloatConstant(0.0)); + for (int col = 0; col < 4; ++col) { + for (int row = 0; row < 4; ++row) { if (col == row) ids[col][row] = one; else @@ -2077,7 +2197,7 @@ void Builder::accessChainStore(Id rvalue) Id base = collapseAccessChain(); if (accessChain.swizzle.size() && accessChain.component != NoResult) - MissingFunctionality("simultaneous l-value swizzle and dynamic component selection"); + logger->missingFunctionality("simultaneous l-value swizzle and dynamic component selection"); // If swizzle still exists, it is out-of-order or not full, we must load the target vector, // extract and insert elements to perform writeMask and/or swizzle. @@ -2265,12 +2385,12 @@ void Builder::eliminateDeadDecorations() } } decorations.erase(std::remove_if(decorations.begin(), decorations.end(), - [&unreachable_definitions](std::unique_ptr& I) { - Instruction* inst = I.get(); - Id decoration_id = inst->getIdOperand(0); - return unreachable_definitions.count(decoration_id) != 0; - }), - decorations.end()); + [&unreachable_definitions](std::unique_ptr& I) -> bool { + Instruction* inst = I.get(); + Id decoration_id = inst->getIdOperand(0); + return unreachable_definitions.count(decoration_id) != 0; + }), + decorations.end()); } void Builder::dump(std::vector& out) const @@ -2383,7 +2503,7 @@ void Builder::simplifyAccessChainSwizzle() // To the extent any swizzling can become part of the chain // of accesses instead of a post operation, make it so. -// If 'dynamic' is true, include transfering a non-static component index, +// If 'dynamic' is true, include transferring a non-static component index, // otherwise, only transfer static indexes. // // Also, Boolean vectors are likely to be special. While @@ -2484,16 +2604,4 @@ void Builder::dumpInstructions(std::vector& out, } } -void TbdFunctionality(const char* tbd) -{ - static std::unordered_set issued; - - if (issued.find(tbd) == issued.end()) - { - printf("TBD functionality: %s\n", tbd); - issued.insert(tbd); - } -} - -void MissingFunctionality(const char* fun) { printf("Missing functionality: %s\n", fun); } -}; // end spv namespace +}; // end spv namespace diff --git a/SPIRV/SpvBuilder.h b/SPIRV/SpvBuilder.h index cb4daff1..e577ddfb 100755 --- a/SPIRV/SpvBuilder.h +++ b/SPIRV/SpvBuilder.h @@ -33,10 +33,6 @@ //ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE //POSSIBILITY OF SUCH DAMAGE. -// -// Author: John Kessenich, LunarG -// - // // "Builder" is an interface to fully build SPIR-V IR. Allocate one of // these to build (a thread safe) internal SPIR-V representation (IR), @@ -49,6 +45,7 @@ #ifndef SpvBuilder_H #define SpvBuilder_H +#include "Logger.h" #include "spirv.hpp" #include "spvIR.h" @@ -56,13 +53,14 @@ #include #include #include +#include #include namespace spv { class Builder { public: - Builder(unsigned int userNumber); + Builder(unsigned int userNumber, SpvBuildLogger* logger); virtual ~Builder(); static const int maxMatrixSize = 4; @@ -155,16 +153,12 @@ public: bool isSamplerType(Id typeId) const { return getTypeClass(typeId) == OpTypeSampler; } bool isSampledImageType(Id typeId) const { return getTypeClass(typeId) == OpTypeSampledImage; } bool isConstantOpCode(Op opcode) const; + bool isSpecConstantOpCode(Op opcode) const; bool isConstant(Id resultId) const { return isConstantOpCode(getOpCode(resultId)); } bool isConstantScalar(Id resultId) const { return getOpCode(resultId) == OpConstant; } - unsigned int getConstantScalar(Id resultId) const - { - return module.getInstruction(resultId)->getImmediateOperand(0); - } - StorageClass getStorageClass(Id resultId) const - { - return getTypeStorageClass(getTypeId(resultId)); - } + bool isSpecConstant(Id resultId) const { return isSpecConstantOpCode(getOpCode(resultId)); } + unsigned int getConstantScalar(Id resultId) const { return module.getInstruction(resultId)->getImmediateOperand(0); } + StorageClass getStorageClass(Id resultId) const { return getTypeStorageClass(getTypeId(resultId)); } int getTypeNumColumns(Id typeId) const { @@ -197,14 +191,10 @@ public: // For making new constants (will return old constant if the requested one was already made). Id makeBoolConstant(bool b, bool specConstant = false); - Id makeIntConstant(int i, bool specConstant = false) - { - return makeIntConstant(makeIntType(32), (unsigned)i, specConstant); - } - Id makeUintConstant(unsigned u, bool specConstant = false) - { - return makeIntConstant(makeUintType(32), u, specConstant); - } + Id makeIntConstant(int i, bool specConstant = false) { return makeIntConstant(makeIntType(32), (unsigned)i, specConstant); } + Id makeUintConstant(unsigned u, bool specConstant = false) { return makeIntConstant(makeUintType(32), u, specConstant); } + Id makeInt64Constant(long long i, bool specConstant = false) { return makeInt64Constant(makeIntType(64), (unsigned long long)i, specConstant); } + Id makeUint64Constant(unsigned long long u, bool specConstant = false) { return makeInt64Constant(makeUintType(64), u, specConstant); } Id makeFloatConstant(float f, bool specConstant = false); Id makeDoubleConstant(double d, bool specConstant = false); @@ -224,9 +214,10 @@ public: // At the end of what block do the next create*() instructions go? void setBuildPoint(Block* bp) { buildPoint = bp; } Block* getBuildPoint() const { return buildPoint; } - // Make the main function. The returned pointer is only valid + + // Make the entry-point function. The returned pointer is only valid // for the lifetime of this builder. - Function* makeMain(); + Function* makeEntrypoint(const char*); // Make a shader-style function, and create its entry block if entry is non-zero. // Return the function, pass back the entry. @@ -282,6 +273,7 @@ public: Id createTriOp(Op, Id typeId, Id operand1, Id operand2, Id operand3); Id createOp(Op, Id typeId, const std::vector& operands); Id createFunctionCall(spv::Function*, std::vector&); + Id createSpecConstantOp(Op, Id typeId, const std::vector& operands, const std::vector& literals); // Take an rvalue (source) and a set of channels to extract from it to // make a new rvalue, which is returned. @@ -544,8 +536,16 @@ public: void createConditionalBranch(Id condition, Block* thenBlock, Block* elseBlock); void createLoopMerge(Block* mergeBlock, Block* continueBlock, unsigned int control); -protected: + // Sets to generate opcode for specialization constants. + void setToSpecConstCodeGenMode() { generatingOpCodeForSpecConst = true; } + // Sets to generate opcode for non-specialization constants (normal mode). + void setToNormalCodeGenMode() { generatingOpCodeForSpecConst = false; } + // Check if the builder is generating code for spec constants. + bool isInSpecConstCodeGenMode() { return generatingOpCodeForSpecConst; } + + protected: Id makeIntConstant(Id typeId, unsigned value, bool specConstant); + Id makeInt64Constant(Id typeId, unsigned long long value, bool specConstant); Id findScalarConstant(Op typeClass, Op opcode, Id typeId, unsigned value) const; Id findScalarConstant(Op typeClass, Op opcode, Id typeId, unsigned v1, unsigned v2) const; Id findCompositeConstant(Op typeClass, std::vector& comps) const; @@ -568,6 +568,7 @@ protected: Block* buildPoint; Id uniqueId; Function* mainFunction; + bool generatingOpCodeForSpecConst; AccessChain accessChain; // special blocks of instructions for output @@ -590,14 +591,11 @@ protected: // Our loop stack. std::stack loops; + + // The stream for outputing warnings and errors. + SpvBuildLogger* logger; }; // end Builder class -// Use for non-fatal notes about what's not complete -void TbdFunctionality(const char*); - -// Use for fatal missing functionality -void MissingFunctionality(const char*); - }; // end spv namespace #endif // SpvBuilder_H diff --git a/SPIRV/disassemble.cpp b/SPIRV/disassemble.cpp index e1edddec..75688cb9 100644 --- a/SPIRV/disassemble.cpp +++ b/SPIRV/disassemble.cpp @@ -32,10 +32,6 @@ //ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE //POSSIBILITY OF SUCH DAMAGE. -// -// Author: John Kessenich, LunarG -// - // // Disassembler for SPIR-V. // diff --git a/SPIRV/disassemble.h b/SPIRV/disassemble.h index be537a37..f5d0bc23 100755 --- a/SPIRV/disassemble.h +++ b/SPIRV/disassemble.h @@ -32,10 +32,6 @@ //ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE //POSSIBILITY OF SUCH DAMAGE. -// -// Author: John Kessenich, LunarG -// - // // Disassembler for SPIR-V. // diff --git a/SPIRV/doc.cpp b/SPIRV/doc.cpp index 7cf1c87f..fed3ec42 100755 --- a/SPIRV/doc.cpp +++ b/SPIRV/doc.cpp @@ -32,10 +32,6 @@ //ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE //POSSIBILITY OF SUCH DAMAGE. -// -// Author: John Kessenich, LunarG -// - // // 1) Programatically fill in instruction/operand information. // This can be used for disassembly, printing documentation, etc. @@ -64,7 +60,7 @@ namespace spv { // (for non-sparse mask enums, this is the number of enumurants) // -const int SourceLanguageCeiling = 5; +const int SourceLanguageCeiling = 6; // HLSL todo: need official enumerant const char* SourceString(int source) { @@ -74,6 +70,7 @@ const char* SourceString(int source) case 2: return "GLSL"; case 3: return "OpenCL_C"; case 4: return "OpenCL_CPP"; + case 5: return "HLSL"; case SourceLanguageCeiling: default: return "Bad"; diff --git a/SPIRV/doc.h b/SPIRV/doc.h index b7929793..cf9e059b 100644 --- a/SPIRV/doc.h +++ b/SPIRV/doc.h @@ -32,10 +32,6 @@ //ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE //POSSIBILITY OF SUCH DAMAGE. -// -// Author: John Kessenich, LunarG -// - // // Parameterize the SPIR-V enumerants. // diff --git a/SPIRV/spirv.hpp b/SPIRV/spirv.hpp index 5620aba7..7447fcf7 100755 --- a/SPIRV/spirv.hpp +++ b/SPIRV/spirv.hpp @@ -61,6 +61,7 @@ enum SourceLanguage { SourceLanguageGLSL = 2, SourceLanguageOpenCL_C = 3, SourceLanguageOpenCL_CPP = 4, + SourceLanguageHLSL = 5, }; enum ExecutionModel { diff --git a/SPIRV/spvIR.h b/SPIRV/spvIR.h index 3c483872..7c9fb987 100755 --- a/SPIRV/spvIR.h +++ b/SPIRV/spvIR.h @@ -32,10 +32,6 @@ //ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE //POSSIBILITY OF SUCH DAMAGE. -// -// Author: John Kessenich, LunarG -// - // SPIRV-IR // // Simple in-memory representation (IR) of SPIRV. Just for holding diff --git a/SetupLinux.sh b/SetupLinux.sh deleted file mode 100755 index 2a6ff6a4..00000000 --- a/SetupLinux.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash -rm -rf build -mkdir build -pushd build -cmake .. -cmake .. -make -j 2 -make install -install/bin/glslangValidator -i ../Test/sample.vert ../Test/sample.frag -popd diff --git a/StandAlone/CMakeLists.txt b/StandAlone/CMakeLists.txt index 38cb2bdb..d69351ef 100644 --- a/StandAlone/CMakeLists.txt +++ b/StandAlone/CMakeLists.txt @@ -1,16 +1,30 @@ -cmake_minimum_required(VERSION 2.8) +add_library(glslang-default-resource-limits + ${CMAKE_CURRENT_SOURCE_DIR}/ResourceLimits.cpp +) +set_property(TARGET glslang-default-resource-limits PROPERTY FOLDER glslang) + +target_include_directories(glslang-default-resource-limits + PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} + PUBLIC ${PROJECT_SOURCE_DIR} +) set(SOURCES StandAlone.cpp) set(REMAPPER_SOURCES spirv-remap.cpp) add_executable(glslangValidator ${SOURCES}) add_executable(spirv-remap ${REMAPPER_SOURCES}) +set_property(TARGET glslangValidator PROPERTY FOLDER tools) +set_property(TARGET spirv-remap PROPERTY FOLDER tools) +glslang_set_link_args(glslangValidator) +glslang_set_link_args(spirv-remap) set(LIBRARIES glslang OGLCompiler OSDependent - SPIRV) + HLSL + SPIRV + glslang-default-resource-limits) if(WIN32) set(LIBRARIES ${LIBRARIES} psapi) diff --git a/StandAlone/ResourceLimits.cpp b/StandAlone/ResourceLimits.cpp new file mode 100644 index 00000000..80491980 --- /dev/null +++ b/StandAlone/ResourceLimits.cpp @@ -0,0 +1,444 @@ +// +// Copyright (C) 2016 Google, Inc. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. + +#include +#include +#include + +#include "ResourceLimits.h" + +namespace glslang { + +const TBuiltInResource DefaultTBuiltInResource = { + /* .MaxLights = */ 32, + /* .MaxClipPlanes = */ 6, + /* .MaxTextureUnits = */ 32, + /* .MaxTextureCoords = */ 32, + /* .MaxVertexAttribs = */ 64, + /* .MaxVertexUniformComponents = */ 4096, + /* .MaxVaryingFloats = */ 64, + /* .MaxVertexTextureImageUnits = */ 32, + /* .MaxCombinedTextureImageUnits = */ 80, + /* .MaxTextureImageUnits = */ 32, + /* .MaxFragmentUniformComponents = */ 4096, + /* .MaxDrawBuffers = */ 32, + /* .MaxVertexUniformVectors = */ 128, + /* .MaxVaryingVectors = */ 8, + /* .MaxFragmentUniformVectors = */ 16, + /* .MaxVertexOutputVectors = */ 16, + /* .MaxFragmentInputVectors = */ 15, + /* .MinProgramTexelOffset = */ -8, + /* .MaxProgramTexelOffset = */ 7, + /* .MaxClipDistances = */ 8, + /* .MaxComputeWorkGroupCountX = */ 65535, + /* .MaxComputeWorkGroupCountY = */ 65535, + /* .MaxComputeWorkGroupCountZ = */ 65535, + /* .MaxComputeWorkGroupSizeX = */ 1024, + /* .MaxComputeWorkGroupSizeY = */ 1024, + /* .MaxComputeWorkGroupSizeZ = */ 64, + /* .MaxComputeUniformComponents = */ 1024, + /* .MaxComputeTextureImageUnits = */ 16, + /* .MaxComputeImageUniforms = */ 8, + /* .MaxComputeAtomicCounters = */ 8, + /* .MaxComputeAtomicCounterBuffers = */ 1, + /* .MaxVaryingComponents = */ 60, + /* .MaxVertexOutputComponents = */ 64, + /* .MaxGeometryInputComponents = */ 64, + /* .MaxGeometryOutputComponents = */ 128, + /* .MaxFragmentInputComponents = */ 128, + /* .MaxImageUnits = */ 8, + /* .MaxCombinedImageUnitsAndFragmentOutputs = */ 8, + /* .MaxCombinedShaderOutputResources = */ 8, + /* .MaxImageSamples = */ 0, + /* .MaxVertexImageUniforms = */ 0, + /* .MaxTessControlImageUniforms = */ 0, + /* .MaxTessEvaluationImageUniforms = */ 0, + /* .MaxGeometryImageUniforms = */ 0, + /* .MaxFragmentImageUniforms = */ 8, + /* .MaxCombinedImageUniforms = */ 8, + /* .MaxGeometryTextureImageUnits = */ 16, + /* .MaxGeometryOutputVertices = */ 256, + /* .MaxGeometryTotalOutputComponents = */ 1024, + /* .MaxGeometryUniformComponents = */ 1024, + /* .MaxGeometryVaryingComponents = */ 64, + /* .MaxTessControlInputComponents = */ 128, + /* .MaxTessControlOutputComponents = */ 128, + /* .MaxTessControlTextureImageUnits = */ 16, + /* .MaxTessControlUniformComponents = */ 1024, + /* .MaxTessControlTotalOutputComponents = */ 4096, + /* .MaxTessEvaluationInputComponents = */ 128, + /* .MaxTessEvaluationOutputComponents = */ 128, + /* .MaxTessEvaluationTextureImageUnits = */ 16, + /* .MaxTessEvaluationUniformComponents = */ 1024, + /* .MaxTessPatchComponents = */ 120, + /* .MaxPatchVertices = */ 32, + /* .MaxTessGenLevel = */ 64, + /* .MaxViewports = */ 16, + /* .MaxVertexAtomicCounters = */ 0, + /* .MaxTessControlAtomicCounters = */ 0, + /* .MaxTessEvaluationAtomicCounters = */ 0, + /* .MaxGeometryAtomicCounters = */ 0, + /* .MaxFragmentAtomicCounters = */ 8, + /* .MaxCombinedAtomicCounters = */ 8, + /* .MaxAtomicCounterBindings = */ 1, + /* .MaxVertexAtomicCounterBuffers = */ 0, + /* .MaxTessControlAtomicCounterBuffers = */ 0, + /* .MaxTessEvaluationAtomicCounterBuffers = */ 0, + /* .MaxGeometryAtomicCounterBuffers = */ 0, + /* .MaxFragmentAtomicCounterBuffers = */ 1, + /* .MaxCombinedAtomicCounterBuffers = */ 1, + /* .MaxAtomicCounterBufferSize = */ 16384, + /* .MaxTransformFeedbackBuffers = */ 4, + /* .MaxTransformFeedbackInterleavedComponents = */ 64, + /* .MaxCullDistances = */ 8, + /* .MaxCombinedClipAndCullDistances = */ 8, + /* .MaxSamples = */ 4, + /* .limits = */ { + /* .nonInductiveForLoops = */ 1, + /* .whileLoops = */ 1, + /* .doWhileLoops = */ 1, + /* .generalUniformIndexing = */ 1, + /* .generalAttributeMatrixVectorIndexing = */ 1, + /* .generalVaryingIndexing = */ 1, + /* .generalSamplerIndexing = */ 1, + /* .generalVariableIndexing = */ 1, + /* .generalConstantMatrixVectorIndexing = */ 1, + }}; + +std::string GetDefaultTBuiltInResourceString() +{ + std::ostringstream ostream; + + ostream << "MaxLights " << DefaultTBuiltInResource.maxLights << "\n" + << "MaxClipPlanes " << DefaultTBuiltInResource.maxClipPlanes << "\n" + << "MaxTextureUnits " << DefaultTBuiltInResource.maxTextureUnits << "\n" + << "MaxTextureCoords " << DefaultTBuiltInResource.maxTextureCoords << "\n" + << "MaxVertexAttribs " << DefaultTBuiltInResource.maxVertexAttribs << "\n" + << "MaxVertexUniformComponents " << DefaultTBuiltInResource.maxVertexUniformComponents << "\n" + << "MaxVaryingFloats " << DefaultTBuiltInResource.maxVaryingFloats << "\n" + << "MaxVertexTextureImageUnits " << DefaultTBuiltInResource.maxVertexTextureImageUnits << "\n" + << "MaxCombinedTextureImageUnits " << DefaultTBuiltInResource.maxCombinedTextureImageUnits << "\n" + << "MaxTextureImageUnits " << DefaultTBuiltInResource.maxTextureImageUnits << "\n" + << "MaxFragmentUniformComponents " << DefaultTBuiltInResource.maxFragmentUniformComponents << "\n" + << "MaxDrawBuffers " << DefaultTBuiltInResource.maxDrawBuffers << "\n" + << "MaxVertexUniformVectors " << DefaultTBuiltInResource.maxVertexUniformVectors << "\n" + << "MaxVaryingVectors " << DefaultTBuiltInResource.maxVaryingVectors << "\n" + << "MaxFragmentUniformVectors " << DefaultTBuiltInResource.maxFragmentUniformVectors << "\n" + << "MaxVertexOutputVectors " << DefaultTBuiltInResource.maxVertexOutputVectors << "\n" + << "MaxFragmentInputVectors " << DefaultTBuiltInResource.maxFragmentInputVectors << "\n" + << "MinProgramTexelOffset " << DefaultTBuiltInResource.minProgramTexelOffset << "\n" + << "MaxProgramTexelOffset " << DefaultTBuiltInResource.maxProgramTexelOffset << "\n" + << "MaxClipDistances " << DefaultTBuiltInResource.maxClipDistances << "\n" + << "MaxComputeWorkGroupCountX " << DefaultTBuiltInResource.maxComputeWorkGroupCountX << "\n" + << "MaxComputeWorkGroupCountY " << DefaultTBuiltInResource.maxComputeWorkGroupCountY << "\n" + << "MaxComputeWorkGroupCountZ " << DefaultTBuiltInResource.maxComputeWorkGroupCountZ << "\n" + << "MaxComputeWorkGroupSizeX " << DefaultTBuiltInResource.maxComputeWorkGroupSizeX << "\n" + << "MaxComputeWorkGroupSizeY " << DefaultTBuiltInResource.maxComputeWorkGroupSizeY << "\n" + << "MaxComputeWorkGroupSizeZ " << DefaultTBuiltInResource.maxComputeWorkGroupSizeZ << "\n" + << "MaxComputeUniformComponents " << DefaultTBuiltInResource.maxComputeUniformComponents << "\n" + << "MaxComputeTextureImageUnits " << DefaultTBuiltInResource.maxComputeTextureImageUnits << "\n" + << "MaxComputeImageUniforms " << DefaultTBuiltInResource.maxComputeImageUniforms << "\n" + << "MaxComputeAtomicCounters " << DefaultTBuiltInResource.maxComputeAtomicCounters << "\n" + << "MaxComputeAtomicCounterBuffers " << DefaultTBuiltInResource.maxComputeAtomicCounterBuffers << "\n" + << "MaxVaryingComponents " << DefaultTBuiltInResource.maxVaryingComponents << "\n" + << "MaxVertexOutputComponents " << DefaultTBuiltInResource.maxVertexOutputComponents << "\n" + << "MaxGeometryInputComponents " << DefaultTBuiltInResource.maxGeometryInputComponents << "\n" + << "MaxGeometryOutputComponents " << DefaultTBuiltInResource.maxGeometryOutputComponents << "\n" + << "MaxFragmentInputComponents " << DefaultTBuiltInResource.maxFragmentInputComponents << "\n" + << "MaxImageUnits " << DefaultTBuiltInResource.maxImageUnits << "\n" + << "MaxCombinedImageUnitsAndFragmentOutputs " << DefaultTBuiltInResource.maxCombinedImageUnitsAndFragmentOutputs << "\n" + << "MaxCombinedShaderOutputResources " << DefaultTBuiltInResource.maxCombinedShaderOutputResources << "\n" + << "MaxImageSamples " << DefaultTBuiltInResource.maxImageSamples << "\n" + << "MaxVertexImageUniforms " << DefaultTBuiltInResource.maxVertexImageUniforms << "\n" + << "MaxTessControlImageUniforms " << DefaultTBuiltInResource.maxTessControlImageUniforms << "\n" + << "MaxTessEvaluationImageUniforms " << DefaultTBuiltInResource.maxTessEvaluationImageUniforms << "\n" + << "MaxGeometryImageUniforms " << DefaultTBuiltInResource.maxGeometryImageUniforms << "\n" + << "MaxFragmentImageUniforms " << DefaultTBuiltInResource.maxFragmentImageUniforms << "\n" + << "MaxCombinedImageUniforms " << DefaultTBuiltInResource.maxCombinedImageUniforms << "\n" + << "MaxGeometryTextureImageUnits " << DefaultTBuiltInResource.maxGeometryTextureImageUnits << "\n" + << "MaxGeometryOutputVertices " << DefaultTBuiltInResource.maxGeometryOutputVertices << "\n" + << "MaxGeometryTotalOutputComponents " << DefaultTBuiltInResource.maxGeometryTotalOutputComponents << "\n" + << "MaxGeometryUniformComponents " << DefaultTBuiltInResource.maxGeometryUniformComponents << "\n" + << "MaxGeometryVaryingComponents " << DefaultTBuiltInResource.maxGeometryVaryingComponents << "\n" + << "MaxTessControlInputComponents " << DefaultTBuiltInResource.maxTessControlInputComponents << "\n" + << "MaxTessControlOutputComponents " << DefaultTBuiltInResource.maxTessControlOutputComponents << "\n" + << "MaxTessControlTextureImageUnits " << DefaultTBuiltInResource.maxTessControlTextureImageUnits << "\n" + << "MaxTessControlUniformComponents " << DefaultTBuiltInResource.maxTessControlUniformComponents << "\n" + << "MaxTessControlTotalOutputComponents " << DefaultTBuiltInResource.maxTessControlTotalOutputComponents << "\n" + << "MaxTessEvaluationInputComponents " << DefaultTBuiltInResource.maxTessEvaluationInputComponents << "\n" + << "MaxTessEvaluationOutputComponents " << DefaultTBuiltInResource.maxTessEvaluationOutputComponents << "\n" + << "MaxTessEvaluationTextureImageUnits " << DefaultTBuiltInResource.maxTessEvaluationTextureImageUnits << "\n" + << "MaxTessEvaluationUniformComponents " << DefaultTBuiltInResource.maxTessEvaluationUniformComponents << "\n" + << "MaxTessPatchComponents " << DefaultTBuiltInResource.maxTessPatchComponents << "\n" + << "MaxPatchVertices " << DefaultTBuiltInResource.maxPatchVertices << "\n" + << "MaxTessGenLevel " << DefaultTBuiltInResource.maxTessGenLevel << "\n" + << "MaxViewports " << DefaultTBuiltInResource.maxViewports << "\n" + << "MaxVertexAtomicCounters " << DefaultTBuiltInResource.maxVertexAtomicCounters << "\n" + << "MaxTessControlAtomicCounters " << DefaultTBuiltInResource.maxTessControlAtomicCounters << "\n" + << "MaxTessEvaluationAtomicCounters " << DefaultTBuiltInResource.maxTessEvaluationAtomicCounters << "\n" + << "MaxGeometryAtomicCounters " << DefaultTBuiltInResource.maxGeometryAtomicCounters << "\n" + << "MaxFragmentAtomicCounters " << DefaultTBuiltInResource.maxFragmentAtomicCounters << "\n" + << "MaxCombinedAtomicCounters " << DefaultTBuiltInResource.maxCombinedAtomicCounters << "\n" + << "MaxAtomicCounterBindings " << DefaultTBuiltInResource.maxAtomicCounterBindings << "\n" + << "MaxVertexAtomicCounterBuffers " << DefaultTBuiltInResource.maxVertexAtomicCounterBuffers << "\n" + << "MaxTessControlAtomicCounterBuffers " << DefaultTBuiltInResource.maxTessControlAtomicCounterBuffers << "\n" + << "MaxTessEvaluationAtomicCounterBuffers " << DefaultTBuiltInResource.maxTessEvaluationAtomicCounterBuffers << "\n" + << "MaxGeometryAtomicCounterBuffers " << DefaultTBuiltInResource.maxGeometryAtomicCounterBuffers << "\n" + << "MaxFragmentAtomicCounterBuffers " << DefaultTBuiltInResource.maxFragmentAtomicCounterBuffers << "\n" + << "MaxCombinedAtomicCounterBuffers " << DefaultTBuiltInResource.maxCombinedAtomicCounterBuffers << "\n" + << "MaxAtomicCounterBufferSize " << DefaultTBuiltInResource.maxAtomicCounterBufferSize << "\n" + << "MaxTransformFeedbackBuffers " << DefaultTBuiltInResource.maxTransformFeedbackBuffers << "\n" + << "MaxTransformFeedbackInterleavedComponents " << DefaultTBuiltInResource.maxTransformFeedbackInterleavedComponents << "\n" + << "MaxCullDistances " << DefaultTBuiltInResource.maxCullDistances << "\n" + << "MaxCombinedClipAndCullDistances " << DefaultTBuiltInResource.maxCombinedClipAndCullDistances << "\n" + << "MaxSamples " << DefaultTBuiltInResource.maxSamples << "\n" + + << "nonInductiveForLoops " << DefaultTBuiltInResource.limits.nonInductiveForLoops << "\n" + << "whileLoops " << DefaultTBuiltInResource.limits.whileLoops << "\n" + << "doWhileLoops " << DefaultTBuiltInResource.limits.doWhileLoops << "\n" + << "generalUniformIndexing " << DefaultTBuiltInResource.limits.generalUniformIndexing << "\n" + << "generalAttributeMatrixVectorIndexing " << DefaultTBuiltInResource.limits.generalAttributeMatrixVectorIndexing << "\n" + << "generalVaryingIndexing " << DefaultTBuiltInResource.limits.generalVaryingIndexing << "\n" + << "generalSamplerIndexing " << DefaultTBuiltInResource.limits.generalSamplerIndexing << "\n" + << "generalVariableIndexing " << DefaultTBuiltInResource.limits.generalVariableIndexing << "\n" + << "generalConstantMatrixVectorIndexing " << DefaultTBuiltInResource.limits.generalConstantMatrixVectorIndexing << "\n" + ; + + return ostream.str(); +} + +void DecodeResourceLimits(TBuiltInResource* resources, char* config) { + const char* delims = " \t\n\r"; + const char* token = strtok(config, delims); + while (token) { + const char* valueStr = strtok(0, delims); + if (valueStr == 0 || ! (valueStr[0] == '-' || (valueStr[0] >= '0' && valueStr[0] <= '9'))) { + printf("Error: '%s' bad .conf file. Each name must be followed by one number.\n", valueStr ? valueStr : ""); + return; + } + int value = atoi(valueStr); + + if (strcmp(token, "MaxLights") == 0) + resources->maxLights = value; + else if (strcmp(token, "MaxClipPlanes") == 0) + resources->maxClipPlanes = value; + else if (strcmp(token, "MaxTextureUnits") == 0) + resources->maxTextureUnits = value; + else if (strcmp(token, "MaxTextureCoords") == 0) + resources->maxTextureCoords = value; + else if (strcmp(token, "MaxVertexAttribs") == 0) + resources->maxVertexAttribs = value; + else if (strcmp(token, "MaxVertexUniformComponents") == 0) + resources->maxVertexUniformComponents = value; + else if (strcmp(token, "MaxVaryingFloats") == 0) + resources->maxVaryingFloats = value; + else if (strcmp(token, "MaxVertexTextureImageUnits") == 0) + resources->maxVertexTextureImageUnits = value; + else if (strcmp(token, "MaxCombinedTextureImageUnits") == 0) + resources->maxCombinedTextureImageUnits = value; + else if (strcmp(token, "MaxTextureImageUnits") == 0) + resources->maxTextureImageUnits = value; + else if (strcmp(token, "MaxFragmentUniformComponents") == 0) + resources->maxFragmentUniformComponents = value; + else if (strcmp(token, "MaxDrawBuffers") == 0) + resources->maxDrawBuffers = value; + else if (strcmp(token, "MaxVertexUniformVectors") == 0) + resources->maxVertexUniformVectors = value; + else if (strcmp(token, "MaxVaryingVectors") == 0) + resources->maxVaryingVectors = value; + else if (strcmp(token, "MaxFragmentUniformVectors") == 0) + resources->maxFragmentUniformVectors = value; + else if (strcmp(token, "MaxVertexOutputVectors") == 0) + resources->maxVertexOutputVectors = value; + else if (strcmp(token, "MaxFragmentInputVectors") == 0) + resources->maxFragmentInputVectors = value; + else if (strcmp(token, "MinProgramTexelOffset") == 0) + resources->minProgramTexelOffset = value; + else if (strcmp(token, "MaxProgramTexelOffset") == 0) + resources->maxProgramTexelOffset = value; + else if (strcmp(token, "MaxClipDistances") == 0) + resources->maxClipDistances = value; + else if (strcmp(token, "MaxComputeWorkGroupCountX") == 0) + resources->maxComputeWorkGroupCountX = value; + else if (strcmp(token, "MaxComputeWorkGroupCountY") == 0) + resources->maxComputeWorkGroupCountY = value; + else if (strcmp(token, "MaxComputeWorkGroupCountZ") == 0) + resources->maxComputeWorkGroupCountZ = value; + else if (strcmp(token, "MaxComputeWorkGroupSizeX") == 0) + resources->maxComputeWorkGroupSizeX = value; + else if (strcmp(token, "MaxComputeWorkGroupSizeY") == 0) + resources->maxComputeWorkGroupSizeY = value; + else if (strcmp(token, "MaxComputeWorkGroupSizeZ") == 0) + resources->maxComputeWorkGroupSizeZ = value; + else if (strcmp(token, "MaxComputeUniformComponents") == 0) + resources->maxComputeUniformComponents = value; + else if (strcmp(token, "MaxComputeTextureImageUnits") == 0) + resources->maxComputeTextureImageUnits = value; + else if (strcmp(token, "MaxComputeImageUniforms") == 0) + resources->maxComputeImageUniforms = value; + else if (strcmp(token, "MaxComputeAtomicCounters") == 0) + resources->maxComputeAtomicCounters = value; + else if (strcmp(token, "MaxComputeAtomicCounterBuffers") == 0) + resources->maxComputeAtomicCounterBuffers = value; + else if (strcmp(token, "MaxVaryingComponents") == 0) + resources->maxVaryingComponents = value; + else if (strcmp(token, "MaxVertexOutputComponents") == 0) + resources->maxVertexOutputComponents = value; + else if (strcmp(token, "MaxGeometryInputComponents") == 0) + resources->maxGeometryInputComponents = value; + else if (strcmp(token, "MaxGeometryOutputComponents") == 0) + resources->maxGeometryOutputComponents = value; + else if (strcmp(token, "MaxFragmentInputComponents") == 0) + resources->maxFragmentInputComponents = value; + else if (strcmp(token, "MaxImageUnits") == 0) + resources->maxImageUnits = value; + else if (strcmp(token, "MaxCombinedImageUnitsAndFragmentOutputs") == 0) + resources->maxCombinedImageUnitsAndFragmentOutputs = value; + else if (strcmp(token, "MaxCombinedShaderOutputResources") == 0) + resources->maxCombinedShaderOutputResources = value; + else if (strcmp(token, "MaxImageSamples") == 0) + resources->maxImageSamples = value; + else if (strcmp(token, "MaxVertexImageUniforms") == 0) + resources->maxVertexImageUniforms = value; + else if (strcmp(token, "MaxTessControlImageUniforms") == 0) + resources->maxTessControlImageUniforms = value; + else if (strcmp(token, "MaxTessEvaluationImageUniforms") == 0) + resources->maxTessEvaluationImageUniforms = value; + else if (strcmp(token, "MaxGeometryImageUniforms") == 0) + resources->maxGeometryImageUniforms = value; + else if (strcmp(token, "MaxFragmentImageUniforms") == 0) + resources->maxFragmentImageUniforms = value; + else if (strcmp(token, "MaxCombinedImageUniforms") == 0) + resources->maxCombinedImageUniforms = value; + else if (strcmp(token, "MaxGeometryTextureImageUnits") == 0) + resources->maxGeometryTextureImageUnits = value; + else if (strcmp(token, "MaxGeometryOutputVertices") == 0) + resources->maxGeometryOutputVertices = value; + else if (strcmp(token, "MaxGeometryTotalOutputComponents") == 0) + resources->maxGeometryTotalOutputComponents = value; + else if (strcmp(token, "MaxGeometryUniformComponents") == 0) + resources->maxGeometryUniformComponents = value; + else if (strcmp(token, "MaxGeometryVaryingComponents") == 0) + resources->maxGeometryVaryingComponents = value; + else if (strcmp(token, "MaxTessControlInputComponents") == 0) + resources->maxTessControlInputComponents = value; + else if (strcmp(token, "MaxTessControlOutputComponents") == 0) + resources->maxTessControlOutputComponents = value; + else if (strcmp(token, "MaxTessControlTextureImageUnits") == 0) + resources->maxTessControlTextureImageUnits = value; + else if (strcmp(token, "MaxTessControlUniformComponents") == 0) + resources->maxTessControlUniformComponents = value; + else if (strcmp(token, "MaxTessControlTotalOutputComponents") == 0) + resources->maxTessControlTotalOutputComponents = value; + else if (strcmp(token, "MaxTessEvaluationInputComponents") == 0) + resources->maxTessEvaluationInputComponents = value; + else if (strcmp(token, "MaxTessEvaluationOutputComponents") == 0) + resources->maxTessEvaluationOutputComponents = value; + else if (strcmp(token, "MaxTessEvaluationTextureImageUnits") == 0) + resources->maxTessEvaluationTextureImageUnits = value; + else if (strcmp(token, "MaxTessEvaluationUniformComponents") == 0) + resources->maxTessEvaluationUniformComponents = value; + else if (strcmp(token, "MaxTessPatchComponents") == 0) + resources->maxTessPatchComponents = value; + else if (strcmp(token, "MaxPatchVertices") == 0) + resources->maxPatchVertices = value; + else if (strcmp(token, "MaxTessGenLevel") == 0) + resources->maxTessGenLevel = value; + else if (strcmp(token, "MaxViewports") == 0) + resources->maxViewports = value; + else if (strcmp(token, "MaxVertexAtomicCounters") == 0) + resources->maxVertexAtomicCounters = value; + else if (strcmp(token, "MaxTessControlAtomicCounters") == 0) + resources->maxTessControlAtomicCounters = value; + else if (strcmp(token, "MaxTessEvaluationAtomicCounters") == 0) + resources->maxTessEvaluationAtomicCounters = value; + else if (strcmp(token, "MaxGeometryAtomicCounters") == 0) + resources->maxGeometryAtomicCounters = value; + else if (strcmp(token, "MaxFragmentAtomicCounters") == 0) + resources->maxFragmentAtomicCounters = value; + else if (strcmp(token, "MaxCombinedAtomicCounters") == 0) + resources->maxCombinedAtomicCounters = value; + else if (strcmp(token, "MaxAtomicCounterBindings") == 0) + resources->maxAtomicCounterBindings = value; + else if (strcmp(token, "MaxVertexAtomicCounterBuffers") == 0) + resources->maxVertexAtomicCounterBuffers = value; + else if (strcmp(token, "MaxTessControlAtomicCounterBuffers") == 0) + resources->maxTessControlAtomicCounterBuffers = value; + else if (strcmp(token, "MaxTessEvaluationAtomicCounterBuffers") == 0) + resources->maxTessEvaluationAtomicCounterBuffers = value; + else if (strcmp(token, "MaxGeometryAtomicCounterBuffers") == 0) + resources->maxGeometryAtomicCounterBuffers = value; + else if (strcmp(token, "MaxFragmentAtomicCounterBuffers") == 0) + resources->maxFragmentAtomicCounterBuffers = value; + else if (strcmp(token, "MaxCombinedAtomicCounterBuffers") == 0) + resources->maxCombinedAtomicCounterBuffers = value; + else if (strcmp(token, "MaxAtomicCounterBufferSize") == 0) + resources->maxAtomicCounterBufferSize = value; + else if (strcmp(token, "MaxTransformFeedbackBuffers") == 0) + resources->maxTransformFeedbackBuffers = value; + else if (strcmp(token, "MaxTransformFeedbackInterleavedComponents") == 0) + resources->maxTransformFeedbackInterleavedComponents = value; + else if (strcmp(token, "MaxCullDistances") == 0) + resources->maxCullDistances = value; + else if (strcmp(token, "MaxCombinedClipAndCullDistances") == 0) + resources->maxCombinedClipAndCullDistances = value; + else if (strcmp(token, "MaxSamples") == 0) + resources->maxSamples = value; + + else if (strcmp(token, "nonInductiveForLoops") == 0) + resources->limits.nonInductiveForLoops = (value != 0); + else if (strcmp(token, "whileLoops") == 0) + resources->limits.whileLoops = (value != 0); + else if (strcmp(token, "doWhileLoops") == 0) + resources->limits.doWhileLoops = (value != 0); + else if (strcmp(token, "generalUniformIndexing") == 0) + resources->limits.generalUniformIndexing = (value != 0); + else if (strcmp(token, "generalAttributeMatrixVectorIndexing") == 0) + resources->limits.generalAttributeMatrixVectorIndexing = (value != 0); + else if (strcmp(token, "generalVaryingIndexing") == 0) + resources->limits.generalVaryingIndexing = (value != 0); + else if (strcmp(token, "generalSamplerIndexing") == 0) + resources->limits.generalSamplerIndexing = (value != 0); + else if (strcmp(token, "generalVariableIndexing") == 0) + resources->limits.generalVariableIndexing = (value != 0); + else if (strcmp(token, "generalConstantMatrixVectorIndexing") == 0) + resources->limits.generalConstantMatrixVectorIndexing = (value != 0); + else + printf("Warning: unrecognized limit (%s) in configuration file.\n", token); + + token = strtok(0, delims); + } +} + +} // end namespace glslang diff --git a/StandAlone/ResourceLimits.h b/StandAlone/ResourceLimits.h new file mode 100644 index 00000000..9c3eb3e9 --- /dev/null +++ b/StandAlone/ResourceLimits.h @@ -0,0 +1,57 @@ +// +// Copyright (C) 2016 Google, Inc. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. + +#ifndef _STAND_ALONE_RESOURCE_LIMITS_INCLUDED_ +#define _STAND_ALONE_RESOURCE_LIMITS_INCLUDED_ + +#include + +#include "glslang/Include/ResourceLimits.h" + +namespace glslang { + +// These are the default resources for TBuiltInResources, used for both +// - parsing this string for the case where the user didn't supply one, +// - dumping out a template for user construction of a config file. +extern const TBuiltInResource DefaultTBuiltInResource; + +// Returns the DefaultTBuiltInResource as a human-readable string. +std::string GetDefaultTBuiltInResourceString(); + +// Decodes the resource limits from |config| to |resources|. +void DecodeResourceLimits(TBuiltInResource* resources, char* config); + +} // end namespace glslang + +#endif // _STAND_ALONE_RESOURCE_LIMITS_INCLUDED_ diff --git a/StandAlone/StandAlone.cpp b/StandAlone/StandAlone.cpp index 6ebdb7f5..3fd7e7d2 100644 --- a/StandAlone/StandAlone.cpp +++ b/StandAlone/StandAlone.cpp @@ -37,6 +37,7 @@ // this only applies to the standalone wrapper, not the front end in general #define _CRT_SECURE_NO_WARNINGS +#include "ResourceLimits.h" #include "Worklist.h" #include "./../glslang/Include/ShHandle.h" #include "./../glslang/Include/revision.h" @@ -74,6 +75,7 @@ enum TOptions { EOptionVulkanRules = 0x2000, EOptionDefaultDesktop = 0x4000, EOptionOutputPreprocessed = 0x8000, + EOptionReadHlsl = 0x10000, }; // @@ -111,108 +113,7 @@ TBuiltInResource Resources; std::string ConfigFile; // -// These are the default resources for TBuiltInResources, used for both -// - parsing this string for the case where the user didn't supply one -// - dumping out a template for user construction of a config file -// -const char* DefaultConfig = - "MaxLights 32\n" - "MaxClipPlanes 6\n" - "MaxTextureUnits 32\n" - "MaxTextureCoords 32\n" - "MaxVertexAttribs 64\n" - "MaxVertexUniformComponents 4096\n" - "MaxVaryingFloats 64\n" - "MaxVertexTextureImageUnits 32\n" - "MaxCombinedTextureImageUnits 80\n" - "MaxTextureImageUnits 32\n" - "MaxFragmentUniformComponents 4096\n" - "MaxDrawBuffers 32\n" - "MaxVertexUniformVectors 128\n" - "MaxVaryingVectors 8\n" - "MaxFragmentUniformVectors 16\n" - "MaxVertexOutputVectors 16\n" - "MaxFragmentInputVectors 15\n" - "MinProgramTexelOffset -8\n" - "MaxProgramTexelOffset 7\n" - "MaxClipDistances 8\n" - "MaxComputeWorkGroupCountX 65535\n" - "MaxComputeWorkGroupCountY 65535\n" - "MaxComputeWorkGroupCountZ 65535\n" - "MaxComputeWorkGroupSizeX 1024\n" - "MaxComputeWorkGroupSizeY 1024\n" - "MaxComputeWorkGroupSizeZ 64\n" - "MaxComputeUniformComponents 1024\n" - "MaxComputeTextureImageUnits 16\n" - "MaxComputeImageUniforms 8\n" - "MaxComputeAtomicCounters 8\n" - "MaxComputeAtomicCounterBuffers 1\n" - "MaxVaryingComponents 60\n" - "MaxVertexOutputComponents 64\n" - "MaxGeometryInputComponents 64\n" - "MaxGeometryOutputComponents 128\n" - "MaxFragmentInputComponents 128\n" - "MaxImageUnits 8\n" - "MaxCombinedImageUnitsAndFragmentOutputs 8\n" - "MaxCombinedShaderOutputResources 8\n" - "MaxImageSamples 0\n" - "MaxVertexImageUniforms 0\n" - "MaxTessControlImageUniforms 0\n" - "MaxTessEvaluationImageUniforms 0\n" - "MaxGeometryImageUniforms 0\n" - "MaxFragmentImageUniforms 8\n" - "MaxCombinedImageUniforms 8\n" - "MaxGeometryTextureImageUnits 16\n" - "MaxGeometryOutputVertices 256\n" - "MaxGeometryTotalOutputComponents 1024\n" - "MaxGeometryUniformComponents 1024\n" - "MaxGeometryVaryingComponents 64\n" - "MaxTessControlInputComponents 128\n" - "MaxTessControlOutputComponents 128\n" - "MaxTessControlTextureImageUnits 16\n" - "MaxTessControlUniformComponents 1024\n" - "MaxTessControlTotalOutputComponents 4096\n" - "MaxTessEvaluationInputComponents 128\n" - "MaxTessEvaluationOutputComponents 128\n" - "MaxTessEvaluationTextureImageUnits 16\n" - "MaxTessEvaluationUniformComponents 1024\n" - "MaxTessPatchComponents 120\n" - "MaxPatchVertices 32\n" - "MaxTessGenLevel 64\n" - "MaxViewports 16\n" - "MaxVertexAtomicCounters 0\n" - "MaxTessControlAtomicCounters 0\n" - "MaxTessEvaluationAtomicCounters 0\n" - "MaxGeometryAtomicCounters 0\n" - "MaxFragmentAtomicCounters 8\n" - "MaxCombinedAtomicCounters 8\n" - "MaxAtomicCounterBindings 1\n" - "MaxVertexAtomicCounterBuffers 0\n" - "MaxTessControlAtomicCounterBuffers 0\n" - "MaxTessEvaluationAtomicCounterBuffers 0\n" - "MaxGeometryAtomicCounterBuffers 0\n" - "MaxFragmentAtomicCounterBuffers 1\n" - "MaxCombinedAtomicCounterBuffers 1\n" - "MaxAtomicCounterBufferSize 16384\n" - "MaxTransformFeedbackBuffers 4\n" - "MaxTransformFeedbackInterleavedComponents 64\n" - "MaxCullDistances 8\n" - "MaxCombinedClipAndCullDistances 8\n" - "MaxSamples 4\n" - - "nonInductiveForLoops 1\n" - "whileLoops 1\n" - "doWhileLoops 1\n" - "generalUniformIndexing 1\n" - "generalAttributeMatrixVectorIndexing 1\n" - "generalVaryingIndexing 1\n" - "generalSamplerIndexing 1\n" - "generalVariableIndexing 1\n" - "generalConstantMatrixVectorIndexing 1\n" - ; - -// -// Parse either a .conf file provided by the user or the default string above. +// Parse either a .conf file provided by the user or the default from glslang::DefaultTBuiltInResource // void ProcessConfigFile() { @@ -229,210 +130,12 @@ void ProcessConfigFile() } if (config == 0) { - config = new char[strlen(DefaultConfig) + 1]; - strcpy(config, DefaultConfig); + Resources = glslang::DefaultTBuiltInResource; + return; } - const char* delims = " \t\n\r"; - const char* token = strtok(config, delims); - while (token) { - const char* valueStr = strtok(0, delims); - if (valueStr == 0 || ! (valueStr[0] == '-' || (valueStr[0] >= '0' && valueStr[0] <= '9'))) { - printf("Error: '%s' bad .conf file. Each name must be followed by one number.\n", valueStr ? valueStr : ""); - return; - } - int value = atoi(valueStr); + glslang::DecodeResourceLimits(&Resources, config); - if (strcmp(token, "MaxLights") == 0) - Resources.maxLights = value; - else if (strcmp(token, "MaxClipPlanes") == 0) - Resources.maxClipPlanes = value; - else if (strcmp(token, "MaxTextureUnits") == 0) - Resources.maxTextureUnits = value; - else if (strcmp(token, "MaxTextureCoords") == 0) - Resources.maxTextureCoords = value; - else if (strcmp(token, "MaxVertexAttribs") == 0) - Resources.maxVertexAttribs = value; - else if (strcmp(token, "MaxVertexUniformComponents") == 0) - Resources.maxVertexUniformComponents = value; - else if (strcmp(token, "MaxVaryingFloats") == 0) - Resources.maxVaryingFloats = value; - else if (strcmp(token, "MaxVertexTextureImageUnits") == 0) - Resources.maxVertexTextureImageUnits = value; - else if (strcmp(token, "MaxCombinedTextureImageUnits") == 0) - Resources.maxCombinedTextureImageUnits = value; - else if (strcmp(token, "MaxTextureImageUnits") == 0) - Resources.maxTextureImageUnits = value; - else if (strcmp(token, "MaxFragmentUniformComponents") == 0) - Resources.maxFragmentUniformComponents = value; - else if (strcmp(token, "MaxDrawBuffers") == 0) - Resources.maxDrawBuffers = value; - else if (strcmp(token, "MaxVertexUniformVectors") == 0) - Resources.maxVertexUniformVectors = value; - else if (strcmp(token, "MaxVaryingVectors") == 0) - Resources.maxVaryingVectors = value; - else if (strcmp(token, "MaxFragmentUniformVectors") == 0) - Resources.maxFragmentUniformVectors = value; - else if (strcmp(token, "MaxVertexOutputVectors") == 0) - Resources.maxVertexOutputVectors = value; - else if (strcmp(token, "MaxFragmentInputVectors") == 0) - Resources.maxFragmentInputVectors = value; - else if (strcmp(token, "MinProgramTexelOffset") == 0) - Resources.minProgramTexelOffset = value; - else if (strcmp(token, "MaxProgramTexelOffset") == 0) - Resources.maxProgramTexelOffset = value; - else if (strcmp(token, "MaxClipDistances") == 0) - Resources.maxClipDistances = value; - else if (strcmp(token, "MaxComputeWorkGroupCountX") == 0) - Resources.maxComputeWorkGroupCountX = value; - else if (strcmp(token, "MaxComputeWorkGroupCountY") == 0) - Resources.maxComputeWorkGroupCountY = value; - else if (strcmp(token, "MaxComputeWorkGroupCountZ") == 0) - Resources.maxComputeWorkGroupCountZ = value; - else if (strcmp(token, "MaxComputeWorkGroupSizeX") == 0) - Resources.maxComputeWorkGroupSizeX = value; - else if (strcmp(token, "MaxComputeWorkGroupSizeY") == 0) - Resources.maxComputeWorkGroupSizeY = value; - else if (strcmp(token, "MaxComputeWorkGroupSizeZ") == 0) - Resources.maxComputeWorkGroupSizeZ = value; - else if (strcmp(token, "MaxComputeUniformComponents") == 0) - Resources.maxComputeUniformComponents = value; - else if (strcmp(token, "MaxComputeTextureImageUnits") == 0) - Resources.maxComputeTextureImageUnits = value; - else if (strcmp(token, "MaxComputeImageUniforms") == 0) - Resources.maxComputeImageUniforms = value; - else if (strcmp(token, "MaxComputeAtomicCounters") == 0) - Resources.maxComputeAtomicCounters = value; - else if (strcmp(token, "MaxComputeAtomicCounterBuffers") == 0) - Resources.maxComputeAtomicCounterBuffers = value; - else if (strcmp(token, "MaxVaryingComponents") == 0) - Resources.maxVaryingComponents = value; - else if (strcmp(token, "MaxVertexOutputComponents") == 0) - Resources.maxVertexOutputComponents = value; - else if (strcmp(token, "MaxGeometryInputComponents") == 0) - Resources.maxGeometryInputComponents = value; - else if (strcmp(token, "MaxGeometryOutputComponents") == 0) - Resources.maxGeometryOutputComponents = value; - else if (strcmp(token, "MaxFragmentInputComponents") == 0) - Resources.maxFragmentInputComponents = value; - else if (strcmp(token, "MaxImageUnits") == 0) - Resources.maxImageUnits = value; - else if (strcmp(token, "MaxCombinedImageUnitsAndFragmentOutputs") == 0) - Resources.maxCombinedImageUnitsAndFragmentOutputs = value; - else if (strcmp(token, "MaxCombinedShaderOutputResources") == 0) - Resources.maxCombinedShaderOutputResources = value; - else if (strcmp(token, "MaxImageSamples") == 0) - Resources.maxImageSamples = value; - else if (strcmp(token, "MaxVertexImageUniforms") == 0) - Resources.maxVertexImageUniforms = value; - else if (strcmp(token, "MaxTessControlImageUniforms") == 0) - Resources.maxTessControlImageUniforms = value; - else if (strcmp(token, "MaxTessEvaluationImageUniforms") == 0) - Resources.maxTessEvaluationImageUniforms = value; - else if (strcmp(token, "MaxGeometryImageUniforms") == 0) - Resources.maxGeometryImageUniforms = value; - else if (strcmp(token, "MaxFragmentImageUniforms") == 0) - Resources.maxFragmentImageUniforms = value; - else if (strcmp(token, "MaxCombinedImageUniforms") == 0) - Resources.maxCombinedImageUniforms = value; - else if (strcmp(token, "MaxGeometryTextureImageUnits") == 0) - Resources.maxGeometryTextureImageUnits = value; - else if (strcmp(token, "MaxGeometryOutputVertices") == 0) - Resources.maxGeometryOutputVertices = value; - else if (strcmp(token, "MaxGeometryTotalOutputComponents") == 0) - Resources.maxGeometryTotalOutputComponents = value; - else if (strcmp(token, "MaxGeometryUniformComponents") == 0) - Resources.maxGeometryUniformComponents = value; - else if (strcmp(token, "MaxGeometryVaryingComponents") == 0) - Resources.maxGeometryVaryingComponents = value; - else if (strcmp(token, "MaxTessControlInputComponents") == 0) - Resources.maxTessControlInputComponents = value; - else if (strcmp(token, "MaxTessControlOutputComponents") == 0) - Resources.maxTessControlOutputComponents = value; - else if (strcmp(token, "MaxTessControlTextureImageUnits") == 0) - Resources.maxTessControlTextureImageUnits = value; - else if (strcmp(token, "MaxTessControlUniformComponents") == 0) - Resources.maxTessControlUniformComponents = value; - else if (strcmp(token, "MaxTessControlTotalOutputComponents") == 0) - Resources.maxTessControlTotalOutputComponents = value; - else if (strcmp(token, "MaxTessEvaluationInputComponents") == 0) - Resources.maxTessEvaluationInputComponents = value; - else if (strcmp(token, "MaxTessEvaluationOutputComponents") == 0) - Resources.maxTessEvaluationOutputComponents = value; - else if (strcmp(token, "MaxTessEvaluationTextureImageUnits") == 0) - Resources.maxTessEvaluationTextureImageUnits = value; - else if (strcmp(token, "MaxTessEvaluationUniformComponents") == 0) - Resources.maxTessEvaluationUniformComponents = value; - else if (strcmp(token, "MaxTessPatchComponents") == 0) - Resources.maxTessPatchComponents = value; - else if (strcmp(token, "MaxPatchVertices") == 0) - Resources.maxPatchVertices = value; - else if (strcmp(token, "MaxTessGenLevel") == 0) - Resources.maxTessGenLevel = value; - else if (strcmp(token, "MaxViewports") == 0) - Resources.maxViewports = value; - else if (strcmp(token, "MaxVertexAtomicCounters") == 0) - Resources.maxVertexAtomicCounters = value; - else if (strcmp(token, "MaxTessControlAtomicCounters") == 0) - Resources.maxTessControlAtomicCounters = value; - else if (strcmp(token, "MaxTessEvaluationAtomicCounters") == 0) - Resources.maxTessEvaluationAtomicCounters = value; - else if (strcmp(token, "MaxGeometryAtomicCounters") == 0) - Resources.maxGeometryAtomicCounters = value; - else if (strcmp(token, "MaxFragmentAtomicCounters") == 0) - Resources.maxFragmentAtomicCounters = value; - else if (strcmp(token, "MaxCombinedAtomicCounters") == 0) - Resources.maxCombinedAtomicCounters = value; - else if (strcmp(token, "MaxAtomicCounterBindings") == 0) - Resources.maxAtomicCounterBindings = value; - else if (strcmp(token, "MaxVertexAtomicCounterBuffers") == 0) - Resources.maxVertexAtomicCounterBuffers = value; - else if (strcmp(token, "MaxTessControlAtomicCounterBuffers") == 0) - Resources.maxTessControlAtomicCounterBuffers = value; - else if (strcmp(token, "MaxTessEvaluationAtomicCounterBuffers") == 0) - Resources.maxTessEvaluationAtomicCounterBuffers = value; - else if (strcmp(token, "MaxGeometryAtomicCounterBuffers") == 0) - Resources.maxGeometryAtomicCounterBuffers = value; - else if (strcmp(token, "MaxFragmentAtomicCounterBuffers") == 0) - Resources.maxFragmentAtomicCounterBuffers = value; - else if (strcmp(token, "MaxCombinedAtomicCounterBuffers") == 0) - Resources.maxCombinedAtomicCounterBuffers = value; - else if (strcmp(token, "MaxAtomicCounterBufferSize") == 0) - Resources.maxAtomicCounterBufferSize = value; - else if (strcmp(token, "MaxTransformFeedbackBuffers") == 0) - Resources.maxTransformFeedbackBuffers = value; - else if (strcmp(token, "MaxTransformFeedbackInterleavedComponents") == 0) - Resources.maxTransformFeedbackInterleavedComponents = value; - else if (strcmp(token, "MaxCullDistances") == 0) - Resources.maxCullDistances = value; - else if (strcmp(token, "MaxCombinedClipAndCullDistances") == 0) - Resources.maxCombinedClipAndCullDistances = value; - else if (strcmp(token, "MaxSamples") == 0) - Resources.maxSamples = value; - - else if (strcmp(token, "nonInductiveForLoops") == 0) - Resources.limits.nonInductiveForLoops = (value != 0); - else if (strcmp(token, "whileLoops") == 0) - Resources.limits.whileLoops = (value != 0); - else if (strcmp(token, "doWhileLoops") == 0) - Resources.limits.doWhileLoops = (value != 0); - else if (strcmp(token, "generalUniformIndexing") == 0) - Resources.limits.generalUniformIndexing = (value != 0); - else if (strcmp(token, "generalAttributeMatrixVectorIndexing") == 0) - Resources.limits.generalAttributeMatrixVectorIndexing = (value != 0); - else if (strcmp(token, "generalVaryingIndexing") == 0) - Resources.limits.generalVaryingIndexing = (value != 0); - else if (strcmp(token, "generalSamplerIndexing") == 0) - Resources.limits.generalSamplerIndexing = (value != 0); - else if (strcmp(token, "generalVariableIndexing") == 0) - Resources.limits.generalVariableIndexing = (value != 0); - else if (strcmp(token, "generalConstantMatrixVectorIndexing") == 0) - Resources.limits.generalConstantMatrixVectorIndexing = (value != 0); - else - printf("Warning: unrecognized limit (%s) in configuration file.\n", token); - - token = strtok(0, delims); - } if (configStrings) FreeFileData(configStrings); else @@ -449,6 +152,7 @@ int NumWorkItems = 0; int Options = 0; const char* ExecutableName = nullptr; const char* binaryFileName = nullptr; +const char* entryPointName = nullptr; // // Create the default name for saving a binary if -o is not provided. @@ -537,6 +241,19 @@ void ProcessArguments(int argc, char* argv[]) case 'd': Options |= EOptionDefaultDesktop; break; + case 'D': + Options |= EOptionReadHlsl; + break; + case 'e': + // HLSL todo: entry point handle needs much more sophistication. + // This is okay for one compilation unit with one entry point. + entryPointName = argv[1]; + if (argc > 0) { + argc--; + argv++; + } else + Error("no provided for -e"); + break; case 'h': usage(); break; @@ -616,6 +333,8 @@ void SetMessageOptions(EShMessages& messages) messages = (EShMessages)(messages | EShMsgVulkanRules); if (Options & EOptionOutputPreprocessed) messages = (EShMessages)(messages | EShMsgOnlyPreprocessor); + if (Options & EOptionReadHlsl) + messages = (EShMessages)(messages | EShMsgReadHlsl); } // @@ -693,6 +412,8 @@ void CompileAndLinkShaderUnits(std::vector compUnits) const auto &compUnit = *it; glslang::TShader* shader = new glslang::TShader(compUnit.stage); shader->setStrings(compUnit.text, 1); + if (entryPointName) // HLSL todo: this needs to be tracked per compUnits + shader->setEntryPoint(entryPointName); shaders.push_back(shader); const int defaultVersion = Options & EOptionDefaultDesktop? 110: 100; @@ -727,20 +448,24 @@ void CompileAndLinkShaderUnits(std::vector compUnits) // Program-level processing... // + // Link if (! (Options & EOptionOutputPreprocessed) && ! program.link(messages)) LinkFailed = true; + // Report if (! (Options & EOptionSuppressInfolog) && ! (Options & EOptionMemoryLeakMode)) { PutsIfNonEmpty(program.getInfoLog()); PutsIfNonEmpty(program.getInfoDebugLog()); } + // Reflect if (Options & EOptionDumpReflection) { program.buildReflection(); program.dumpReflection(); } + // Dump SPIR-V if (Options & EOptionSpv) { if (CompileFailed || LinkFailed) printf("SPIR-V is not generated for failed compile or link\n"); @@ -748,11 +473,14 @@ void CompileAndLinkShaderUnits(std::vector compUnits) for (int stage = 0; stage < EShLangCount; ++stage) { if (program.getIntermediate((EShLanguage)stage)) { std::vector spirv; - glslang::GlslangToSpv(*program.getIntermediate((EShLanguage)stage), spirv); + std::string warningsErrors; + spv::SpvBuildLogger logger; + glslang::GlslangToSpv(*program.getIntermediate((EShLanguage)stage), spirv, &logger); // Dump the spv to a file or stdout, etc., but only if not doing // memory/perf testing, as it's not internal to programmatic use. if (! (Options & EOptionMemoryLeakMode)) { + printf("%s", logger.getAllMessages().c_str()); glslang::OutputSpv(spirv, GetBinaryName((EShLanguage)stage)); if (Options & EOptionHumanReadableSpv) { spv::Disassemble(std::cout, spirv); @@ -832,7 +560,7 @@ int C_DECL main(int argc, char* argv[]) ProcessArguments(argc, argv); if (Options & EOptionDumpConfig) { - printf("%s", DefaultConfig); + printf("%s", glslang::GetDefaultTBuiltInResourceString().c_str()); if (Worklist.empty()) return ESuccess; } @@ -1031,6 +759,8 @@ void usage() " creates the default configuration file (redirect to a .conf file)\n" " -d default to desktop (#version 110) when there is no shader #version\n" " (default is ES version 100)\n" + " -D input is HLSL\n" + " -e specify entry-point name\n" " -h print this usage message\n" " -i intermediate tree (glslang AST) is printed out\n" " -l link all input files together to form a single module\n" diff --git a/Test/330.frag b/Test/330.frag index 57736b0c..9afa8f82 100644 --- a/Test/330.frag +++ b/Test/330.frag @@ -148,3 +148,5 @@ void fooKeyMem() { KeyMem.precise; } + +layout(location=28, index=2) out vec4 outIndex2; // ERROR index out of range \ No newline at end of file diff --git a/Test/400.tesc b/Test/400.tesc index 950f5de1..d01bd3ea 100644 --- a/Test/400.tesc +++ b/Test/400.tesc @@ -100,3 +100,6 @@ void foop() patch out pinbn { int a; } pinbi; + +invariant precise out vec4 badOrder[]; // ERROR, precise must appear first +void badp(out precise float f); // ERROR, precise must appear first diff --git a/Test/420.comp b/Test/420.comp new file mode 100755 index 00000000..d92e6f0d --- /dev/null +++ b/Test/420.comp @@ -0,0 +1,30 @@ +#version 420 + +layout(local_size_x = 2) in; // ERROR, no compute + +#extension GL_ARB_compute_shader : enable + +layout(local_size_x = 2, local_size_y = 4, local_size_z = 6) in; + +shared vec3 sfoo; + +void main() +{ + sfoo = vec3(gl_WorkGroupSize.x, gl_WorkGroupSize.y, gl_WorkGroupSize.z); + sfoo += gl_WorkGroupSize + gl_NumWorkGroups + gl_WorkGroupID + gl_LocalInvocationID + gl_GlobalInvocationID; + sfoo *= gl_LocalInvocationIndex; + sfoo += gl_MaxComputeWorkGroupCount + gl_MaxComputeWorkGroupSize; + sfoo *= gl_MaxComputeUniformComponents + + gl_MaxComputeTextureImageUnits + + gl_MaxComputeImageUniforms + + gl_MaxComputeAtomicCounters + + gl_MaxComputeAtomicCounterBuffers; + + barrier(); + memoryBarrier(); + memoryBarrierAtomicCounter(); + memoryBarrierBuffer(); + memoryBarrierImage(); + memoryBarrierShared(); + groupMemoryBarrier(); +} \ No newline at end of file diff --git a/Test/450.frag b/Test/450.frag index a2d99e8c..04f3aa1c 100644 --- a/Test/450.frag +++ b/Test/450.frag @@ -47,3 +47,10 @@ void foo() s += imageSamples(i2dmsa); float f = imageAtomicExchange(i2dmsa, ivec3(in3), 2, 4.5); } + +in float gl_CullDistance[6]; + +float cull(int i) +{ + return (i >= 6) ? gl_CullDistance[5] : gl_CullDistance[i]; +} diff --git a/Test/baseResults/100.frag.out b/Test/baseResults/100.frag.out index 2c39cad4..7af716d8 100644 --- a/Test/baseResults/100.frag.out +++ b/Test/baseResults/100.frag.out @@ -2,7 +2,6 @@ ERROR: 0:3: '{ } style initializers' : not supported with this profile: es ERROR: 0:3: 'initializer' : not supported for this version or the enabled extensions ERROR: 0:3: 'array initializer' : not supported for this version or the enabled extensions -ERROR: 0:3: 'non-constant global initializer' : not supported with this profile: es ERROR: 0:4: '#version' : must occur first in shader ERROR: 0:7: 'attribute' : not supported in this stage: fragment ERROR: 0:7: 'float' : type requires declaration of default precision qualifier @@ -86,7 +85,7 @@ ERROR: 0:194: 'a' : can't use function syntax on variable ERROR: 0:214: 'non-constant global initializer' : not supported with this profile: es ERROR: 0:3000: '#error' : line of this error should be 3000 ERROR: 0:3002: '' : syntax error -ERROR: 78 compilation errors. No code generated. +ERROR: 77 compilation errors. No code generated. Shader version: 100 diff --git a/Test/baseResults/100LimitsConf.vert.out b/Test/baseResults/100LimitsConf.vert.out index 46cb8453..e27c2cc7 100644 --- a/Test/baseResults/100LimitsConf.vert.out +++ b/Test/baseResults/100LimitsConf.vert.out @@ -22,3 +22,7 @@ ERROR: 0:65: 'limitations' : Non-constant-index-expression ERROR: 20 compilation errors. No code generated. + +Linked vertex stage: + + diff --git a/Test/baseResults/100scope.vert.out b/Test/baseResults/100scope.vert.out index a3a67970..2b542b0c 100644 --- a/Test/baseResults/100scope.vert.out +++ b/Test/baseResults/100scope.vert.out @@ -4,14 +4,16 @@ ERROR: 0:17: 'b' : function name is redeclaration of existing name ERROR: 0:20: 'c' : redefinition ERROR: 0:22: 'f' : redefinition ERROR: 0:24: 'redefinition of built-in function' : not supported with this profile: es +ERROR: 0:24: 'highp' : overloaded functions must have the same parameter precision qualifiers for argument 1 ERROR: 0:25: 'redefinition of built-in function' : not supported with this profile: es +ERROR: 0:25: 'highp' : overloaded functions must have the same parameter precision qualifiers for argument 1 ERROR: 0:38: 'local function declaration' : not supported with this profile: es ERROR: 0:43: 'sin' : can't use function syntax on variable ERROR: 0:57: 'z' : undeclared identifier ERROR: 0:57: 'z' : redefinition ERROR: 0:73: 'degrees' : can't use function syntax on variable ERROR: 0:76: 'vertex-shader struct output' : not supported for this version or the enabled extensions -ERROR: 12 compilation errors. No code generated. +ERROR: 14 compilation errors. No code generated. Shader version: 100 diff --git a/Test/baseResults/150.geom.out b/Test/baseResults/150.geom.out index aa00868d..48b7925f 100644 --- a/Test/baseResults/150.geom.out +++ b/Test/baseResults/150.geom.out @@ -215,9 +215,9 @@ ERROR: node is still EOpNull! 0:33 Constant: 0:33 3 (const int) 0:33 direct index (temp float ClipDistance) -0:33 gl_ClipDistance: direct index for structure (in 1-element array of float ClipDistance) -0:33 direct index (temp block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 1-element array of float ClipDistance gl_ClipDistance}) -0:33 'gl_in' (in 4-element array of block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 1-element array of float ClipDistance gl_ClipDistance}) +0:33 gl_ClipDistance: direct index for structure (in 3-element array of float ClipDistance) +0:33 direct index (temp block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) +0:33 'gl_in' (in 4-element array of block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) 0:33 Constant: 0:33 1 (const int) 0:33 Constant: @@ -230,8 +230,8 @@ ERROR: node is still EOpNull! 0:34 Constant: 0:34 0 (const uint) 0:34 gl_Position: direct index for structure (in 4-component vector of float Position) -0:34 direct index (temp block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 1-element array of float ClipDistance gl_ClipDistance}) -0:34 'gl_in' (in 4-element array of block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 1-element array of float ClipDistance gl_ClipDistance}) +0:34 direct index (temp block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) +0:34 'gl_in' (in 4-element array of block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) 0:34 Constant: 0:34 0 (const int) 0:34 Constant: @@ -242,8 +242,8 @@ ERROR: node is still EOpNull! 0:35 Constant: 0:35 1 (const uint) 0:35 gl_PointSize: direct index for structure (in float PointSize) -0:35 direct index (temp block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 1-element array of float ClipDistance gl_ClipDistance}) -0:35 'gl_in' (in 4-element array of block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 1-element array of float ClipDistance gl_ClipDistance}) +0:35 direct index (temp block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) +0:35 'gl_in' (in 4-element array of block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) 0:35 Constant: 0:35 3 (const int) 0:35 Constant: @@ -293,7 +293,7 @@ ERROR: node is still EOpNull! 0:? 'toF' (layout(stream=0 ) out block{layout(stream=0 ) out 3-component vector of float color}) 0:? 'anon@0' (layout(stream=0 ) out block{layout(stream=0 ) out 3-component vector of float color}) 0:? 'anon@1' (layout(stream=0 ) out block{layout(stream=0 ) gl_Position 4-component vector of float Position gl_Position, layout(stream=0 ) gl_PointSize float PointSize gl_PointSize, layout(stream=0 ) out 4-element array of float ClipDistance gl_ClipDistance}) -0:? 'gl_in' (in 4-element array of block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 1-element array of float ClipDistance gl_ClipDistance}) +0:? 'gl_in' (in 4-element array of block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) 0:? 'ov0' (layout(stream=0 ) out 4-component vector of float) 0:? 'ov4' (layout(stream=4 ) out 4-component vector of float) 0:? 'o1v0' (layout(stream=0 ) out 4-component vector of float) diff --git a/Test/baseResults/150.tesc.out b/Test/baseResults/150.tesc.out index a5289c93..78020e12 100644 --- a/Test/baseResults/150.tesc.out +++ b/Test/baseResults/150.tesc.out @@ -229,7 +229,10 @@ ERROR: 0:74: 'in' : type must be an array: ina ERROR: 0:76: '[]' : tessellation input array size must be gl_MaxPatchVertices or implicitly sized ERROR: 0:83: 'location' : overlapping use of location 4 ERROR: 0:87: 'location' : overlapping use of location 4 -ERROR: 18 compilation errors. No code generated. +ERROR: 0:104: '' : precise qualifier must appear first +ERROR: 0:105: '' : precise qualifier must appear first +ERROR: 0:105: '' : precise qualifier must appear first +ERROR: 21 compilation errors. No code generated. Shader version: 400 @@ -391,20 +394,20 @@ ERROR: node is still EOpNull! 0:91 Function Parameters: 0:? Sequence 0:95 multiply second child into first child (temp 3-component vector of float) -0:95 'pv3' (temp 3-component vector of float) -0:95 'pv3' (temp 3-component vector of float) +0:95 'pv3' (noContraction temp 3-component vector of float) +0:95 'pv3' (noContraction temp 3-component vector of float) 0:96 move second child to first child (temp 3-component vector of float) -0:96 'pv3' (temp 3-component vector of float) +0:96 'pv3' (noContraction temp 3-component vector of float) 0:96 fma (global 3-component vector of float) -0:96 'pv3' (temp 3-component vector of float) -0:96 'pv3' (temp 3-component vector of float) -0:96 'pv3' (temp 3-component vector of float) +0:96 'pv3' (noContraction temp 3-component vector of float) +0:96 'pv3' (noContraction temp 3-component vector of float) +0:96 'pv3' (noContraction temp 3-component vector of float) 0:97 move second child to first child (temp double) -0:97 'd' (temp double) +0:97 'd' (noContraction temp double) 0:97 fma (global double) -0:97 'd' (temp double) -0:97 'd' (temp double) -0:97 'd' (temp double) +0:97 'd' (noContraction temp double) +0:97 'd' (noContraction temp double) +0:97 'd' (noContraction temp double) 0:? Linker Objects 0:? 'gl_out' (out 4-element array of block{out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out implicitly-sized array of float ClipDistance gl_ClipDistance}) 0:? 'outa' (global 4-element array of int) @@ -420,8 +423,9 @@ ERROR: node is still EOpNull! 0:? 'ovla' (layout(location=3 ) out 4-element array of 4-component vector of float) 0:? 'ovlb' (layout(location=4 ) out 4-element array of 4-component vector of float) 0:? 'ovlc' (layout(location=4 ) out 4-element array of 4-component vector of float) -0:? 'pv3' (temp 3-component vector of float) +0:? 'pv3' (noContraction temp 3-component vector of float) 0:? 'pinbi' (patch out block{out int a}) +0:? 'badOrder' (invariant noContraction out 4-element array of 4-component vector of float) 400.tese Warning, version 400 is not yet complete; most version-specific features are present, but some are missing. @@ -563,7 +567,7 @@ ERROR: node is still EOpNull! 0:? 'badp2' (flat patch in 4-component vector of float) 0:? 'badp3' (noperspective patch in 4-component vector of float) 0:? 'badp4' (patch sample in 3-component vector of float) -0:? 'gl_in' (in 32-element array of block{in implicitly-sized array of float ClipDistance gl_ClipDistance}) +0:? 'gl_in' (in 32-element array of block{in 1-element array of float ClipDistance gl_ClipDistance}) 0:? 'ina' (in 2-component vector of float) 0:? 'inb' (in 32-element array of 2-component vector of float) 0:? 'inc' (in 32-element array of 2-component vector of float) @@ -716,18 +720,18 @@ ERROR: node is still EOpNull! 420.tese Warning, version 420 is not yet complete; most version-specific features are present, but some are missing. -ERROR: 0:7: '=' : cannot convert from 'global 3-element array of float' to 'global 2-element array of float' -ERROR: 0:8: 'initializer list' : wrong vector size (or rows in a matrix column): global 2-component vector of float -ERROR: 0:9: 'initializer list' : wrong number of matrix columns: global 3X3 matrix of float -ERROR: 0:10: 'initializer list' : wrong number of matrix columns: global 2X2 matrix of float +ERROR: 0:7: '=' : cannot convert from 'const 3-element array of float' to 'global 2-element array of float' +ERROR: 0:8: 'initializer list' : wrong vector size (or rows in a matrix column): temp 2-component vector of float +ERROR: 0:9: 'initializer list' : wrong number of matrix columns: temp 3X3 matrix of float +ERROR: 0:10: 'initializer list' : wrong number of matrix columns: temp 2X2 matrix of float ERROR: 0:25: 'initializer list' : wrong number of structure members ERROR: 0:27: '=' : cannot convert from 'const bool' to 'global int' -ERROR: 0:28: 'constructor' : cannot convert parameter 2 from 'const float' to 'global 4-component vector of float' +ERROR: 0:28: 'constructor' : cannot convert parameter 2 from 'const float' to 'temp 4-component vector of float' ERROR: 0:29: 'constructor' : cannot convert parameter 2 from 'const 2X2 matrix of float' to 'const 4-component vector of float' ERROR: 0:29: 'const 2-element array of 4-component vector of float' : cannot construct with these arguments ERROR: 0:29: '=' : cannot convert from 'const float' to 'global 2-element array of 4-component vector of float' -ERROR: 0:30: 'initializer list' : wrong number of matrix columns: global 4X2 matrix of float -ERROR: 0:40: 'constructor' : cannot convert parameter 1 from 'temp float' to 'global structure{global float s, global float t}' +ERROR: 0:30: 'initializer list' : wrong number of matrix columns: temp 4X2 matrix of float +ERROR: 0:40: 'constructor' : cannot convert parameter 1 from 'temp float' to 'temp structure{global float s, global float t}' ERROR: 0:58: 'initializer list' : wrong number of structure members ERROR: 13 compilation errors. No code generated. @@ -776,7 +780,7 @@ ERROR: node is still EOpNull! 0:68 Sequence 0:68 move second child to first child (temp 3-component vector of float) 0:68 'bv3' (global 3-component vector of float) -0:68 Construct vec3 (global 3-component vector of float) +0:68 Construct vec3 (temp 3-component vector of float) 0:68 'vc1' (global float) 0:68 'vc2' (global float) 0:68 'vc3' (global float) @@ -932,8 +936,8 @@ vertices = 4 0:20 move second child to first child (temp 4-component vector of float) 0:20 'p' (temp 4-component vector of float) 0:20 gl_Position: direct index for structure (in 4-component vector of float Position) -0:20 direct index (temp block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 1-element array of float ClipDistance gl_ClipDistance}) -0:20 'gl_in' (in 32-element array of block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 1-element array of float ClipDistance gl_ClipDistance}) +0:20 direct index (temp block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) +0:20 'gl_in' (in 32-element array of block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) 0:20 Constant: 0:20 1 (const int) 0:20 Constant: @@ -942,8 +946,8 @@ vertices = 4 0:21 move second child to first child (temp float) 0:21 'ps' (temp float) 0:21 gl_PointSize: direct index for structure (in float PointSize) -0:21 direct index (temp block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 1-element array of float ClipDistance gl_ClipDistance}) -0:21 'gl_in' (in 32-element array of block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 1-element array of float ClipDistance gl_ClipDistance}) +0:21 direct index (temp block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) +0:21 'gl_in' (in 32-element array of block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) 0:21 Constant: 0:21 1 (const int) 0:21 Constant: @@ -952,9 +956,9 @@ vertices = 4 0:22 move second child to first child (temp float) 0:22 'cd' (temp float) 0:22 direct index (temp float ClipDistance) -0:22 gl_ClipDistance: direct index for structure (in 1-element array of float ClipDistance) -0:22 direct index (temp block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 1-element array of float ClipDistance gl_ClipDistance}) -0:22 'gl_in' (in 32-element array of block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 1-element array of float ClipDistance gl_ClipDistance}) +0:22 gl_ClipDistance: direct index for structure (in 3-element array of float ClipDistance) +0:22 direct index (temp block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) +0:22 'gl_in' (in 32-element array of block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) 0:22 Constant: 0:22 1 (const int) 0:22 Constant: @@ -975,25 +979,25 @@ vertices = 4 0:26 'gl_InvocationID' (in int InvocationID) 0:28 move second child to first child (temp 4-component vector of float) 0:28 gl_Position: direct index for structure (out 4-component vector of float Position) -0:28 indirect index (temp block{out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out 1-element array of float ClipDistance gl_ClipDistance}) -0:28 'gl_out' (out 4-element array of block{out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out 1-element array of float ClipDistance gl_ClipDistance}) +0:28 indirect index (temp block{out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out 2-element array of float ClipDistance gl_ClipDistance}) +0:28 'gl_out' (out 4-element array of block{out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out 2-element array of float ClipDistance gl_ClipDistance}) 0:28 'gl_InvocationID' (in int InvocationID) 0:28 Constant: 0:28 0 (const int) 0:28 'p' (temp 4-component vector of float) 0:29 move second child to first child (temp float) 0:29 gl_PointSize: direct index for structure (out float PointSize) -0:29 indirect index (temp block{out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out 1-element array of float ClipDistance gl_ClipDistance}) -0:29 'gl_out' (out 4-element array of block{out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out 1-element array of float ClipDistance gl_ClipDistance}) +0:29 indirect index (temp block{out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out 2-element array of float ClipDistance gl_ClipDistance}) +0:29 'gl_out' (out 4-element array of block{out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out 2-element array of float ClipDistance gl_ClipDistance}) 0:29 'gl_InvocationID' (in int InvocationID) 0:29 Constant: 0:29 1 (const int) 0:29 'ps' (temp float) 0:30 move second child to first child (temp float) 0:30 direct index (temp float ClipDistance) -0:30 gl_ClipDistance: direct index for structure (out 1-element array of float ClipDistance) -0:30 indirect index (temp block{out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out 1-element array of float ClipDistance gl_ClipDistance}) -0:30 'gl_out' (out 4-element array of block{out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out 1-element array of float ClipDistance gl_ClipDistance}) +0:30 gl_ClipDistance: direct index for structure (out 2-element array of float ClipDistance) +0:30 indirect index (temp block{out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out 2-element array of float ClipDistance gl_ClipDistance}) +0:30 'gl_out' (out 4-element array of block{out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out 2-element array of float ClipDistance gl_ClipDistance}) 0:30 'gl_InvocationID' (in int InvocationID) 0:30 Constant: 0:30 2 (const int) @@ -1027,8 +1031,8 @@ vertices = 4 0:23 move second child to first child (temp 4-component vector of float) 0:23 'p' (temp 4-component vector of float) 0:23 gl_Position: direct index for structure (in 4-component vector of float Position) -0:23 direct index (temp block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 1-element array of float ClipDistance gl_ClipDistance}) -0:23 'gl_in' (in 32-element array of block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 1-element array of float ClipDistance gl_ClipDistance}) +0:23 direct index (temp block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) +0:23 'gl_in' (in 32-element array of block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) 0:23 Constant: 0:23 1 (const int) 0:23 Constant: @@ -1037,8 +1041,8 @@ vertices = 4 0:24 move second child to first child (temp float) 0:24 'ps' (temp float) 0:24 gl_PointSize: direct index for structure (in float PointSize) -0:24 direct index (temp block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 1-element array of float ClipDistance gl_ClipDistance}) -0:24 'gl_in' (in 32-element array of block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 1-element array of float ClipDistance gl_ClipDistance}) +0:24 direct index (temp block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) +0:24 'gl_in' (in 32-element array of block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) 0:24 Constant: 0:24 1 (const int) 0:24 Constant: @@ -1047,9 +1051,9 @@ vertices = 4 0:25 move second child to first child (temp float) 0:25 'cd' (temp float) 0:25 direct index (temp float ClipDistance) -0:25 gl_ClipDistance: direct index for structure (in 1-element array of float ClipDistance) -0:25 direct index (temp block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 1-element array of float ClipDistance gl_ClipDistance}) -0:25 'gl_in' (in 32-element array of block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 1-element array of float ClipDistance gl_ClipDistance}) +0:25 gl_ClipDistance: direct index for structure (in 3-element array of float ClipDistance) +0:25 direct index (temp block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) +0:25 'gl_in' (in 32-element array of block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) 0:25 Constant: 0:25 1 (const int) 0:25 Constant: @@ -1070,25 +1074,25 @@ vertices = 4 0:29 'gl_InvocationID' (in int InvocationID) 0:31 move second child to first child (temp 4-component vector of float) 0:31 gl_Position: direct index for structure (out 4-component vector of float Position) -0:31 indirect index (temp block{out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out 1-element array of float ClipDistance gl_ClipDistance}) -0:31 'gl_out' (out 4-element array of block{out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out 1-element array of float ClipDistance gl_ClipDistance}) +0:31 indirect index (temp block{out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out 2-element array of float ClipDistance gl_ClipDistance}) +0:31 'gl_out' (out 4-element array of block{out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out 2-element array of float ClipDistance gl_ClipDistance}) 0:31 'gl_InvocationID' (in int InvocationID) 0:31 Constant: 0:31 0 (const int) 0:31 'p' (temp 4-component vector of float) 0:32 move second child to first child (temp float) 0:32 gl_PointSize: direct index for structure (out float PointSize) -0:32 indirect index (temp block{out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out 1-element array of float ClipDistance gl_ClipDistance}) -0:32 'gl_out' (out 4-element array of block{out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out 1-element array of float ClipDistance gl_ClipDistance}) +0:32 indirect index (temp block{out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out 2-element array of float ClipDistance gl_ClipDistance}) +0:32 'gl_out' (out 4-element array of block{out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out 2-element array of float ClipDistance gl_ClipDistance}) 0:32 'gl_InvocationID' (in int InvocationID) 0:32 Constant: 0:32 1 (const int) 0:32 'ps' (temp float) 0:33 move second child to first child (temp float) 0:33 direct index (temp float ClipDistance) -0:33 gl_ClipDistance: direct index for structure (out 1-element array of float ClipDistance) -0:33 indirect index (temp block{out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out 1-element array of float ClipDistance gl_ClipDistance}) -0:33 'gl_out' (out 4-element array of block{out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out 1-element array of float ClipDistance gl_ClipDistance}) +0:33 gl_ClipDistance: direct index for structure (out 2-element array of float ClipDistance) +0:33 indirect index (temp block{out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out 2-element array of float ClipDistance gl_ClipDistance}) +0:33 'gl_out' (out 4-element array of block{out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out 2-element array of float ClipDistance gl_ClipDistance}) 0:33 'gl_InvocationID' (in int InvocationID) 0:33 Constant: 0:33 2 (const int) @@ -1158,8 +1162,8 @@ vertices = 4 0:67 Function Parameters: 0:69 Sequence 0:69 gl_PointSize: direct index for structure (out float PointSize) -0:69 direct index (temp block{out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out 1-element array of float ClipDistance gl_ClipDistance}) -0:69 'gl_out' (out 4-element array of block{out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out 1-element array of float ClipDistance gl_ClipDistance}) +0:69 direct index (temp block{out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out 2-element array of float ClipDistance gl_ClipDistance}) +0:69 'gl_out' (out 4-element array of block{out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out 2-element array of float ClipDistance gl_ClipDistance}) 0:69 Constant: 0:69 4 (const int) 0:69 Constant: @@ -1169,20 +1173,20 @@ vertices = 4 0:91 Function Parameters: 0:? Sequence 0:95 multiply second child into first child (temp 3-component vector of float) -0:95 'pv3' (temp 3-component vector of float) -0:95 'pv3' (temp 3-component vector of float) +0:95 'pv3' (noContraction temp 3-component vector of float) +0:95 'pv3' (noContraction temp 3-component vector of float) 0:96 move second child to first child (temp 3-component vector of float) -0:96 'pv3' (temp 3-component vector of float) +0:96 'pv3' (noContraction temp 3-component vector of float) 0:96 fma (global 3-component vector of float) -0:96 'pv3' (temp 3-component vector of float) -0:96 'pv3' (temp 3-component vector of float) -0:96 'pv3' (temp 3-component vector of float) +0:96 'pv3' (noContraction temp 3-component vector of float) +0:96 'pv3' (noContraction temp 3-component vector of float) +0:96 'pv3' (noContraction temp 3-component vector of float) 0:97 move second child to first child (temp double) -0:97 'd' (temp double) +0:97 'd' (noContraction temp double) 0:97 fma (global double) -0:97 'd' (temp double) -0:97 'd' (temp double) -0:97 'd' (temp double) +0:97 'd' (noContraction temp double) +0:97 'd' (noContraction temp double) +0:97 'd' (noContraction temp double) 0:8 Function Definition: main( (global void) 0:8 Function Parameters: 0:15 Function Definition: main( (global void) @@ -1192,8 +1196,8 @@ vertices = 4 0:17 move second child to first child (temp 4-component vector of float) 0:17 'p' (temp 4-component vector of float) 0:17 gl_Position: direct index for structure (in 4-component vector of float Position) -0:17 direct index (temp block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 1-element array of float ClipDistance gl_ClipDistance}) -0:17 'gl_in' (in 32-element array of block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 1-element array of float ClipDistance gl_ClipDistance}) +0:17 direct index (temp block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) +0:17 'gl_in' (in 32-element array of block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) 0:17 Constant: 0:17 1 (const int) 0:17 Constant: @@ -1202,8 +1206,8 @@ vertices = 4 0:18 move second child to first child (temp float) 0:18 'ps' (temp float) 0:18 gl_PointSize: direct index for structure (in float PointSize) -0:18 direct index (temp block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 1-element array of float ClipDistance gl_ClipDistance}) -0:18 'gl_in' (in 32-element array of block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 1-element array of float ClipDistance gl_ClipDistance}) +0:18 direct index (temp block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) +0:18 'gl_in' (in 32-element array of block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) 0:18 Constant: 0:18 1 (const int) 0:18 Constant: @@ -1212,9 +1216,9 @@ vertices = 4 0:19 move second child to first child (temp float) 0:19 'cd' (temp float) 0:19 direct index (temp float ClipDistance) -0:19 gl_ClipDistance: direct index for structure (in 1-element array of float ClipDistance) -0:19 direct index (temp block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 1-element array of float ClipDistance gl_ClipDistance}) -0:19 'gl_in' (in 32-element array of block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 1-element array of float ClipDistance gl_ClipDistance}) +0:19 gl_ClipDistance: direct index for structure (in 3-element array of float ClipDistance) +0:19 direct index (temp block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) +0:19 'gl_in' (in 32-element array of block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) 0:19 Constant: 0:19 1 (const int) 0:19 Constant: @@ -1280,7 +1284,7 @@ vertices = 4 0:37 0 (const int) 0:36 true case is null 0:? Linker Objects -0:? 'gl_out' (out 4-element array of block{out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out 1-element array of float ClipDistance gl_ClipDistance}) +0:? 'gl_out' (out 4-element array of block{out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out 2-element array of float ClipDistance gl_ClipDistance}) 0:? 'outa' (global 4-element array of int) 0:? 'patchOut' (patch out 4-component vector of float) 0:? 'patchIn' (patch in 4-component vector of float) @@ -1294,8 +1298,9 @@ vertices = 4 0:? 'ovla' (layout(location=3 ) out 4-element array of 4-component vector of float) 0:? 'ovlb' (layout(location=4 ) out 4-element array of 4-component vector of float) 0:? 'ovlc' (layout(location=4 ) out 4-element array of 4-component vector of float) -0:? 'pv3' (temp 3-component vector of float) +0:? 'pv3' (noContraction temp 3-component vector of float) 0:? 'pinbi' (patch out block{out int a}) +0:? 'badOrder' (invariant noContraction out 4-element array of 4-component vector of float) 0:? 'a' (out 3-element array of int) 0:? 'outb' (out 5-element array of int) 0:? 'outc' (out 4-element array of int) @@ -1324,8 +1329,8 @@ ERROR: node is still EOpNull! 0:22 move second child to first child (temp 4-component vector of float) 0:22 'p' (temp 4-component vector of float) 0:22 gl_Position: direct index for structure (in 4-component vector of float Position) -0:22 direct index (temp block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 1-element array of float ClipDistance gl_ClipDistance}) -0:22 'gl_in' (in 32-element array of block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 1-element array of float ClipDistance gl_ClipDistance}) +0:22 direct index (temp block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) +0:22 'gl_in' (in 32-element array of block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) 0:22 Constant: 0:22 1 (const int) 0:22 Constant: @@ -1334,8 +1339,8 @@ ERROR: node is still EOpNull! 0:23 move second child to first child (temp float) 0:23 'ps' (temp float) 0:23 gl_PointSize: direct index for structure (in float PointSize) -0:23 direct index (temp block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 1-element array of float ClipDistance gl_ClipDistance}) -0:23 'gl_in' (in 32-element array of block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 1-element array of float ClipDistance gl_ClipDistance}) +0:23 direct index (temp block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) +0:23 'gl_in' (in 32-element array of block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) 0:23 Constant: 0:23 1 (const int) 0:23 Constant: @@ -1344,9 +1349,9 @@ ERROR: node is still EOpNull! 0:24 move second child to first child (temp float) 0:24 'cd' (temp float) 0:24 direct index (temp float ClipDistance) -0:24 gl_ClipDistance: direct index for structure (in 1-element array of float ClipDistance) -0:24 direct index (temp block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 1-element array of float ClipDistance gl_ClipDistance}) -0:24 'gl_in' (in 32-element array of block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 1-element array of float ClipDistance gl_ClipDistance}) +0:24 gl_ClipDistance: direct index for structure (in 3-element array of float ClipDistance) +0:24 direct index (temp block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) +0:24 'gl_in' (in 32-element array of block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) 0:24 Constant: 0:24 1 (const int) 0:24 Constant: @@ -1414,8 +1419,8 @@ ERROR: node is still EOpNull! 0:32 move second child to first child (temp 4-component vector of float) 0:32 'p' (temp 4-component vector of float) 0:32 gl_Position: direct index for structure (in 4-component vector of float Position) -0:32 direct index (temp block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 1-element array of float ClipDistance gl_ClipDistance}) -0:32 'gl_in' (in 32-element array of block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 1-element array of float ClipDistance gl_ClipDistance}) +0:32 direct index (temp block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) +0:32 'gl_in' (in 32-element array of block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) 0:32 Constant: 0:32 1 (const int) 0:32 Constant: @@ -1424,8 +1429,8 @@ ERROR: node is still EOpNull! 0:33 move second child to first child (temp float) 0:33 'ps' (temp float) 0:33 gl_PointSize: direct index for structure (in float PointSize) -0:33 direct index (temp block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 1-element array of float ClipDistance gl_ClipDistance}) -0:33 'gl_in' (in 32-element array of block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 1-element array of float ClipDistance gl_ClipDistance}) +0:33 direct index (temp block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) +0:33 'gl_in' (in 32-element array of block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) 0:33 Constant: 0:33 1 (const int) 0:33 Constant: @@ -1434,9 +1439,9 @@ ERROR: node is still EOpNull! 0:34 move second child to first child (temp float) 0:34 'cd' (temp float) 0:34 direct index (temp float ClipDistance) -0:34 gl_ClipDistance: direct index for structure (in 1-element array of float ClipDistance) -0:34 direct index (temp block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 1-element array of float ClipDistance gl_ClipDistance}) -0:34 'gl_in' (in 32-element array of block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 1-element array of float ClipDistance gl_ClipDistance}) +0:34 gl_ClipDistance: direct index for structure (in 3-element array of float ClipDistance) +0:34 direct index (temp block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) +0:34 'gl_in' (in 32-element array of block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) 0:34 Constant: 0:34 1 (const int) 0:34 Constant: @@ -1529,7 +1534,7 @@ ERROR: node is still EOpNull! 0:68 Sequence 0:68 move second child to first child (temp 3-component vector of float) 0:68 'bv3' (global 3-component vector of float) -0:68 Construct vec3 (global 3-component vector of float) +0:68 Construct vec3 (temp 3-component vector of float) 0:68 'vc1' (global float) 0:68 'vc2' (global float) 0:68 'vc3' (global float) diff --git a/Test/baseResults/300.frag.out b/Test/baseResults/300.frag.out index eb752b4d..a0c2615d 100644 --- a/Test/baseResults/300.frag.out +++ b/Test/baseResults/300.frag.out @@ -147,44 +147,44 @@ ERROR: node is still EOpNull! 0:69 'c2D' (smooth in lowp 2-component vector of float) 0:72 move second child to first child (temp mediump 4-component vector of int) 0:72 'iv' (temp mediump 4-component vector of int) -0:72 texture (global mediump 4-component vector of int) +0:72 texture (global lowp 4-component vector of int) 0:72 'is2D' (uniform lowp isampler2D) 0:72 'c2D' (smooth in lowp 2-component vector of float) 0:73 move second child to first child (temp mediump 4-component vector of int) 0:73 'iv' (temp mediump 4-component vector of int) -0:73 textureProjOffset (global mediump 4-component vector of int) +0:73 textureProjOffset (global lowp 4-component vector of int) 0:73 'is2D' (uniform lowp isampler2D) 0:73 'c4D' (smooth temp lowp 4-component vector of float) 0:73 'ic2D' (flat in mediump 2-component vector of int) 0:74 move second child to first child (temp mediump 4-component vector of int) 0:74 'iv' (temp mediump 4-component vector of int) -0:74 textureProjLod (global mediump 4-component vector of int) +0:74 textureProjLod (global lowp 4-component vector of int) 0:74 'is2D' (uniform lowp isampler2D) 0:74 'c3D' (smooth in lowp 3-component vector of float) 0:74 'c1D' (smooth in lowp float) 0:75 move second child to first child (temp mediump 4-component vector of int) 0:75 'iv' (temp mediump 4-component vector of int) -0:75 textureProjGrad (global mediump 4-component vector of int) +0:75 textureProjGrad (global lowp 4-component vector of int) 0:75 'is2D' (uniform lowp isampler2D) 0:75 'c3D' (smooth in lowp 3-component vector of float) 0:75 'c2D' (smooth in lowp 2-component vector of float) 0:75 'c2D' (smooth in lowp 2-component vector of float) 0:76 move second child to first child (temp mediump 4-component vector of int) 0:76 'iv' (temp mediump 4-component vector of int) -0:76 texture (global mediump 4-component vector of int) +0:76 texture (global lowp 4-component vector of int) 0:76 'is3D' (uniform lowp isampler3D) 0:76 'c3D' (smooth in lowp 3-component vector of float) 0:76 Constant: 0:76 4.200000 0:77 move second child to first child (temp mediump 4-component vector of int) 0:77 'iv' (temp mediump 4-component vector of int) -0:77 textureLod (global mediump 4-component vector of int) +0:77 textureLod (global lowp 4-component vector of int) 0:77 'isCube' (uniform lowp isamplerCube) 0:77 'c3D' (smooth in lowp 3-component vector of float) 0:77 'c1D' (smooth in lowp float) 0:78 move second child to first child (temp mediump 4-component vector of int) 0:78 'iv' (temp mediump 4-component vector of int) -0:78 textureFetch (global mediump 4-component vector of int) +0:78 textureFetch (global lowp 4-component vector of int) 0:78 'is2DArray' (uniform lowp isampler2DArray) 0:78 'ic3D' (flat in mediump 3-component vector of int) 0:78 'ic1D' (flat in mediump int) @@ -503,44 +503,44 @@ ERROR: node is still EOpNull! 0:69 'c2D' (smooth in lowp 2-component vector of float) 0:72 move second child to first child (temp mediump 4-component vector of int) 0:72 'iv' (temp mediump 4-component vector of int) -0:72 texture (global mediump 4-component vector of int) +0:72 texture (global lowp 4-component vector of int) 0:72 'is2D' (uniform lowp isampler2D) 0:72 'c2D' (smooth in lowp 2-component vector of float) 0:73 move second child to first child (temp mediump 4-component vector of int) 0:73 'iv' (temp mediump 4-component vector of int) -0:73 textureProjOffset (global mediump 4-component vector of int) +0:73 textureProjOffset (global lowp 4-component vector of int) 0:73 'is2D' (uniform lowp isampler2D) 0:73 'c4D' (smooth temp lowp 4-component vector of float) 0:73 'ic2D' (flat in mediump 2-component vector of int) 0:74 move second child to first child (temp mediump 4-component vector of int) 0:74 'iv' (temp mediump 4-component vector of int) -0:74 textureProjLod (global mediump 4-component vector of int) +0:74 textureProjLod (global lowp 4-component vector of int) 0:74 'is2D' (uniform lowp isampler2D) 0:74 'c3D' (smooth in lowp 3-component vector of float) 0:74 'c1D' (smooth in lowp float) 0:75 move second child to first child (temp mediump 4-component vector of int) 0:75 'iv' (temp mediump 4-component vector of int) -0:75 textureProjGrad (global mediump 4-component vector of int) +0:75 textureProjGrad (global lowp 4-component vector of int) 0:75 'is2D' (uniform lowp isampler2D) 0:75 'c3D' (smooth in lowp 3-component vector of float) 0:75 'c2D' (smooth in lowp 2-component vector of float) 0:75 'c2D' (smooth in lowp 2-component vector of float) 0:76 move second child to first child (temp mediump 4-component vector of int) 0:76 'iv' (temp mediump 4-component vector of int) -0:76 texture (global mediump 4-component vector of int) +0:76 texture (global lowp 4-component vector of int) 0:76 'is3D' (uniform lowp isampler3D) 0:76 'c3D' (smooth in lowp 3-component vector of float) 0:76 Constant: 0:76 4.200000 0:77 move second child to first child (temp mediump 4-component vector of int) 0:77 'iv' (temp mediump 4-component vector of int) -0:77 textureLod (global mediump 4-component vector of int) +0:77 textureLod (global lowp 4-component vector of int) 0:77 'isCube' (uniform lowp isamplerCube) 0:77 'c3D' (smooth in lowp 3-component vector of float) 0:77 'c1D' (smooth in lowp float) 0:78 move second child to first child (temp mediump 4-component vector of int) 0:78 'iv' (temp mediump 4-component vector of int) -0:78 textureFetch (global mediump 4-component vector of int) +0:78 textureFetch (global lowp 4-component vector of int) 0:78 'is2DArray' (uniform lowp isampler2DArray) 0:78 'ic3D' (flat in mediump 3-component vector of int) 0:78 'ic1D' (flat in mediump int) diff --git a/Test/baseResults/300.vert.out b/Test/baseResults/300.vert.out index 122b2569..80745abe 100644 --- a/Test/baseResults/300.vert.out +++ b/Test/baseResults/300.vert.out @@ -3,7 +3,7 @@ ERROR: 0:8: 'varying' : Reserved word. ERROR: 0:8: 'varying' : no longer supported in es profile; removed in version 300 ERROR: 0:9: 'vertex input arrays' : not supported with this profile: es ERROR: 0:10: '' : precision qualifier must appear as last qualifier -ERROR: 0:11: '' : invariant qualifier must appear first +ERROR: 0:11: '' : invariant qualifier must appear before interpolation, storage, and precision qualifiers ERROR: 0:12: '' : Auxiliary qualifiers (centroid, patch, and sample) must appear before storage and precision qualifiers ERROR: 0:12: '' : vertex input cannot be further qualified ERROR: 0:13: '' : interpolation qualifiers must appear before storage and precision qualifiers @@ -193,7 +193,7 @@ ERROR: node is still EOpNull! 0:124 Sequence 0:124 move second child to first child (temp highp 4-component vector of float) 0:124 'x4' (temp highp 4-component vector of float) -0:124 texture (global highp 4-component vector of float) +0:124 texture (global lowp 4-component vector of float) 0:124 's2D' (uniform lowp sampler2D) 0:124 'c2D' (in highp 2-component vector of float) 0:125 Constant: @@ -201,7 +201,7 @@ ERROR: node is still EOpNull! 0:126 Sequence 0:126 move second child to first child (temp highp 4-component vector of float) 0:126 'x5' (temp highp 4-component vector of float) -0:126 textureProjOffset (global highp 4-component vector of float) +0:126 textureProjOffset (global lowp 4-component vector of float) 0:126 's3D' (uniform lowp sampler3D) 0:126 Constant: 0:126 0.200000 @@ -217,7 +217,7 @@ ERROR: node is still EOpNull! 0:128 Sequence 0:128 move second child to first child (temp highp float) 0:128 'x6' (temp highp float) -0:128 textureProjGradOffset (global highp float) +0:128 textureProjGradOffset (global lowp float) 0:128 's2DS' (uniform lowp sampler2DShadow) 0:128 'invIn' (invariant in highp 4-component vector of float) 0:128 Constant: @@ -477,7 +477,7 @@ ERROR: node is still EOpNull! 0:124 Sequence 0:124 move second child to first child (temp highp 4-component vector of float) 0:124 'x4' (temp highp 4-component vector of float) -0:124 texture (global highp 4-component vector of float) +0:124 texture (global lowp 4-component vector of float) 0:124 's2D' (uniform lowp sampler2D) 0:124 'c2D' (in highp 2-component vector of float) 0:125 Constant: @@ -485,7 +485,7 @@ ERROR: node is still EOpNull! 0:126 Sequence 0:126 move second child to first child (temp highp 4-component vector of float) 0:126 'x5' (temp highp 4-component vector of float) -0:126 textureProjOffset (global highp 4-component vector of float) +0:126 textureProjOffset (global lowp 4-component vector of float) 0:126 's3D' (uniform lowp sampler3D) 0:126 Constant: 0:126 0.200000 @@ -501,7 +501,7 @@ ERROR: node is still EOpNull! 0:128 Sequence 0:128 move second child to first child (temp highp float) 0:128 'x6' (temp highp float) -0:128 textureProjGradOffset (global highp float) +0:128 textureProjGradOffset (global lowp float) 0:128 's2DS' (uniform lowp sampler2DShadow) 0:128 'invIn' (invariant in highp 4-component vector of float) 0:128 Constant: diff --git a/Test/baseResults/300block.frag.out b/Test/baseResults/300block.frag.out index ede34c31..224bd111 100644 --- a/Test/baseResults/300block.frag.out +++ b/Test/baseResults/300block.frag.out @@ -24,18 +24,18 @@ ERROR: node is still EOpNull! 0:42 Function Definition: main( (global void) 0:42 Function Parameters: 0:44 Sequence -0:44 texture (global mediump 4-component vector of int) +0:44 texture (global lowp 4-component vector of int) 0:44 sampler: direct index for structure (global lowp isampler3D) 0:44 's' (uniform structure{global mediump 4-component vector of float u, global mediump 4-component vector of uint v, global lowp isampler3D sampler, global mediump 3-component vector of float w, global structure{global mediump int a} t}) 0:44 Constant: 0:44 2 (const int) -0:44 Construct vec3 (temp mediump 3-component vector of float) -0:44 Convert int to float (temp mediump float) +0:44 Construct vec3 (temp lowp 3-component vector of float) +0:44 Convert int to float (temp lowp float) 0:44 ni: direct index for structure (layout(column_major shared ) uniform mediump int) 0:44 'inst' (layout(column_major shared ) uniform block{layout(column_major shared ) uniform mediump 4-component vector of uint nbv, layout(column_major shared ) uniform mediump int ni}) 0:44 Constant: 0:44 1 (const int) -0:44 Convert uint to float (temp mediump float) +0:44 Convert uint to float (temp lowp float) 0:44 direct index (temp mediump uint) 0:44 bv: direct index for structure (layout(column_major shared ) uniform mediump 4-component vector of uint) 0:44 'anon@0' (layout(column_major shared ) uniform block{layout(column_major shared ) uniform mediump 4-component vector of uint bv, layout(column_major shared ) uniform mediump 2X2 matrix of float bm2, layout(column_major shared ) uniform lowp isampler2D sampler, layout(column_major shared ) uniform structure{global mediump int a} t, layout(column_major shared ) uniform structure{global mediump 4-component vector of float u, global mediump 4-component vector of uint v, global lowp isampler3D sampler, global mediump 3-component vector of float w, global structure{global mediump int a} t} fbs}) @@ -43,7 +43,7 @@ ERROR: node is still EOpNull! 0:44 0 (const uint) 0:44 Constant: 0:44 1 (const int) -0:44 Convert uint to float (temp mediump float) +0:44 Convert uint to float (temp lowp float) 0:44 direct index (temp mediump uint) 0:44 nbv: direct index for structure (layout(column_major shared ) uniform mediump 4-component vector of uint) 0:44 direct index (layout(column_major shared ) temp block{layout(column_major shared ) uniform mediump 4-component vector of uint nbv, layout(column_major shared ) uniform mediump int ni}) @@ -92,18 +92,18 @@ ERROR: node is still EOpNull! 0:42 Function Definition: main( (global void) 0:42 Function Parameters: 0:44 Sequence -0:44 texture (global mediump 4-component vector of int) +0:44 texture (global lowp 4-component vector of int) 0:44 sampler: direct index for structure (global lowp isampler3D) 0:44 's' (uniform structure{global mediump 4-component vector of float u, global mediump 4-component vector of uint v, global lowp isampler3D sampler, global mediump 3-component vector of float w, global structure{global mediump int a} t}) 0:44 Constant: 0:44 2 (const int) -0:44 Construct vec3 (temp mediump 3-component vector of float) -0:44 Convert int to float (temp mediump float) +0:44 Construct vec3 (temp lowp 3-component vector of float) +0:44 Convert int to float (temp lowp float) 0:44 ni: direct index for structure (layout(column_major shared ) uniform mediump int) 0:44 'inst' (layout(column_major shared ) uniform block{layout(column_major shared ) uniform mediump 4-component vector of uint nbv, layout(column_major shared ) uniform mediump int ni}) 0:44 Constant: 0:44 1 (const int) -0:44 Convert uint to float (temp mediump float) +0:44 Convert uint to float (temp lowp float) 0:44 direct index (temp mediump uint) 0:44 bv: direct index for structure (layout(column_major shared ) uniform mediump 4-component vector of uint) 0:44 'anon@0' (layout(column_major shared ) uniform block{layout(column_major shared ) uniform mediump 4-component vector of uint bv, layout(column_major shared ) uniform mediump 2X2 matrix of float bm2, layout(column_major shared ) uniform lowp isampler2D sampler, layout(column_major shared ) uniform structure{global mediump int a} t, layout(column_major shared ) uniform structure{global mediump 4-component vector of float u, global mediump 4-component vector of uint v, global lowp isampler3D sampler, global mediump 3-component vector of float w, global structure{global mediump int a} t} fbs}) @@ -111,7 +111,7 @@ ERROR: node is still EOpNull! 0:44 0 (const uint) 0:44 Constant: 0:44 1 (const int) -0:44 Convert uint to float (temp mediump float) +0:44 Convert uint to float (temp lowp float) 0:44 direct index (temp mediump uint) 0:44 nbv: direct index for structure (layout(column_major shared ) uniform mediump 4-component vector of uint) 0:44 direct index (layout(column_major shared ) temp block{layout(column_major shared ) uniform mediump 4-component vector of uint nbv, layout(column_major shared ) uniform mediump int ni}) diff --git a/Test/baseResults/300scope.vert.out b/Test/baseResults/300scope.vert.out index acc93f5a..2a9a945d 100644 --- a/Test/baseResults/300scope.vert.out +++ b/Test/baseResults/300scope.vert.out @@ -5,8 +5,10 @@ ERROR: 0:20: 'c' : redefinition ERROR: 0:22: 'f' : redefinition ERROR: 0:23: 'tan' : redefinition ERROR: 0:24: 'redefinition of built-in function' : not supported with this profile: es +ERROR: 0:24: 'highp' : overloaded functions must have the same parameter precision qualifiers for argument 1 ERROR: 0:24: 'sin' : function name is redeclaration of existing name ERROR: 0:25: 'redefinition of built-in function' : not supported with this profile: es +ERROR: 0:25: 'highp' : overloaded functions must have the same parameter precision qualifiers for argument 1 ERROR: 0:25: 'cos' : function name is redeclaration of existing name ERROR: 0:25: 'cos' : function already has a body ERROR: 0:27: 'return' : void function cannot return a value @@ -18,7 +20,7 @@ ERROR: 0:43: 'sin' : can't use function syntax on variable ERROR: 0:57: 'z' : undeclared identifier ERROR: 0:57: 'z' : redefinition ERROR: 0:73: 'degrees' : can't use function syntax on variable -ERROR: 19 compilation errors. No code generated. +ERROR: 21 compilation errors. No code generated. Shader version: 300 diff --git a/Test/baseResults/310.comp.out b/Test/baseResults/310.comp.out index d6b03322..67129d1d 100644 --- a/Test/baseResults/310.comp.out +++ b/Test/baseResults/310.comp.out @@ -45,6 +45,7 @@ ERROR: 0:143: 'binding' : atomic_uint binding is too large; see gl_MaxAtomicCoun ERROR: 0:149: '[]' : scalar integer expression required ERROR: 0:166: 'precision' : can only apply highp to atomic_uint ERROR: 0:168: 'precise' : Reserved word. +ERROR: 0:168: 'precise' : not supported for this version or the enabled extensions ERROR: 0:170: 'dmat2x4' : Reserved word. ERROR: 0:170: 'double matrix' : not supported with this profile: es ERROR: 0:171: 'samplerCubeArray' : Reserved word. @@ -78,7 +79,7 @@ ERROR: 0:227: 'input block' : not supported in this stage: compute ERROR: 0:231: 'output block' : not supported in this stage: compute WARNING: 0:235: 't__' : identifiers containing consecutive underscores ("__") are reserved WARNING: 0:238: '#define' : names containing consecutive underscores are reserved: __D -ERROR: 76 compilation errors. No code generated. +ERROR: 77 compilation errors. No code generated. Shader version: 310 @@ -484,7 +485,7 @@ ERROR: node is still EOpNull! 0:? 'i' (uniform highp int) 0:? 'atomi' (shared highp int) 0:? 'atomu' (shared highp uint) -0:? 'pfoo' (temp highp int) +0:? 'pfoo' (noContraction temp highp int) 0:? 'dm' (global 2X4 matrix of double) 0:? 'sca' (uniform mediump samplerCubeArray) 0:? 'i2dr' (uniform mediump iimage2DRect) @@ -911,7 +912,7 @@ ERROR: node is still EOpNull! 0:? 'i' (uniform highp int) 0:? 'atomi' (shared highp int) 0:? 'atomu' (shared highp uint) -0:? 'pfoo' (temp highp int) +0:? 'pfoo' (noContraction temp highp int) 0:? 'dm' (global 2X4 matrix of double) 0:? 'sca' (uniform mediump samplerCubeArray) 0:? 'i2dr' (uniform mediump iimage2DRect) diff --git a/Test/baseResults/310.frag.out b/Test/baseResults/310.frag.out index f1dc4d04..0d2ad8d0 100644 --- a/Test/baseResults/310.frag.out +++ b/Test/baseResults/310.frag.out @@ -61,6 +61,7 @@ ERROR: 0:183: 'gl_PrimitiveID' : required extension not requested: Possible exte GL_EXT_geometry_shader GL_OES_geometry_shader ERROR: 0:209: 'precise' : Reserved word. +ERROR: 0:209: 'precise' : not supported for this version or the enabled extensions ERROR: 0:210: 'fma' : required extension not requested: Possible extensions include: GL_EXT_gpu_shader5 GL_OES_gpu_shader5 @@ -129,7 +130,7 @@ ERROR: 0:427: 'blend equation' : can only apply to a standalone qualifier ERROR: 0:428: 'blend equation' : can only apply to a standalone qualifier ERROR: 0:429: 'blend_support' : unknown blend equation ERROR: 0:431: 'fragment-shader array-of-array output' : not supported with this profile: es -ERROR: 121 compilation errors. No code generated. +ERROR: 122 compilation errors. No code generated. Shader version: 310 @@ -169,9 +170,9 @@ ERROR: node is still EOpNull! 0:28 0 (const int) 0:28 'c2D' (smooth in mediump 2-component vector of float) 0:29 Sequence -0:29 move second child to first child (temp mediump 4-component vector of int) +0:29 move second child to first child (temp highp 4-component vector of int) 0:29 'iv4' (temp mediump 4-component vector of int) -0:29 textureGatherOffset (global mediump 4-component vector of int) +0:29 textureGatherOffset (global highp 4-component vector of int) 0:29 'isamp2DA' (uniform highp isampler2DArray) 0:29 Constant: 0:29 0.100000 @@ -182,9 +183,9 @@ ERROR: node is still EOpNull! 0:29 1 (const int) 0:29 Constant: 0:29 3 (const int) -0:30 move second child to first child (temp mediump 4-component vector of int) +0:30 move second child to first child (temp highp 4-component vector of int) 0:30 'iv4' (temp mediump 4-component vector of int) -0:30 textureGatherOffset (global mediump 4-component vector of int) +0:30 textureGatherOffset (global highp 4-component vector of int) 0:30 'isamp2DA' (uniform highp isampler2DArray) 0:30 Constant: 0:30 0.100000 @@ -194,9 +195,9 @@ ERROR: node is still EOpNull! 0:30 1 (const int) 0:30 1 (const int) 0:30 'i' (uniform mediump int) -0:31 move second child to first child (temp mediump 4-component vector of int) +0:31 move second child to first child (temp highp 4-component vector of int) 0:31 'iv4' (temp mediump 4-component vector of int) -0:31 textureGatherOffset (global mediump 4-component vector of int) +0:31 textureGatherOffset (global highp 4-component vector of int) 0:31 'isamp2DA' (uniform highp isampler2DArray) 0:31 Constant: 0:31 0.100000 @@ -207,9 +208,9 @@ ERROR: node is still EOpNull! 0:31 1 (const int) 0:31 Constant: 0:31 4 (const int) -0:32 move second child to first child (temp mediump 4-component vector of int) +0:32 move second child to first child (temp highp 4-component vector of int) 0:32 'iv4' (temp mediump 4-component vector of int) -0:32 textureGatherOffset (global mediump 4-component vector of int) +0:32 textureGatherOffset (global highp 4-component vector of int) 0:32 'isamp2DA' (uniform highp isampler2DArray) 0:32 Constant: 0:32 0.100000 @@ -220,9 +221,9 @@ ERROR: node is still EOpNull! 0:32 1 (const int) 0:32 Constant: 0:32 3 (const int) -0:33 move second child to first child (temp mediump 4-component vector of int) +0:33 move second child to first child (temp highp 4-component vector of int) 0:33 'iv4' (temp mediump 4-component vector of int) -0:33 textureGatherOffset (global mediump 4-component vector of int) +0:33 textureGatherOffset (global highp 4-component vector of int) 0:33 'isamp2DA' (uniform highp isampler2DArray) 0:33 Constant: 0:33 0.100000 @@ -231,20 +232,20 @@ ERROR: node is still EOpNull! 0:33 Constant: 0:33 0 (const int) 0:33 0 (const int) -0:34 move second child to first child (temp mediump 4-component vector of int) +0:34 move second child to first child (temp highp 4-component vector of int) 0:34 'iv4' (temp mediump 4-component vector of int) -0:34 textureGatherOffset (global mediump 4-component vector of int) +0:34 textureGatherOffset (global highp 4-component vector of int) 0:34 'isamp2DA' (uniform highp isampler2DArray) 0:34 Constant: 0:34 0.100000 0:34 0.100000 0:34 0.100000 -0:34 Construct ivec2 (temp mediump 2-component vector of int) +0:34 Construct ivec2 (temp highp 2-component vector of int) 0:34 'i' (uniform mediump int) 0:38 Function Definition: foo23( (global void) 0:38 Function Parameters: 0:? Sequence -0:42 textureProjGradOffset (global mediump 4-component vector of uint) +0:42 textureProjGradOffset (global highp 4-component vector of uint) 0:42 'usamp2d' (uniform highp usampler2D) 0:42 'outp' (out mediump 4-component vector of float) 0:42 Constant: @@ -253,9 +254,9 @@ ERROR: node is still EOpNull! 0:42 Constant: 0:42 0.000000 0:42 0.000000 -0:42 Convert float to int (temp mediump 2-component vector of int) +0:42 Convert float to int (temp highp 2-component vector of int) 0:42 'c2D' (smooth in mediump 2-component vector of float) -0:43 textureProjGradOffset (global mediump 4-component vector of uint) +0:43 textureProjGradOffset (global highp 4-component vector of uint) 0:43 'usamp2d' (uniform highp usampler2D) 0:43 'outp' (out mediump 4-component vector of float) 0:43 Constant: @@ -267,7 +268,7 @@ ERROR: node is still EOpNull! 0:43 Constant: 0:43 3 (const int) 0:43 4 (const int) -0:44 textureProjGradOffset (global mediump 4-component vector of uint) +0:44 textureProjGradOffset (global highp 4-component vector of uint) 0:44 'usamp2d' (uniform highp usampler2D) 0:44 'outp' (out mediump 4-component vector of float) 0:44 Constant: @@ -279,7 +280,7 @@ ERROR: node is still EOpNull! 0:44 Constant: 0:44 15 (const int) 0:44 16 (const int) -0:45 textureProjGradOffset (global mediump 4-component vector of uint) +0:45 textureProjGradOffset (global highp 4-component vector of uint) 0:45 'usamp2d' (uniform highp usampler2D) 0:45 'outp' (out mediump 4-component vector of float) 0:45 Constant: @@ -431,11 +432,11 @@ ERROR: node is still EOpNull! 0:207 Function Parameters: 0:? Sequence 0:210 move second child to first child (temp mediump 2-component vector of float) -0:210 'h' (temp mediump 2-component vector of float) +0:210 'h' (noContraction temp mediump 2-component vector of float) 0:210 fma (global mediump 2-component vector of float) 0:210 'inf' (smooth in mediump 2-component vector of float) 0:210 'ing' (smooth in mediump 2-component vector of float) -0:210 'h' (temp mediump 2-component vector of float) +0:210 'h' (noContraction temp mediump 2-component vector of float) 0:211 textureGatherOffset (global highp 4-component vector of float) 0:211 direct index (temp highp sampler2D) 0:211 'sArray' (uniform 4-element array of highp sampler2D) @@ -467,11 +468,11 @@ ERROR: node is still EOpNull! 0:217 Function Parameters: 0:? Sequence 0:220 move second child to first child (temp mediump 2-component vector of float) -0:220 'h' (temp mediump 2-component vector of float) +0:220 'h' (noContraction temp mediump 2-component vector of float) 0:220 fma (global mediump 2-component vector of float) 0:220 'inf' (smooth in mediump 2-component vector of float) 0:220 'ing' (smooth in mediump 2-component vector of float) -0:220 'h' (temp mediump 2-component vector of float) +0:220 'h' (noContraction temp mediump 2-component vector of float) 0:221 textureGatherOffset (global highp 4-component vector of float) 0:221 direct index (temp highp sampler2D) 0:221 'sArray' (uniform 4-element array of highp sampler2D) @@ -526,7 +527,7 @@ ERROR: node is still EOpNull! 0:251 Sequence 0:251 move second child to first child (temp highp 4-component vector of int) 0:251 'b6' (temp highp 4-component vector of int) -0:251 texture (global mediump 4-component vector of int) +0:251 texture (global highp 4-component vector of int) 0:251 'CA6' (uniform highp isamplerCubeArray) 0:251 Constant: 0:251 0.500000 @@ -538,7 +539,7 @@ ERROR: node is still EOpNull! 0:252 Sequence 0:252 move second child to first child (temp highp 4-component vector of uint) 0:252 'b7' (temp highp 4-component vector of uint) -0:252 texture (global mediump 4-component vector of uint) +0:252 texture (global highp 4-component vector of uint) 0:252 'CA7' (uniform highp usamplerCubeArray) 0:252 Constant: 0:252 0.500000 @@ -611,59 +612,59 @@ ERROR: node is still EOpNull! 0:283 Function Definition: badImageAtom( (global void) 0:283 Function Parameters: 0:? Sequence -0:289 imageAtomicAdd (global mediump int) +0:289 imageAtomicAdd (global highp int) 0:289 'im2Di' (layout(r32i ) uniform highp iimage2D) 0:289 'P' (uniform mediump 2-component vector of int) 0:289 'dati' (temp mediump int) -0:290 imageAtomicAdd (global mediump uint) +0:290 imageAtomicAdd (global highp uint) 0:290 'im2Du' (layout(r32ui ) uniform highp uimage2D) 0:290 'P' (uniform mediump 2-component vector of int) 0:290 'datu' (temp mediump uint) -0:291 imageAtomicMin (global mediump int) +0:291 imageAtomicMin (global highp int) 0:291 'im2Di' (layout(r32i ) uniform highp iimage2D) 0:291 'P' (uniform mediump 2-component vector of int) 0:291 'dati' (temp mediump int) -0:292 imageAtomicMin (global mediump uint) +0:292 imageAtomicMin (global highp uint) 0:292 'im2Du' (layout(r32ui ) uniform highp uimage2D) 0:292 'P' (uniform mediump 2-component vector of int) 0:292 'datu' (temp mediump uint) -0:293 imageAtomicMax (global mediump int) +0:293 imageAtomicMax (global highp int) 0:293 'im2Di' (layout(r32i ) uniform highp iimage2D) 0:293 'P' (uniform mediump 2-component vector of int) 0:293 'dati' (temp mediump int) -0:294 imageAtomicMax (global mediump uint) +0:294 imageAtomicMax (global highp uint) 0:294 'im2Du' (layout(r32ui ) uniform highp uimage2D) 0:294 'P' (uniform mediump 2-component vector of int) 0:294 'datu' (temp mediump uint) -0:295 imageAtomicAnd (global mediump int) +0:295 imageAtomicAnd (global highp int) 0:295 'im2Di' (layout(r32i ) uniform highp iimage2D) 0:295 'P' (uniform mediump 2-component vector of int) 0:295 'dati' (temp mediump int) -0:296 imageAtomicAnd (global mediump uint) +0:296 imageAtomicAnd (global highp uint) 0:296 'im2Du' (layout(r32ui ) uniform highp uimage2D) 0:296 'P' (uniform mediump 2-component vector of int) 0:296 'datu' (temp mediump uint) -0:297 imageAtomicOr (global mediump int) +0:297 imageAtomicOr (global highp int) 0:297 'im2Di' (layout(r32i ) uniform highp iimage2D) 0:297 'P' (uniform mediump 2-component vector of int) 0:297 'dati' (temp mediump int) -0:298 imageAtomicOr (global mediump uint) +0:298 imageAtomicOr (global highp uint) 0:298 'im2Du' (layout(r32ui ) uniform highp uimage2D) 0:298 'P' (uniform mediump 2-component vector of int) 0:298 'datu' (temp mediump uint) -0:299 imageAtomicXor (global mediump int) +0:299 imageAtomicXor (global highp int) 0:299 'im2Di' (layout(r32i ) uniform highp iimage2D) 0:299 'P' (uniform mediump 2-component vector of int) 0:299 'dati' (temp mediump int) -0:300 imageAtomicXor (global mediump uint) +0:300 imageAtomicXor (global highp uint) 0:300 'im2Du' (layout(r32ui ) uniform highp uimage2D) 0:300 'P' (uniform mediump 2-component vector of int) 0:300 'datu' (temp mediump uint) -0:301 imageAtomicExchange (global mediump int) +0:301 imageAtomicExchange (global highp int) 0:301 'im2Di' (layout(r32i ) uniform highp iimage2D) 0:301 'P' (uniform mediump 2-component vector of int) 0:301 'dati' (temp mediump int) -0:302 imageAtomicExchange (global mediump uint) +0:302 imageAtomicExchange (global highp uint) 0:302 'im2Du' (layout(r32ui ) uniform highp uimage2D) 0:302 'P' (uniform mediump 2-component vector of int) 0:302 'datu' (temp mediump uint) @@ -671,13 +672,13 @@ ERROR: node is still EOpNull! 0:303 'im2Df' (layout(r32f ) uniform highp image2D) 0:303 'P' (uniform mediump 2-component vector of int) 0:303 'datf' (temp mediump float) -0:304 imageAtomicCompSwap (global mediump int) +0:304 imageAtomicCompSwap (global highp int) 0:304 'im2Di' (layout(r32i ) uniform highp iimage2D) 0:304 'P' (uniform mediump 2-component vector of int) 0:304 Constant: 0:304 3 (const int) 0:304 'dati' (temp mediump int) -0:305 imageAtomicCompSwap (global mediump uint) +0:305 imageAtomicCompSwap (global highp uint) 0:305 'im2Du' (layout(r32ui ) uniform highp uimage2D) 0:305 'P' (uniform mediump 2-component vector of int) 0:305 Constant: @@ -686,59 +687,59 @@ ERROR: node is still EOpNull! 0:316 Function Definition: goodImageAtom( (global void) 0:316 Function Parameters: 0:? Sequence -0:322 imageAtomicAdd (global mediump int) +0:322 imageAtomicAdd (global highp int) 0:322 'im2Di' (layout(r32i ) uniform highp iimage2D) 0:322 'P' (uniform mediump 2-component vector of int) 0:322 'dati' (temp mediump int) -0:323 imageAtomicAdd (global mediump uint) +0:323 imageAtomicAdd (global highp uint) 0:323 'im2Du' (layout(r32ui ) uniform highp uimage2D) 0:323 'P' (uniform mediump 2-component vector of int) 0:323 'datu' (temp mediump uint) -0:324 imageAtomicMin (global mediump int) +0:324 imageAtomicMin (global highp int) 0:324 'im2Di' (layout(r32i ) uniform highp iimage2D) 0:324 'P' (uniform mediump 2-component vector of int) 0:324 'dati' (temp mediump int) -0:325 imageAtomicMin (global mediump uint) +0:325 imageAtomicMin (global highp uint) 0:325 'im2Du' (layout(r32ui ) uniform highp uimage2D) 0:325 'P' (uniform mediump 2-component vector of int) 0:325 'datu' (temp mediump uint) -0:326 imageAtomicMax (global mediump int) +0:326 imageAtomicMax (global highp int) 0:326 'im2Di' (layout(r32i ) uniform highp iimage2D) 0:326 'P' (uniform mediump 2-component vector of int) 0:326 'dati' (temp mediump int) -0:327 imageAtomicMax (global mediump uint) +0:327 imageAtomicMax (global highp uint) 0:327 'im2Du' (layout(r32ui ) uniform highp uimage2D) 0:327 'P' (uniform mediump 2-component vector of int) 0:327 'datu' (temp mediump uint) -0:328 imageAtomicAnd (global mediump int) +0:328 imageAtomicAnd (global highp int) 0:328 'im2Di' (layout(r32i ) uniform highp iimage2D) 0:328 'P' (uniform mediump 2-component vector of int) 0:328 'dati' (temp mediump int) -0:329 imageAtomicAnd (global mediump uint) +0:329 imageAtomicAnd (global highp uint) 0:329 'im2Du' (layout(r32ui ) uniform highp uimage2D) 0:329 'P' (uniform mediump 2-component vector of int) 0:329 'datu' (temp mediump uint) -0:330 imageAtomicOr (global mediump int) +0:330 imageAtomicOr (global highp int) 0:330 'im2Di' (layout(r32i ) uniform highp iimage2D) 0:330 'P' (uniform mediump 2-component vector of int) 0:330 'dati' (temp mediump int) -0:331 imageAtomicOr (global mediump uint) +0:331 imageAtomicOr (global highp uint) 0:331 'im2Du' (layout(r32ui ) uniform highp uimage2D) 0:331 'P' (uniform mediump 2-component vector of int) 0:331 'datu' (temp mediump uint) -0:332 imageAtomicXor (global mediump int) +0:332 imageAtomicXor (global highp int) 0:332 'im2Di' (layout(r32i ) uniform highp iimage2D) 0:332 'P' (uniform mediump 2-component vector of int) 0:332 'dati' (temp mediump int) -0:333 imageAtomicXor (global mediump uint) +0:333 imageAtomicXor (global highp uint) 0:333 'im2Du' (layout(r32ui ) uniform highp uimage2D) 0:333 'P' (uniform mediump 2-component vector of int) 0:333 'datu' (temp mediump uint) -0:334 imageAtomicExchange (global mediump int) +0:334 imageAtomicExchange (global highp int) 0:334 'im2Di' (layout(r32i ) uniform highp iimage2D) 0:334 'P' (uniform mediump 2-component vector of int) 0:334 'dati' (temp mediump int) -0:335 imageAtomicExchange (global mediump uint) +0:335 imageAtomicExchange (global highp uint) 0:335 'im2Du' (layout(r32ui ) uniform highp uimage2D) 0:335 'P' (uniform mediump 2-component vector of int) 0:335 'datu' (temp mediump uint) @@ -746,23 +747,23 @@ ERROR: node is still EOpNull! 0:336 'im2Df' (layout(r32f ) uniform highp image2D) 0:336 'P' (uniform mediump 2-component vector of int) 0:336 'datf' (temp mediump float) -0:337 imageAtomicCompSwap (global mediump int) +0:337 imageAtomicCompSwap (global highp int) 0:337 'im2Di' (layout(r32i ) uniform highp iimage2D) 0:337 'P' (uniform mediump 2-component vector of int) 0:337 Constant: 0:337 3 (const int) 0:337 'dati' (temp mediump int) -0:338 imageAtomicCompSwap (global mediump uint) +0:338 imageAtomicCompSwap (global highp uint) 0:338 'im2Du' (layout(r32ui ) uniform highp uimage2D) 0:338 'P' (uniform mediump 2-component vector of int) 0:338 Constant: 0:338 5 (const uint) 0:338 'datu' (temp mediump uint) -0:340 imageAtomicMax (global mediump int) +0:340 imageAtomicMax (global highp int) 0:340 'badIm2Di' (layout(rgba16i ) uniform highp iimage2D) 0:340 'P' (uniform mediump 2-component vector of int) 0:340 'dati' (temp mediump int) -0:341 imageAtomicMax (global mediump uint) +0:341 imageAtomicMax (global highp uint) 0:341 'badIm2Du' (layout(rgba8ui ) uniform highp uimage2D) 0:341 'P' (uniform mediump 2-component vector of int) 0:341 'datu' (temp mediump uint) @@ -1050,9 +1051,9 @@ ERROR: node is still EOpNull! 0:28 0 (const int) 0:28 'c2D' (smooth in mediump 2-component vector of float) 0:29 Sequence -0:29 move second child to first child (temp mediump 4-component vector of int) +0:29 move second child to first child (temp highp 4-component vector of int) 0:29 'iv4' (temp mediump 4-component vector of int) -0:29 textureGatherOffset (global mediump 4-component vector of int) +0:29 textureGatherOffset (global highp 4-component vector of int) 0:29 'isamp2DA' (uniform highp isampler2DArray) 0:29 Constant: 0:29 0.100000 @@ -1063,9 +1064,9 @@ ERROR: node is still EOpNull! 0:29 1 (const int) 0:29 Constant: 0:29 3 (const int) -0:30 move second child to first child (temp mediump 4-component vector of int) +0:30 move second child to first child (temp highp 4-component vector of int) 0:30 'iv4' (temp mediump 4-component vector of int) -0:30 textureGatherOffset (global mediump 4-component vector of int) +0:30 textureGatherOffset (global highp 4-component vector of int) 0:30 'isamp2DA' (uniform highp isampler2DArray) 0:30 Constant: 0:30 0.100000 @@ -1075,9 +1076,9 @@ ERROR: node is still EOpNull! 0:30 1 (const int) 0:30 1 (const int) 0:30 'i' (uniform mediump int) -0:31 move second child to first child (temp mediump 4-component vector of int) +0:31 move second child to first child (temp highp 4-component vector of int) 0:31 'iv4' (temp mediump 4-component vector of int) -0:31 textureGatherOffset (global mediump 4-component vector of int) +0:31 textureGatherOffset (global highp 4-component vector of int) 0:31 'isamp2DA' (uniform highp isampler2DArray) 0:31 Constant: 0:31 0.100000 @@ -1088,9 +1089,9 @@ ERROR: node is still EOpNull! 0:31 1 (const int) 0:31 Constant: 0:31 4 (const int) -0:32 move second child to first child (temp mediump 4-component vector of int) +0:32 move second child to first child (temp highp 4-component vector of int) 0:32 'iv4' (temp mediump 4-component vector of int) -0:32 textureGatherOffset (global mediump 4-component vector of int) +0:32 textureGatherOffset (global highp 4-component vector of int) 0:32 'isamp2DA' (uniform highp isampler2DArray) 0:32 Constant: 0:32 0.100000 @@ -1101,9 +1102,9 @@ ERROR: node is still EOpNull! 0:32 1 (const int) 0:32 Constant: 0:32 3 (const int) -0:33 move second child to first child (temp mediump 4-component vector of int) +0:33 move second child to first child (temp highp 4-component vector of int) 0:33 'iv4' (temp mediump 4-component vector of int) -0:33 textureGatherOffset (global mediump 4-component vector of int) +0:33 textureGatherOffset (global highp 4-component vector of int) 0:33 'isamp2DA' (uniform highp isampler2DArray) 0:33 Constant: 0:33 0.100000 @@ -1112,20 +1113,20 @@ ERROR: node is still EOpNull! 0:33 Constant: 0:33 0 (const int) 0:33 0 (const int) -0:34 move second child to first child (temp mediump 4-component vector of int) +0:34 move second child to first child (temp highp 4-component vector of int) 0:34 'iv4' (temp mediump 4-component vector of int) -0:34 textureGatherOffset (global mediump 4-component vector of int) +0:34 textureGatherOffset (global highp 4-component vector of int) 0:34 'isamp2DA' (uniform highp isampler2DArray) 0:34 Constant: 0:34 0.100000 0:34 0.100000 0:34 0.100000 -0:34 Construct ivec2 (temp mediump 2-component vector of int) +0:34 Construct ivec2 (temp highp 2-component vector of int) 0:34 'i' (uniform mediump int) 0:38 Function Definition: foo23( (global void) 0:38 Function Parameters: 0:? Sequence -0:42 textureProjGradOffset (global mediump 4-component vector of uint) +0:42 textureProjGradOffset (global highp 4-component vector of uint) 0:42 'usamp2d' (uniform highp usampler2D) 0:42 'outp' (out mediump 4-component vector of float) 0:42 Constant: @@ -1134,9 +1135,9 @@ ERROR: node is still EOpNull! 0:42 Constant: 0:42 0.000000 0:42 0.000000 -0:42 Convert float to int (temp mediump 2-component vector of int) +0:42 Convert float to int (temp highp 2-component vector of int) 0:42 'c2D' (smooth in mediump 2-component vector of float) -0:43 textureProjGradOffset (global mediump 4-component vector of uint) +0:43 textureProjGradOffset (global highp 4-component vector of uint) 0:43 'usamp2d' (uniform highp usampler2D) 0:43 'outp' (out mediump 4-component vector of float) 0:43 Constant: @@ -1148,7 +1149,7 @@ ERROR: node is still EOpNull! 0:43 Constant: 0:43 3 (const int) 0:43 4 (const int) -0:44 textureProjGradOffset (global mediump 4-component vector of uint) +0:44 textureProjGradOffset (global highp 4-component vector of uint) 0:44 'usamp2d' (uniform highp usampler2D) 0:44 'outp' (out mediump 4-component vector of float) 0:44 Constant: @@ -1160,7 +1161,7 @@ ERROR: node is still EOpNull! 0:44 Constant: 0:44 15 (const int) 0:44 16 (const int) -0:45 textureProjGradOffset (global mediump 4-component vector of uint) +0:45 textureProjGradOffset (global highp 4-component vector of uint) 0:45 'usamp2d' (uniform highp usampler2D) 0:45 'outp' (out mediump 4-component vector of float) 0:45 Constant: @@ -1312,11 +1313,11 @@ ERROR: node is still EOpNull! 0:207 Function Parameters: 0:? Sequence 0:210 move second child to first child (temp mediump 2-component vector of float) -0:210 'h' (temp mediump 2-component vector of float) +0:210 'h' (noContraction temp mediump 2-component vector of float) 0:210 fma (global mediump 2-component vector of float) 0:210 'inf' (smooth in mediump 2-component vector of float) 0:210 'ing' (smooth in mediump 2-component vector of float) -0:210 'h' (temp mediump 2-component vector of float) +0:210 'h' (noContraction temp mediump 2-component vector of float) 0:211 textureGatherOffset (global highp 4-component vector of float) 0:211 direct index (temp highp sampler2D) 0:211 'sArray' (uniform 4-element array of highp sampler2D) @@ -1348,11 +1349,11 @@ ERROR: node is still EOpNull! 0:217 Function Parameters: 0:? Sequence 0:220 move second child to first child (temp mediump 2-component vector of float) -0:220 'h' (temp mediump 2-component vector of float) +0:220 'h' (noContraction temp mediump 2-component vector of float) 0:220 fma (global mediump 2-component vector of float) 0:220 'inf' (smooth in mediump 2-component vector of float) 0:220 'ing' (smooth in mediump 2-component vector of float) -0:220 'h' (temp mediump 2-component vector of float) +0:220 'h' (noContraction temp mediump 2-component vector of float) 0:221 textureGatherOffset (global highp 4-component vector of float) 0:221 direct index (temp highp sampler2D) 0:221 'sArray' (uniform 4-element array of highp sampler2D) @@ -1407,7 +1408,7 @@ ERROR: node is still EOpNull! 0:251 Sequence 0:251 move second child to first child (temp highp 4-component vector of int) 0:251 'b6' (temp highp 4-component vector of int) -0:251 texture (global mediump 4-component vector of int) +0:251 texture (global highp 4-component vector of int) 0:251 'CA6' (uniform highp isamplerCubeArray) 0:251 Constant: 0:251 0.500000 @@ -1419,7 +1420,7 @@ ERROR: node is still EOpNull! 0:252 Sequence 0:252 move second child to first child (temp highp 4-component vector of uint) 0:252 'b7' (temp highp 4-component vector of uint) -0:252 texture (global mediump 4-component vector of uint) +0:252 texture (global highp 4-component vector of uint) 0:252 'CA7' (uniform highp usamplerCubeArray) 0:252 Constant: 0:252 0.500000 @@ -1492,59 +1493,59 @@ ERROR: node is still EOpNull! 0:283 Function Definition: badImageAtom( (global void) 0:283 Function Parameters: 0:? Sequence -0:289 imageAtomicAdd (global mediump int) +0:289 imageAtomicAdd (global highp int) 0:289 'im2Di' (layout(r32i ) uniform highp iimage2D) 0:289 'P' (uniform mediump 2-component vector of int) 0:289 'dati' (temp mediump int) -0:290 imageAtomicAdd (global mediump uint) +0:290 imageAtomicAdd (global highp uint) 0:290 'im2Du' (layout(r32ui ) uniform highp uimage2D) 0:290 'P' (uniform mediump 2-component vector of int) 0:290 'datu' (temp mediump uint) -0:291 imageAtomicMin (global mediump int) +0:291 imageAtomicMin (global highp int) 0:291 'im2Di' (layout(r32i ) uniform highp iimage2D) 0:291 'P' (uniform mediump 2-component vector of int) 0:291 'dati' (temp mediump int) -0:292 imageAtomicMin (global mediump uint) +0:292 imageAtomicMin (global highp uint) 0:292 'im2Du' (layout(r32ui ) uniform highp uimage2D) 0:292 'P' (uniform mediump 2-component vector of int) 0:292 'datu' (temp mediump uint) -0:293 imageAtomicMax (global mediump int) +0:293 imageAtomicMax (global highp int) 0:293 'im2Di' (layout(r32i ) uniform highp iimage2D) 0:293 'P' (uniform mediump 2-component vector of int) 0:293 'dati' (temp mediump int) -0:294 imageAtomicMax (global mediump uint) +0:294 imageAtomicMax (global highp uint) 0:294 'im2Du' (layout(r32ui ) uniform highp uimage2D) 0:294 'P' (uniform mediump 2-component vector of int) 0:294 'datu' (temp mediump uint) -0:295 imageAtomicAnd (global mediump int) +0:295 imageAtomicAnd (global highp int) 0:295 'im2Di' (layout(r32i ) uniform highp iimage2D) 0:295 'P' (uniform mediump 2-component vector of int) 0:295 'dati' (temp mediump int) -0:296 imageAtomicAnd (global mediump uint) +0:296 imageAtomicAnd (global highp uint) 0:296 'im2Du' (layout(r32ui ) uniform highp uimage2D) 0:296 'P' (uniform mediump 2-component vector of int) 0:296 'datu' (temp mediump uint) -0:297 imageAtomicOr (global mediump int) +0:297 imageAtomicOr (global highp int) 0:297 'im2Di' (layout(r32i ) uniform highp iimage2D) 0:297 'P' (uniform mediump 2-component vector of int) 0:297 'dati' (temp mediump int) -0:298 imageAtomicOr (global mediump uint) +0:298 imageAtomicOr (global highp uint) 0:298 'im2Du' (layout(r32ui ) uniform highp uimage2D) 0:298 'P' (uniform mediump 2-component vector of int) 0:298 'datu' (temp mediump uint) -0:299 imageAtomicXor (global mediump int) +0:299 imageAtomicXor (global highp int) 0:299 'im2Di' (layout(r32i ) uniform highp iimage2D) 0:299 'P' (uniform mediump 2-component vector of int) 0:299 'dati' (temp mediump int) -0:300 imageAtomicXor (global mediump uint) +0:300 imageAtomicXor (global highp uint) 0:300 'im2Du' (layout(r32ui ) uniform highp uimage2D) 0:300 'P' (uniform mediump 2-component vector of int) 0:300 'datu' (temp mediump uint) -0:301 imageAtomicExchange (global mediump int) +0:301 imageAtomicExchange (global highp int) 0:301 'im2Di' (layout(r32i ) uniform highp iimage2D) 0:301 'P' (uniform mediump 2-component vector of int) 0:301 'dati' (temp mediump int) -0:302 imageAtomicExchange (global mediump uint) +0:302 imageAtomicExchange (global highp uint) 0:302 'im2Du' (layout(r32ui ) uniform highp uimage2D) 0:302 'P' (uniform mediump 2-component vector of int) 0:302 'datu' (temp mediump uint) @@ -1552,13 +1553,13 @@ ERROR: node is still EOpNull! 0:303 'im2Df' (layout(r32f ) uniform highp image2D) 0:303 'P' (uniform mediump 2-component vector of int) 0:303 'datf' (temp mediump float) -0:304 imageAtomicCompSwap (global mediump int) +0:304 imageAtomicCompSwap (global highp int) 0:304 'im2Di' (layout(r32i ) uniform highp iimage2D) 0:304 'P' (uniform mediump 2-component vector of int) 0:304 Constant: 0:304 3 (const int) 0:304 'dati' (temp mediump int) -0:305 imageAtomicCompSwap (global mediump uint) +0:305 imageAtomicCompSwap (global highp uint) 0:305 'im2Du' (layout(r32ui ) uniform highp uimage2D) 0:305 'P' (uniform mediump 2-component vector of int) 0:305 Constant: @@ -1567,59 +1568,59 @@ ERROR: node is still EOpNull! 0:316 Function Definition: goodImageAtom( (global void) 0:316 Function Parameters: 0:? Sequence -0:322 imageAtomicAdd (global mediump int) +0:322 imageAtomicAdd (global highp int) 0:322 'im2Di' (layout(r32i ) uniform highp iimage2D) 0:322 'P' (uniform mediump 2-component vector of int) 0:322 'dati' (temp mediump int) -0:323 imageAtomicAdd (global mediump uint) +0:323 imageAtomicAdd (global highp uint) 0:323 'im2Du' (layout(r32ui ) uniform highp uimage2D) 0:323 'P' (uniform mediump 2-component vector of int) 0:323 'datu' (temp mediump uint) -0:324 imageAtomicMin (global mediump int) +0:324 imageAtomicMin (global highp int) 0:324 'im2Di' (layout(r32i ) uniform highp iimage2D) 0:324 'P' (uniform mediump 2-component vector of int) 0:324 'dati' (temp mediump int) -0:325 imageAtomicMin (global mediump uint) +0:325 imageAtomicMin (global highp uint) 0:325 'im2Du' (layout(r32ui ) uniform highp uimage2D) 0:325 'P' (uniform mediump 2-component vector of int) 0:325 'datu' (temp mediump uint) -0:326 imageAtomicMax (global mediump int) +0:326 imageAtomicMax (global highp int) 0:326 'im2Di' (layout(r32i ) uniform highp iimage2D) 0:326 'P' (uniform mediump 2-component vector of int) 0:326 'dati' (temp mediump int) -0:327 imageAtomicMax (global mediump uint) +0:327 imageAtomicMax (global highp uint) 0:327 'im2Du' (layout(r32ui ) uniform highp uimage2D) 0:327 'P' (uniform mediump 2-component vector of int) 0:327 'datu' (temp mediump uint) -0:328 imageAtomicAnd (global mediump int) +0:328 imageAtomicAnd (global highp int) 0:328 'im2Di' (layout(r32i ) uniform highp iimage2D) 0:328 'P' (uniform mediump 2-component vector of int) 0:328 'dati' (temp mediump int) -0:329 imageAtomicAnd (global mediump uint) +0:329 imageAtomicAnd (global highp uint) 0:329 'im2Du' (layout(r32ui ) uniform highp uimage2D) 0:329 'P' (uniform mediump 2-component vector of int) 0:329 'datu' (temp mediump uint) -0:330 imageAtomicOr (global mediump int) +0:330 imageAtomicOr (global highp int) 0:330 'im2Di' (layout(r32i ) uniform highp iimage2D) 0:330 'P' (uniform mediump 2-component vector of int) 0:330 'dati' (temp mediump int) -0:331 imageAtomicOr (global mediump uint) +0:331 imageAtomicOr (global highp uint) 0:331 'im2Du' (layout(r32ui ) uniform highp uimage2D) 0:331 'P' (uniform mediump 2-component vector of int) 0:331 'datu' (temp mediump uint) -0:332 imageAtomicXor (global mediump int) +0:332 imageAtomicXor (global highp int) 0:332 'im2Di' (layout(r32i ) uniform highp iimage2D) 0:332 'P' (uniform mediump 2-component vector of int) 0:332 'dati' (temp mediump int) -0:333 imageAtomicXor (global mediump uint) +0:333 imageAtomicXor (global highp uint) 0:333 'im2Du' (layout(r32ui ) uniform highp uimage2D) 0:333 'P' (uniform mediump 2-component vector of int) 0:333 'datu' (temp mediump uint) -0:334 imageAtomicExchange (global mediump int) +0:334 imageAtomicExchange (global highp int) 0:334 'im2Di' (layout(r32i ) uniform highp iimage2D) 0:334 'P' (uniform mediump 2-component vector of int) 0:334 'dati' (temp mediump int) -0:335 imageAtomicExchange (global mediump uint) +0:335 imageAtomicExchange (global highp uint) 0:335 'im2Du' (layout(r32ui ) uniform highp uimage2D) 0:335 'P' (uniform mediump 2-component vector of int) 0:335 'datu' (temp mediump uint) @@ -1627,23 +1628,23 @@ ERROR: node is still EOpNull! 0:336 'im2Df' (layout(r32f ) uniform highp image2D) 0:336 'P' (uniform mediump 2-component vector of int) 0:336 'datf' (temp mediump float) -0:337 imageAtomicCompSwap (global mediump int) +0:337 imageAtomicCompSwap (global highp int) 0:337 'im2Di' (layout(r32i ) uniform highp iimage2D) 0:337 'P' (uniform mediump 2-component vector of int) 0:337 Constant: 0:337 3 (const int) 0:337 'dati' (temp mediump int) -0:338 imageAtomicCompSwap (global mediump uint) +0:338 imageAtomicCompSwap (global highp uint) 0:338 'im2Du' (layout(r32ui ) uniform highp uimage2D) 0:338 'P' (uniform mediump 2-component vector of int) 0:338 Constant: 0:338 5 (const uint) 0:338 'datu' (temp mediump uint) -0:340 imageAtomicMax (global mediump int) +0:340 imageAtomicMax (global highp int) 0:340 'badIm2Di' (layout(rgba16i ) uniform highp iimage2D) 0:340 'P' (uniform mediump 2-component vector of int) 0:340 'dati' (temp mediump int) -0:341 imageAtomicMax (global mediump uint) +0:341 imageAtomicMax (global highp uint) 0:341 'badIm2Du' (layout(rgba8ui ) uniform highp uimage2D) 0:341 'P' (uniform mediump 2-component vector of int) 0:341 'datu' (temp mediump uint) diff --git a/Test/baseResults/310.tesc.out b/Test/baseResults/310.tesc.out index c572c096..24e3d209 100644 --- a/Test/baseResults/310.tesc.out +++ b/Test/baseResults/310.tesc.out @@ -31,6 +31,7 @@ ERROR: 0:80: '' : array size required ERROR: 0:86: 'location' : overlapping use of location 4 ERROR: 0:90: 'location' : overlapping use of location 4 ERROR: 0:94: 'precise' : Reserved word. +ERROR: 0:94: 'precise' : not supported for this version or the enabled extensions ERROR: 0:95: 'fma' : required extension not requested: Possible extensions include: GL_EXT_gpu_shader5 GL_OES_gpu_shader5 @@ -45,7 +46,7 @@ ERROR: 0:145: '' : array size required ERROR: 0:161: '[]' : tessellation-control per-vertex output l-value must be indexed with gl_InvocationID ERROR: 0:162: '[]' : tessellation-control per-vertex output l-value must be indexed with gl_InvocationID ERROR: 0:165: '[]' : tessellation-control per-vertex output l-value must be indexed with gl_InvocationID -ERROR: 37 compilation errors. No code generated. +ERROR: 38 compilation errors. No code generated. Shader version: 310 @@ -197,11 +198,11 @@ ERROR: node is still EOpNull! 0:92 Function Parameters: 0:? Sequence 0:95 move second child to first child (temp highp float) -0:95 'd' (temp highp float) +0:95 'd' (noContraction temp highp float) 0:95 fma (global highp float) -0:95 'd' (temp highp float) -0:95 'd' (temp highp float) -0:95 'd' (temp highp float) +0:95 'd' (noContraction temp highp float) +0:95 'd' (noContraction temp highp float) +0:95 'd' (noContraction temp highp float) 0:112 Function Definition: pointSize2( (global void) 0:112 Function Parameters: 0:114 Sequence @@ -227,20 +228,20 @@ ERROR: node is still EOpNull! 0:122 Function Parameters: 0:? Sequence 0:126 multiply second child into first child (temp highp 3-component vector of float) -0:126 'pv3' (temp highp 3-component vector of float) -0:126 'pv3' (temp highp 3-component vector of float) +0:126 'pv3' (noContraction temp highp 3-component vector of float) +0:126 'pv3' (noContraction temp highp 3-component vector of float) 0:127 move second child to first child (temp highp 3-component vector of float) -0:127 'pv3' (temp highp 3-component vector of float) +0:127 'pv3' (noContraction temp highp 3-component vector of float) 0:127 fma (global highp 3-component vector of float) -0:127 'pv3' (temp highp 3-component vector of float) -0:127 'pv3' (temp highp 3-component vector of float) -0:127 'pv3' (temp highp 3-component vector of float) +0:127 'pv3' (noContraction temp highp 3-component vector of float) +0:127 'pv3' (noContraction temp highp 3-component vector of float) +0:127 'pv3' (noContraction temp highp 3-component vector of float) 0:128 move second child to first child (temp highp float) -0:128 'd' (temp highp float) +0:128 'd' (noContraction temp highp float) 0:128 fma (global highp float) -0:128 'd' (temp highp float) -0:128 'd' (temp highp float) -0:128 'd' (temp highp float) +0:128 'd' (noContraction temp highp float) +0:128 'd' (noContraction temp highp float) +0:128 'd' (noContraction temp highp float) 0:131 Function Definition: bbBad( (global void) 0:131 Function Parameters: 0:133 Sequence @@ -371,7 +372,7 @@ ERROR: node is still EOpNull! 0:? 'badlay' (out 4-element array of highp float) 0:? 'misSized' (out 5-element array of highp float) 0:? 'okaySize' (out 4-element array of highp float) -0:? 'pv3' (temp highp 3-component vector of float) +0:? 'pv3' (noContraction temp highp 3-component vector of float) 0:? 'badpatchIName' (patch out implicitly-sized array of block{out highp float f}) 0:? 'patchIName' (patch out 4-element array of block{out highp float f}) @@ -528,11 +529,11 @@ ERROR: node is still EOpNull! 0:92 Function Parameters: 0:? Sequence 0:95 move second child to first child (temp highp float) -0:95 'd' (temp highp float) +0:95 'd' (noContraction temp highp float) 0:95 fma (global highp float) -0:95 'd' (temp highp float) -0:95 'd' (temp highp float) -0:95 'd' (temp highp float) +0:95 'd' (noContraction temp highp float) +0:95 'd' (noContraction temp highp float) +0:95 'd' (noContraction temp highp float) 0:112 Function Definition: pointSize2( (global void) 0:112 Function Parameters: 0:114 Sequence @@ -558,20 +559,20 @@ ERROR: node is still EOpNull! 0:122 Function Parameters: 0:? Sequence 0:126 multiply second child into first child (temp highp 3-component vector of float) -0:126 'pv3' (temp highp 3-component vector of float) -0:126 'pv3' (temp highp 3-component vector of float) +0:126 'pv3' (noContraction temp highp 3-component vector of float) +0:126 'pv3' (noContraction temp highp 3-component vector of float) 0:127 move second child to first child (temp highp 3-component vector of float) -0:127 'pv3' (temp highp 3-component vector of float) +0:127 'pv3' (noContraction temp highp 3-component vector of float) 0:127 fma (global highp 3-component vector of float) -0:127 'pv3' (temp highp 3-component vector of float) -0:127 'pv3' (temp highp 3-component vector of float) -0:127 'pv3' (temp highp 3-component vector of float) +0:127 'pv3' (noContraction temp highp 3-component vector of float) +0:127 'pv3' (noContraction temp highp 3-component vector of float) +0:127 'pv3' (noContraction temp highp 3-component vector of float) 0:128 move second child to first child (temp highp float) -0:128 'd' (temp highp float) +0:128 'd' (noContraction temp highp float) 0:128 fma (global highp float) -0:128 'd' (temp highp float) -0:128 'd' (temp highp float) -0:128 'd' (temp highp float) +0:128 'd' (noContraction temp highp float) +0:128 'd' (noContraction temp highp float) +0:128 'd' (noContraction temp highp float) 0:131 Function Definition: bbBad( (global void) 0:131 Function Parameters: 0:133 Sequence @@ -702,7 +703,7 @@ ERROR: node is still EOpNull! 0:? 'badlay' (out 4-element array of highp float) 0:? 'misSized' (out 5-element array of highp float) 0:? 'okaySize' (out 4-element array of highp float) -0:? 'pv3' (temp highp 3-component vector of float) +0:? 'pv3' (noContraction temp highp 3-component vector of float) 0:? 'badpatchIName' (patch out 1-element array of block{out highp float f}) 0:? 'patchIName' (patch out 4-element array of block{out highp float f}) diff --git a/Test/baseResults/310.vert.out b/Test/baseResults/310.vert.out index 73a33c4b..9ce13f44 100644 --- a/Test/baseResults/310.vert.out +++ b/Test/baseResults/310.vert.out @@ -29,6 +29,7 @@ ERROR: 0:131: 'flat/smooth/noperspective' : cannot use interpolation qualifiers ERROR: 0:135: 'centroid' : cannot use centroid qualifier on an interface block ERROR: 0:139: 'invariant' : cannot use invariant qualifier on an interface block ERROR: 0:155: 'precise' : Reserved word. +ERROR: 0:155: 'precise' : not supported for this version or the enabled extensions ERROR: 0:156: 'fma' : required extension not requested: Possible extensions include: GL_EXT_gpu_shader5 GL_OES_gpu_shader5 @@ -96,7 +97,7 @@ ERROR: 0:389: 'sample' : Reserved word. ERROR: 0:400: 'interpolateAtCentroid' : no matching overloaded function found ERROR: 0:401: 'interpolateAtSample' : no matching overloaded function found ERROR: 0:402: 'interpolateAtOffset' : no matching overloaded function found -ERROR: 92 compilation errors. No code generated. +ERROR: 93 compilation errors. No code generated. Shader version: 310 @@ -178,27 +179,27 @@ ERROR: node is still EOpNull! 0:31 'u4' (temp highp 4-component vector of uint) 0:32 move second child to first child (temp highp int) 0:32 'i1' (temp highp int) -0:32 bitCount (global highp int) +0:32 bitCount (global lowp int) 0:32 'i1' (temp highp int) 0:33 move second child to first child (temp highp 3-component vector of int) 0:33 'i3' (temp highp 3-component vector of int) -0:33 bitCount (global highp 3-component vector of int) +0:33 bitCount (global lowp 3-component vector of int) 0:33 'u3' (temp highp 3-component vector of uint) 0:34 move second child to first child (temp highp 2-component vector of int) 0:34 'i2' (temp highp 2-component vector of int) -0:34 findLSB (global highp 2-component vector of int) +0:34 findLSB (global lowp 2-component vector of int) 0:34 'i2' (temp highp 2-component vector of int) 0:35 move second child to first child (temp highp 4-component vector of int) 0:35 'i4' (temp highp 4-component vector of int) -0:35 findLSB (global highp 4-component vector of int) +0:35 findLSB (global lowp 4-component vector of int) 0:35 'u4' (temp highp 4-component vector of uint) 0:36 move second child to first child (temp highp int) 0:36 'i1' (temp highp int) -0:36 findMSB (global highp int) +0:36 findMSB (global lowp int) 0:36 'i1' (temp highp int) 0:37 move second child to first child (temp highp 2-component vector of int) 0:37 'i2' (temp highp 2-component vector of int) -0:37 findMSB (global highp 2-component vector of int) +0:37 findMSB (global lowp 2-component vector of int) 0:37 'u2' (temp highp 2-component vector of uint) 0:40 move second child to first child (temp highp 3-component vector of float) 0:40 'v3' (temp highp 3-component vector of float) @@ -285,11 +286,11 @@ ERROR: node is still EOpNull! 0:153 Function Parameters: 0:? Sequence 0:156 move second child to first child (temp highp 2-component vector of float) -0:156 'h' (temp highp 2-component vector of float) +0:156 'h' (noContraction temp highp 2-component vector of float) 0:156 fma (global highp 2-component vector of float) 0:156 'inf' (in highp 2-component vector of float) 0:156 'ing' (in highp 2-component vector of float) -0:156 'h' (temp highp 2-component vector of float) +0:156 'h' (noContraction temp highp 2-component vector of float) 0:157 indirect index (temp highp sampler2D) 0:157 'sArray' (uniform 4-element array of highp sampler2D) 0:157 add (temp highp int) @@ -360,11 +361,11 @@ ERROR: node is still EOpNull! 0:171 Function Parameters: 0:? Sequence 0:174 move second child to first child (temp highp 2-component vector of float) -0:174 'h' (temp highp 2-component vector of float) +0:174 'h' (noContraction temp highp 2-component vector of float) 0:174 fma (global highp 2-component vector of float) 0:174 'inf' (in highp 2-component vector of float) 0:174 'ing' (in highp 2-component vector of float) -0:174 'h' (temp highp 2-component vector of float) +0:174 'h' (noContraction temp highp 2-component vector of float) 0:175 indirect index (temp highp sampler2D) 0:175 'sArray' (uniform 4-element array of highp sampler2D) 0:175 add (temp highp int) @@ -1109,27 +1110,27 @@ ERROR: node is still EOpNull! 0:31 'u4' (temp highp 4-component vector of uint) 0:32 move second child to first child (temp highp int) 0:32 'i1' (temp highp int) -0:32 bitCount (global highp int) +0:32 bitCount (global lowp int) 0:32 'i1' (temp highp int) 0:33 move second child to first child (temp highp 3-component vector of int) 0:33 'i3' (temp highp 3-component vector of int) -0:33 bitCount (global highp 3-component vector of int) +0:33 bitCount (global lowp 3-component vector of int) 0:33 'u3' (temp highp 3-component vector of uint) 0:34 move second child to first child (temp highp 2-component vector of int) 0:34 'i2' (temp highp 2-component vector of int) -0:34 findLSB (global highp 2-component vector of int) +0:34 findLSB (global lowp 2-component vector of int) 0:34 'i2' (temp highp 2-component vector of int) 0:35 move second child to first child (temp highp 4-component vector of int) 0:35 'i4' (temp highp 4-component vector of int) -0:35 findLSB (global highp 4-component vector of int) +0:35 findLSB (global lowp 4-component vector of int) 0:35 'u4' (temp highp 4-component vector of uint) 0:36 move second child to first child (temp highp int) 0:36 'i1' (temp highp int) -0:36 findMSB (global highp int) +0:36 findMSB (global lowp int) 0:36 'i1' (temp highp int) 0:37 move second child to first child (temp highp 2-component vector of int) 0:37 'i2' (temp highp 2-component vector of int) -0:37 findMSB (global highp 2-component vector of int) +0:37 findMSB (global lowp 2-component vector of int) 0:37 'u2' (temp highp 2-component vector of uint) 0:40 move second child to first child (temp highp 3-component vector of float) 0:40 'v3' (temp highp 3-component vector of float) @@ -1216,11 +1217,11 @@ ERROR: node is still EOpNull! 0:153 Function Parameters: 0:? Sequence 0:156 move second child to first child (temp highp 2-component vector of float) -0:156 'h' (temp highp 2-component vector of float) +0:156 'h' (noContraction temp highp 2-component vector of float) 0:156 fma (global highp 2-component vector of float) 0:156 'inf' (in highp 2-component vector of float) 0:156 'ing' (in highp 2-component vector of float) -0:156 'h' (temp highp 2-component vector of float) +0:156 'h' (noContraction temp highp 2-component vector of float) 0:157 indirect index (temp highp sampler2D) 0:157 'sArray' (uniform 4-element array of highp sampler2D) 0:157 add (temp highp int) @@ -1291,11 +1292,11 @@ ERROR: node is still EOpNull! 0:171 Function Parameters: 0:? Sequence 0:174 move second child to first child (temp highp 2-component vector of float) -0:174 'h' (temp highp 2-component vector of float) +0:174 'h' (noContraction temp highp 2-component vector of float) 0:174 fma (global highp 2-component vector of float) 0:174 'inf' (in highp 2-component vector of float) 0:174 'ing' (in highp 2-component vector of float) -0:174 'h' (temp highp 2-component vector of float) +0:174 'h' (noContraction temp highp 2-component vector of float) 0:175 indirect index (temp highp sampler2D) 0:175 'sArray' (uniform 4-element array of highp sampler2D) 0:175 add (temp highp int) diff --git a/Test/baseResults/330.frag.out b/Test/baseResults/330.frag.out index 5d145efd..904ad3ed 100644 --- a/Test/baseResults/330.frag.out +++ b/Test/baseResults/330.frag.out @@ -37,7 +37,8 @@ ERROR: 0:140: 'textureQueryLod' : no matching overloaded function found ERROR: 0:140: 'assign' : cannot convert from 'const float' to 'temp 2-component vector of float' ERROR: 0:141: 'textureQueryLod' : no matching overloaded function found ERROR: 0:141: 'assign' : cannot convert from 'const float' to 'temp 2-component vector of float' -ERROR: 38 compilation errors. No code generated. +ERROR: 0:152: 'index' : value must be 0 or 1 +ERROR: 39 compilation errors. No code generated. Shader version: 330 @@ -122,6 +123,7 @@ ERROR: node is still EOpNull! 0:? 'samp2Ds' (uniform sampler2DShadow) 0:? 'precise' (global int) 0:? 'KeyMem' (global structure{global int precise}) +0:? 'outIndex2' (layout(location=28 index=0 ) out 4-component vector of float) Linked fragment stage: @@ -211,4 +213,5 @@ ERROR: node is still EOpNull! 0:? 'samp2Ds' (uniform sampler2DShadow) 0:? 'precise' (global int) 0:? 'KeyMem' (global structure{global int precise}) +0:? 'outIndex2' (layout(location=28 index=0 ) out 4-component vector of float) diff --git a/Test/baseResults/400.tesc.out b/Test/baseResults/400.tesc.out index 6a0b895a..58a8a327 100644 --- a/Test/baseResults/400.tesc.out +++ b/Test/baseResults/400.tesc.out @@ -18,7 +18,10 @@ ERROR: 0:74: 'in' : type must be an array: ina ERROR: 0:76: '[]' : tessellation input array size must be gl_MaxPatchVertices or implicitly sized ERROR: 0:83: 'location' : overlapping use of location 4 ERROR: 0:87: 'location' : overlapping use of location 4 -ERROR: 18 compilation errors. No code generated. +ERROR: 0:104: '' : precise qualifier must appear first +ERROR: 0:105: '' : precise qualifier must appear first +ERROR: 0:105: '' : precise qualifier must appear first +ERROR: 21 compilation errors. No code generated. Shader version: 400 @@ -180,20 +183,20 @@ ERROR: node is still EOpNull! 0:91 Function Parameters: 0:? Sequence 0:95 multiply second child into first child (temp 3-component vector of float) -0:95 'pv3' (temp 3-component vector of float) -0:95 'pv3' (temp 3-component vector of float) +0:95 'pv3' (noContraction temp 3-component vector of float) +0:95 'pv3' (noContraction temp 3-component vector of float) 0:96 move second child to first child (temp 3-component vector of float) -0:96 'pv3' (temp 3-component vector of float) +0:96 'pv3' (noContraction temp 3-component vector of float) 0:96 fma (global 3-component vector of float) -0:96 'pv3' (temp 3-component vector of float) -0:96 'pv3' (temp 3-component vector of float) -0:96 'pv3' (temp 3-component vector of float) +0:96 'pv3' (noContraction temp 3-component vector of float) +0:96 'pv3' (noContraction temp 3-component vector of float) +0:96 'pv3' (noContraction temp 3-component vector of float) 0:97 move second child to first child (temp double) -0:97 'd' (temp double) +0:97 'd' (noContraction temp double) 0:97 fma (global double) -0:97 'd' (temp double) -0:97 'd' (temp double) -0:97 'd' (temp double) +0:97 'd' (noContraction temp double) +0:97 'd' (noContraction temp double) +0:97 'd' (noContraction temp double) 0:? Linker Objects 0:? 'gl_out' (out 4-element array of block{out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out implicitly-sized array of float ClipDistance gl_ClipDistance}) 0:? 'outa' (global 4-element array of int) @@ -209,8 +212,9 @@ ERROR: node is still EOpNull! 0:? 'ovla' (layout(location=3 ) out 4-element array of 4-component vector of float) 0:? 'ovlb' (layout(location=4 ) out 4-element array of 4-component vector of float) 0:? 'ovlc' (layout(location=4 ) out 4-element array of 4-component vector of float) -0:? 'pv3' (temp 3-component vector of float) +0:? 'pv3' (noContraction temp 3-component vector of float) 0:? 'pinbi' (patch out block{out int a}) +0:? 'badOrder' (invariant noContraction out 4-element array of 4-component vector of float) Linked tessellation control stage: @@ -233,8 +237,8 @@ ERROR: node is still EOpNull! 0:23 move second child to first child (temp 4-component vector of float) 0:23 'p' (temp 4-component vector of float) 0:23 gl_Position: direct index for structure (in 4-component vector of float Position) -0:23 direct index (temp block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 1-element array of float ClipDistance gl_ClipDistance}) -0:23 'gl_in' (in 32-element array of block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 1-element array of float ClipDistance gl_ClipDistance}) +0:23 direct index (temp block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) +0:23 'gl_in' (in 32-element array of block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) 0:23 Constant: 0:23 1 (const int) 0:23 Constant: @@ -243,8 +247,8 @@ ERROR: node is still EOpNull! 0:24 move second child to first child (temp float) 0:24 'ps' (temp float) 0:24 gl_PointSize: direct index for structure (in float PointSize) -0:24 direct index (temp block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 1-element array of float ClipDistance gl_ClipDistance}) -0:24 'gl_in' (in 32-element array of block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 1-element array of float ClipDistance gl_ClipDistance}) +0:24 direct index (temp block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) +0:24 'gl_in' (in 32-element array of block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) 0:24 Constant: 0:24 1 (const int) 0:24 Constant: @@ -253,9 +257,9 @@ ERROR: node is still EOpNull! 0:25 move second child to first child (temp float) 0:25 'cd' (temp float) 0:25 direct index (temp float ClipDistance) -0:25 gl_ClipDistance: direct index for structure (in 1-element array of float ClipDistance) -0:25 direct index (temp block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 1-element array of float ClipDistance gl_ClipDistance}) -0:25 'gl_in' (in 32-element array of block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 1-element array of float ClipDistance gl_ClipDistance}) +0:25 gl_ClipDistance: direct index for structure (in 3-element array of float ClipDistance) +0:25 direct index (temp block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) +0:25 'gl_in' (in 32-element array of block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) 0:25 Constant: 0:25 1 (const int) 0:25 Constant: @@ -276,25 +280,25 @@ ERROR: node is still EOpNull! 0:29 'gl_InvocationID' (in int InvocationID) 0:31 move second child to first child (temp 4-component vector of float) 0:31 gl_Position: direct index for structure (out 4-component vector of float Position) -0:31 indirect index (temp block{out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out 1-element array of float ClipDistance gl_ClipDistance}) -0:31 'gl_out' (out 4-element array of block{out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out 1-element array of float ClipDistance gl_ClipDistance}) +0:31 indirect index (temp block{out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out 2-element array of float ClipDistance gl_ClipDistance}) +0:31 'gl_out' (out 4-element array of block{out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out 2-element array of float ClipDistance gl_ClipDistance}) 0:31 'gl_InvocationID' (in int InvocationID) 0:31 Constant: 0:31 0 (const int) 0:31 'p' (temp 4-component vector of float) 0:32 move second child to first child (temp float) 0:32 gl_PointSize: direct index for structure (out float PointSize) -0:32 indirect index (temp block{out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out 1-element array of float ClipDistance gl_ClipDistance}) -0:32 'gl_out' (out 4-element array of block{out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out 1-element array of float ClipDistance gl_ClipDistance}) +0:32 indirect index (temp block{out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out 2-element array of float ClipDistance gl_ClipDistance}) +0:32 'gl_out' (out 4-element array of block{out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out 2-element array of float ClipDistance gl_ClipDistance}) 0:32 'gl_InvocationID' (in int InvocationID) 0:32 Constant: 0:32 1 (const int) 0:32 'ps' (temp float) 0:33 move second child to first child (temp float) 0:33 direct index (temp float ClipDistance) -0:33 gl_ClipDistance: direct index for structure (out 1-element array of float ClipDistance) -0:33 indirect index (temp block{out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out 1-element array of float ClipDistance gl_ClipDistance}) -0:33 'gl_out' (out 4-element array of block{out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out 1-element array of float ClipDistance gl_ClipDistance}) +0:33 gl_ClipDistance: direct index for structure (out 2-element array of float ClipDistance) +0:33 indirect index (temp block{out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out 2-element array of float ClipDistance gl_ClipDistance}) +0:33 'gl_out' (out 4-element array of block{out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out 2-element array of float ClipDistance gl_ClipDistance}) 0:33 'gl_InvocationID' (in int InvocationID) 0:33 Constant: 0:33 2 (const int) @@ -364,8 +368,8 @@ ERROR: node is still EOpNull! 0:67 Function Parameters: 0:69 Sequence 0:69 gl_PointSize: direct index for structure (out float PointSize) -0:69 direct index (temp block{out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out 1-element array of float ClipDistance gl_ClipDistance}) -0:69 'gl_out' (out 4-element array of block{out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out 1-element array of float ClipDistance gl_ClipDistance}) +0:69 direct index (temp block{out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out 2-element array of float ClipDistance gl_ClipDistance}) +0:69 'gl_out' (out 4-element array of block{out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out 2-element array of float ClipDistance gl_ClipDistance}) 0:69 Constant: 0:69 4 (const int) 0:69 Constant: @@ -375,22 +379,22 @@ ERROR: node is still EOpNull! 0:91 Function Parameters: 0:? Sequence 0:95 multiply second child into first child (temp 3-component vector of float) -0:95 'pv3' (temp 3-component vector of float) -0:95 'pv3' (temp 3-component vector of float) +0:95 'pv3' (noContraction temp 3-component vector of float) +0:95 'pv3' (noContraction temp 3-component vector of float) 0:96 move second child to first child (temp 3-component vector of float) -0:96 'pv3' (temp 3-component vector of float) +0:96 'pv3' (noContraction temp 3-component vector of float) 0:96 fma (global 3-component vector of float) -0:96 'pv3' (temp 3-component vector of float) -0:96 'pv3' (temp 3-component vector of float) -0:96 'pv3' (temp 3-component vector of float) +0:96 'pv3' (noContraction temp 3-component vector of float) +0:96 'pv3' (noContraction temp 3-component vector of float) +0:96 'pv3' (noContraction temp 3-component vector of float) 0:97 move second child to first child (temp double) -0:97 'd' (temp double) +0:97 'd' (noContraction temp double) 0:97 fma (global double) -0:97 'd' (temp double) -0:97 'd' (temp double) -0:97 'd' (temp double) +0:97 'd' (noContraction temp double) +0:97 'd' (noContraction temp double) +0:97 'd' (noContraction temp double) 0:? Linker Objects -0:? 'gl_out' (out 4-element array of block{out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out 1-element array of float ClipDistance gl_ClipDistance}) +0:? 'gl_out' (out 4-element array of block{out 4-component vector of float Position gl_Position, out float PointSize gl_PointSize, out 2-element array of float ClipDistance gl_ClipDistance}) 0:? 'outa' (global 4-element array of int) 0:? 'patchIn' (patch in 4-component vector of float) 0:? 'patchOut' (patch out 4-component vector of float) @@ -404,6 +408,7 @@ ERROR: node is still EOpNull! 0:? 'ovla' (layout(location=3 ) out 4-element array of 4-component vector of float) 0:? 'ovlb' (layout(location=4 ) out 4-element array of 4-component vector of float) 0:? 'ovlc' (layout(location=4 ) out 4-element array of 4-component vector of float) -0:? 'pv3' (temp 3-component vector of float) +0:? 'pv3' (noContraction temp 3-component vector of float) 0:? 'pinbi' (patch out block{out int a}) +0:? 'badOrder' (invariant noContraction out 4-element array of 4-component vector of float) diff --git a/Test/baseResults/400.tese.out b/Test/baseResults/400.tese.out index 55670f87..324dbaa3 100644 --- a/Test/baseResults/400.tese.out +++ b/Test/baseResults/400.tese.out @@ -138,7 +138,7 @@ ERROR: node is still EOpNull! 0:? 'badp2' (flat patch in 4-component vector of float) 0:? 'badp3' (noperspective patch in 4-component vector of float) 0:? 'badp4' (patch sample in 3-component vector of float) -0:? 'gl_in' (in 32-element array of block{in implicitly-sized array of float ClipDistance gl_ClipDistance}) +0:? 'gl_in' (in 32-element array of block{in 1-element array of float ClipDistance gl_ClipDistance}) 0:? 'ina' (in 2-component vector of float) 0:? 'inb' (in 32-element array of 2-component vector of float) 0:? 'inc' (in 32-element array of 2-component vector of float) @@ -179,8 +179,8 @@ ERROR: node is still EOpNull! 0:32 move second child to first child (temp 4-component vector of float) 0:32 'p' (temp 4-component vector of float) 0:32 gl_Position: direct index for structure (in 4-component vector of float Position) -0:32 direct index (temp block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 1-element array of float ClipDistance gl_ClipDistance}) -0:32 'gl_in' (in 32-element array of block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 1-element array of float ClipDistance gl_ClipDistance}) +0:32 direct index (temp block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) +0:32 'gl_in' (in 32-element array of block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) 0:32 Constant: 0:32 1 (const int) 0:32 Constant: @@ -189,8 +189,8 @@ ERROR: node is still EOpNull! 0:33 move second child to first child (temp float) 0:33 'ps' (temp float) 0:33 gl_PointSize: direct index for structure (in float PointSize) -0:33 direct index (temp block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 1-element array of float ClipDistance gl_ClipDistance}) -0:33 'gl_in' (in 32-element array of block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 1-element array of float ClipDistance gl_ClipDistance}) +0:33 direct index (temp block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) +0:33 'gl_in' (in 32-element array of block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) 0:33 Constant: 0:33 1 (const int) 0:33 Constant: @@ -199,9 +199,9 @@ ERROR: node is still EOpNull! 0:34 move second child to first child (temp float) 0:34 'cd' (temp float) 0:34 direct index (temp float ClipDistance) -0:34 gl_ClipDistance: direct index for structure (in 1-element array of float ClipDistance) -0:34 direct index (temp block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 1-element array of float ClipDistance gl_ClipDistance}) -0:34 'gl_in' (in 32-element array of block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 1-element array of float ClipDistance gl_ClipDistance}) +0:34 gl_ClipDistance: direct index for structure (in 3-element array of float ClipDistance) +0:34 direct index (temp block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) +0:34 'gl_in' (in 32-element array of block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) 0:34 Constant: 0:34 1 (const int) 0:34 Constant: diff --git a/Test/baseResults/420.comp.out b/Test/baseResults/420.comp.out new file mode 100755 index 00000000..a2311d5a --- /dev/null +++ b/Test/baseResults/420.comp.out @@ -0,0 +1,122 @@ +420.comp +Warning, version 420 is not yet complete; most version-specific features are present, but some are missing. +ERROR: 0:3: 'gl_WorkGroupSize' : not supported for this version or the enabled extensions +ERROR: 1 compilation errors. No code generated. + + +Shader version: 420 +Requested GL_ARB_compute_shader +local_size = (2, 4, 6) +ERROR: node is still EOpNull! +0:11 Function Definition: main( (global void) +0:11 Function Parameters: +0:13 Sequence +0:13 move second child to first child (temp 3-component vector of float) +0:13 'sfoo' (shared 3-component vector of float) +0:13 Constant: +0:13 2.000000 +0:13 4.000000 +0:13 6.000000 +0:14 add second child into first child (temp 3-component vector of float) +0:14 'sfoo' (shared 3-component vector of float) +0:14 Convert uint to float (temp 3-component vector of float) +0:14 add (temp 3-component vector of uint) +0:14 add (temp 3-component vector of uint) +0:14 add (temp 3-component vector of uint) +0:14 add (temp 3-component vector of uint) +0:14 Constant: +0:14 2 (const uint) +0:14 4 (const uint) +0:14 6 (const uint) +0:14 'gl_NumWorkGroups' (in 3-component vector of uint NumWorkGroups) +0:14 'gl_WorkGroupID' (in 3-component vector of uint WorkGroupID) +0:14 'gl_LocalInvocationID' (in 3-component vector of uint LocalInvocationID) +0:14 'gl_GlobalInvocationID' (in 3-component vector of uint GlobalInvocationID) +0:15 vector scale second child into first child (temp 3-component vector of float) +0:15 'sfoo' (shared 3-component vector of float) +0:15 Convert uint to float (temp float) +0:15 'gl_LocalInvocationIndex' (in uint LocalInvocationIndex) +0:16 add second child into first child (temp 3-component vector of float) +0:16 'sfoo' (shared 3-component vector of float) +0:16 Constant: +0:16 66559.000000 +0:16 66559.000000 +0:16 65599.000000 +0:17 vector scale second child into first child (temp 3-component vector of float) +0:17 'sfoo' (shared 3-component vector of float) +0:17 Constant: +0:17 1057.000000 +0:23 Barrier (global void) +0:24 MemoryBarrier (global void) +0:25 MemoryBarrierAtomicCounter (global void) +0:26 MemoryBarrierBuffer (global void) +0:27 MemoryBarrierImage (global void) +0:28 MemoryBarrierShared (global void) +0:29 GroupMemoryBarrier (global void) +0:? Linker Objects +0:? 'gl_WorkGroupSize' (const 3-component vector of uint WorkGroupSize) +0:? 2 (const uint) +0:? 4 (const uint) +0:? 6 (const uint) +0:? 'sfoo' (shared 3-component vector of float) + + +Linked compute stage: + + +Shader version: 420 +Requested GL_ARB_compute_shader +local_size = (2, 4, 6) +ERROR: node is still EOpNull! +0:11 Function Definition: main( (global void) +0:11 Function Parameters: +0:13 Sequence +0:13 move second child to first child (temp 3-component vector of float) +0:13 'sfoo' (shared 3-component vector of float) +0:13 Constant: +0:13 2.000000 +0:13 4.000000 +0:13 6.000000 +0:14 add second child into first child (temp 3-component vector of float) +0:14 'sfoo' (shared 3-component vector of float) +0:14 Convert uint to float (temp 3-component vector of float) +0:14 add (temp 3-component vector of uint) +0:14 add (temp 3-component vector of uint) +0:14 add (temp 3-component vector of uint) +0:14 add (temp 3-component vector of uint) +0:14 Constant: +0:14 2 (const uint) +0:14 4 (const uint) +0:14 6 (const uint) +0:14 'gl_NumWorkGroups' (in 3-component vector of uint NumWorkGroups) +0:14 'gl_WorkGroupID' (in 3-component vector of uint WorkGroupID) +0:14 'gl_LocalInvocationID' (in 3-component vector of uint LocalInvocationID) +0:14 'gl_GlobalInvocationID' (in 3-component vector of uint GlobalInvocationID) +0:15 vector scale second child into first child (temp 3-component vector of float) +0:15 'sfoo' (shared 3-component vector of float) +0:15 Convert uint to float (temp float) +0:15 'gl_LocalInvocationIndex' (in uint LocalInvocationIndex) +0:16 add second child into first child (temp 3-component vector of float) +0:16 'sfoo' (shared 3-component vector of float) +0:16 Constant: +0:16 66559.000000 +0:16 66559.000000 +0:16 65599.000000 +0:17 vector scale second child into first child (temp 3-component vector of float) +0:17 'sfoo' (shared 3-component vector of float) +0:17 Constant: +0:17 1057.000000 +0:23 Barrier (global void) +0:24 MemoryBarrier (global void) +0:25 MemoryBarrierAtomicCounter (global void) +0:26 MemoryBarrierBuffer (global void) +0:27 MemoryBarrierImage (global void) +0:28 MemoryBarrierShared (global void) +0:29 GroupMemoryBarrier (global void) +0:? Linker Objects +0:? 'gl_WorkGroupSize' (const 3-component vector of uint WorkGroupSize) +0:? 2 (const uint) +0:? 4 (const uint) +0:? 6 (const uint) +0:? 'sfoo' (shared 3-component vector of float) + diff --git a/Test/baseResults/420.tesc.out b/Test/baseResults/420.tesc.out index db65fd99..594e1302 100644 --- a/Test/baseResults/420.tesc.out +++ b/Test/baseResults/420.tesc.out @@ -132,8 +132,8 @@ ERROR: node is still EOpNull! 0:17 move second child to first child (temp 4-component vector of float) 0:17 'p' (temp 4-component vector of float) 0:17 gl_Position: direct index for structure (in 4-component vector of float Position) -0:17 direct index (temp block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 1-element array of float ClipDistance gl_ClipDistance}) -0:17 'gl_in' (in 32-element array of block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 1-element array of float ClipDistance gl_ClipDistance}) +0:17 direct index (temp block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) +0:17 'gl_in' (in 32-element array of block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) 0:17 Constant: 0:17 1 (const int) 0:17 Constant: @@ -142,8 +142,8 @@ ERROR: node is still EOpNull! 0:18 move second child to first child (temp float) 0:18 'ps' (temp float) 0:18 gl_PointSize: direct index for structure (in float PointSize) -0:18 direct index (temp block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 1-element array of float ClipDistance gl_ClipDistance}) -0:18 'gl_in' (in 32-element array of block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 1-element array of float ClipDistance gl_ClipDistance}) +0:18 direct index (temp block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) +0:18 'gl_in' (in 32-element array of block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) 0:18 Constant: 0:18 1 (const int) 0:18 Constant: @@ -152,9 +152,9 @@ ERROR: node is still EOpNull! 0:19 move second child to first child (temp float) 0:19 'cd' (temp float) 0:19 direct index (temp float ClipDistance) -0:19 gl_ClipDistance: direct index for structure (in 1-element array of float ClipDistance) -0:19 direct index (temp block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 1-element array of float ClipDistance gl_ClipDistance}) -0:19 'gl_in' (in 32-element array of block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 1-element array of float ClipDistance gl_ClipDistance}) +0:19 gl_ClipDistance: direct index for structure (in 3-element array of float ClipDistance) +0:19 direct index (temp block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) +0:19 'gl_in' (in 32-element array of block{in 4-component vector of float Position gl_Position, in float PointSize gl_PointSize, in 3-element array of float ClipDistance gl_ClipDistance}) 0:19 Constant: 0:19 1 (const int) 0:19 Constant: diff --git a/Test/baseResults/420.tese.out b/Test/baseResults/420.tese.out index 26eac103..fb9bc201 100644 --- a/Test/baseResults/420.tese.out +++ b/Test/baseResults/420.tese.out @@ -1,17 +1,17 @@ 420.tese Warning, version 420 is not yet complete; most version-specific features are present, but some are missing. -ERROR: 0:7: '=' : cannot convert from 'global 3-element array of float' to 'global 2-element array of float' -ERROR: 0:8: 'initializer list' : wrong vector size (or rows in a matrix column): global 2-component vector of float -ERROR: 0:9: 'initializer list' : wrong number of matrix columns: global 3X3 matrix of float -ERROR: 0:10: 'initializer list' : wrong number of matrix columns: global 2X2 matrix of float +ERROR: 0:7: '=' : cannot convert from 'const 3-element array of float' to 'global 2-element array of float' +ERROR: 0:8: 'initializer list' : wrong vector size (or rows in a matrix column): temp 2-component vector of float +ERROR: 0:9: 'initializer list' : wrong number of matrix columns: temp 3X3 matrix of float +ERROR: 0:10: 'initializer list' : wrong number of matrix columns: temp 2X2 matrix of float ERROR: 0:25: 'initializer list' : wrong number of structure members ERROR: 0:27: '=' : cannot convert from 'const bool' to 'global int' -ERROR: 0:28: 'constructor' : cannot convert parameter 2 from 'const float' to 'global 4-component vector of float' +ERROR: 0:28: 'constructor' : cannot convert parameter 2 from 'const float' to 'temp 4-component vector of float' ERROR: 0:29: 'constructor' : cannot convert parameter 2 from 'const 2X2 matrix of float' to 'const 4-component vector of float' ERROR: 0:29: 'const 2-element array of 4-component vector of float' : cannot construct with these arguments ERROR: 0:29: '=' : cannot convert from 'const float' to 'global 2-element array of 4-component vector of float' -ERROR: 0:30: 'initializer list' : wrong number of matrix columns: global 4X2 matrix of float -ERROR: 0:40: 'constructor' : cannot convert parameter 1 from 'temp float' to 'global structure{global float s, global float t}' +ERROR: 0:30: 'initializer list' : wrong number of matrix columns: temp 4X2 matrix of float +ERROR: 0:40: 'constructor' : cannot convert parameter 1 from 'temp float' to 'temp structure{global float s, global float t}' ERROR: 0:58: 'initializer list' : wrong number of structure members ERROR: 13 compilation errors. No code generated. @@ -60,7 +60,7 @@ ERROR: node is still EOpNull! 0:68 Sequence 0:68 move second child to first child (temp 3-component vector of float) 0:68 'bv3' (global 3-component vector of float) -0:68 Construct vec3 (global 3-component vector of float) +0:68 Construct vec3 (temp 3-component vector of float) 0:68 'vc1' (global float) 0:68 'vc2' (global float) 0:68 'vc3' (global float) @@ -210,7 +210,7 @@ ERROR: node is still EOpNull! 0:68 Sequence 0:68 move second child to first child (temp 3-component vector of float) 0:68 'bv3' (global 3-component vector of float) -0:68 Construct vec3 (global 3-component vector of float) +0:68 Construct vec3 (temp 3-component vector of float) 0:68 'vc1' (global float) 0:68 'vc2' (global float) 0:68 'vc3' (global float) diff --git a/Test/baseResults/420.vert.out b/Test/baseResults/420.vert.out index 3b0dfaea..0f5110cb 100644 --- a/Test/baseResults/420.vert.out +++ b/Test/baseResults/420.vert.out @@ -275,7 +275,7 @@ ERROR: node is still EOpNull! 0:? 'sampb3' (layout(binding=80 ) uniform sampler2D) 0:? 'sampb4' (layout(binding=31 ) uniform sampler2D) 0:? 'sampb5' (layout(binding=79 ) uniform 2-element array of sampler2D) -0:? 'anon@3' (out block{out implicitly-sized array of float ClipDistance gl_ClipDistance, }) +0:? 'anon@3' (out block{out 4-element array of float ClipDistance gl_ClipDistance, }) 0:? 'patchIn' (patch in 4-component vector of float) 0:? 'patchOut' (smooth patch out 4-component vector of float) 0:? 'comma0' (temp int) @@ -527,7 +527,7 @@ ERROR: node is still EOpNull! 0:? 'sampb3' (layout(binding=80 ) uniform sampler2D) 0:? 'sampb4' (layout(binding=31 ) uniform sampler2D) 0:? 'sampb5' (layout(binding=79 ) uniform 2-element array of sampler2D) -0:? 'anon@3' (out block{out 1-element array of float ClipDistance gl_ClipDistance, }) +0:? 'anon@3' (out block{out 4-element array of float ClipDistance gl_ClipDistance, }) 0:? 'patchIn' (patch in 4-component vector of float) 0:? 'patchOut' (smooth patch out 4-component vector of float) 0:? 'comma0' (temp int) diff --git a/Test/baseResults/430AofA.frag.out b/Test/baseResults/430AofA.frag.out index e8b79b7e..68285f73 100644 --- a/Test/baseResults/430AofA.frag.out +++ b/Test/baseResults/430AofA.frag.out @@ -6,7 +6,7 @@ ERROR: 0:15: 'constructior' : array constructor argument not correct type to con ERROR: 0:28: '[' : array index out of range '4' ERROR: 0:56: 'constructor' : cannot convert parameter 2 from 'const 3-element array of 4-component vector of float' to 'temp 2-element array of 4-component vector of float' ERROR: 0:60: 'constructor' : cannot convert parameter 2 from 'const 2-element array of 4-component vector of float' to 'temp 3-element array of 4-component vector of float' -ERROR: 0:64: '=' : cannot convert from 'temp 3-element array of 2-element array of 4-component vector of float' to 'temp 4-element array of 2-element array of 4-component vector of float' +ERROR: 0:64: '=' : cannot convert from 'const 3-element array of 2-element array of 4-component vector of float' to 'temp 4-element array of 2-element array of 4-component vector of float' ERROR: 0:70: 'assign' : cannot convert from 'global 4-element array of 7-element array of float' to 'global 5-element array of 7-element array of float' ERROR: 0:71: 'assign' : cannot convert from 'global 4-element array of 7-element array of float' to 'global implicitly-sized array of 7-element array of float' ERROR: 0:73: 'foo' : no matching overloaded function found diff --git a/Test/baseResults/450.frag.out b/Test/baseResults/450.frag.out index 5d7035f9..23682e8a 100644 --- a/Test/baseResults/450.frag.out +++ b/Test/baseResults/450.frag.out @@ -51,7 +51,7 @@ Shader version: 450 0:18 move second child to first child (temp float) 0:18 'cull' (temp float) 0:18 direct index (smooth temp float CullDistance) -0:18 'gl_CullDistance' (smooth in implicitly-sized array of float CullDistance) +0:18 'gl_CullDistance' (smooth in 6-element array of float CullDistance) 0:18 Constant: 0:18 2 (const int) 0:19 Sequence @@ -130,12 +130,32 @@ Shader version: 450 0:48 2 (const int) 0:48 Constant: 0:48 4.500000 +0:53 Function Definition: cull(i1; (global float) +0:53 Function Parameters: +0:53 'i' (in int) +0:55 Sequence +0:55 Branch: Return with expression +0:55 Test condition and select (temp float) +0:55 Condition +0:55 Compare Greater Than or Equal (temp bool) +0:55 'i' (in int) +0:55 Constant: +0:55 6 (const int) +0:55 true case +0:55 direct index (smooth temp float CullDistance) +0:55 'gl_CullDistance' (smooth in 6-element array of float CullDistance) +0:55 Constant: +0:55 5 (const int) +0:55 false case +0:55 indirect index (smooth temp float CullDistance) +0:55 'gl_CullDistance' (smooth in 6-element array of float CullDistance) +0:55 'i' (in int) 0:? Linker Objects 0:? 'in1' (smooth in float) 0:? 'in2' (smooth in 2-component vector of float) 0:? 'in3' (smooth in 3-component vector of float) 0:? 'in4' (smooth in 4-component vector of float) -0:? 'gl_CullDistance' (smooth in implicitly-sized array of float CullDistance) +0:? 'gl_CullDistance' (smooth in 6-element array of float CullDistance) 0:? 's2dms' (uniform sampler2DMS) 0:? 'us2dmsa' (uniform usampler2DMSArray) 0:? 'ii2dms' (layout(rgba32i ) uniform iimage2DMS) @@ -195,7 +215,7 @@ Shader version: 450 0:18 move second child to first child (temp float) 0:18 'cull' (temp float) 0:18 direct index (smooth temp float CullDistance) -0:18 'gl_CullDistance' (smooth in 3-element array of float CullDistance) +0:18 'gl_CullDistance' (smooth in 6-element array of float CullDistance) 0:18 Constant: 0:18 2 (const int) 0:19 Sequence @@ -274,12 +294,32 @@ Shader version: 450 0:48 2 (const int) 0:48 Constant: 0:48 4.500000 +0:53 Function Definition: cull(i1; (global float) +0:53 Function Parameters: +0:53 'i' (in int) +0:55 Sequence +0:55 Branch: Return with expression +0:55 Test condition and select (temp float) +0:55 Condition +0:55 Compare Greater Than or Equal (temp bool) +0:55 'i' (in int) +0:55 Constant: +0:55 6 (const int) +0:55 true case +0:55 direct index (smooth temp float CullDistance) +0:55 'gl_CullDistance' (smooth in 6-element array of float CullDistance) +0:55 Constant: +0:55 5 (const int) +0:55 false case +0:55 indirect index (smooth temp float CullDistance) +0:55 'gl_CullDistance' (smooth in 6-element array of float CullDistance) +0:55 'i' (in int) 0:? Linker Objects 0:? 'in1' (smooth in float) 0:? 'in2' (smooth in 2-component vector of float) 0:? 'in3' (smooth in 3-component vector of float) 0:? 'in4' (smooth in 4-component vector of float) -0:? 'gl_CullDistance' (smooth in 3-element array of float CullDistance) +0:? 'gl_CullDistance' (smooth in 6-element array of float CullDistance) 0:? 's2dms' (uniform sampler2DMS) 0:? 'us2dmsa' (uniform usampler2DMSArray) 0:? 'ii2dms' (layout(rgba32i ) uniform iimage2DMS) diff --git a/Test/baseResults/450.geom.out b/Test/baseResults/450.geom.out index fd98d088..fef3486a 100644 --- a/Test/baseResults/450.geom.out +++ b/Test/baseResults/450.geom.out @@ -12,16 +12,16 @@ output primitive = none 0:13 Sequence 0:13 move second child to first child (temp float) 0:13 direct index (layout(stream=0 ) temp float CullDistance) -0:13 gl_CullDistance: direct index for structure (layout(stream=0 ) out implicitly-sized array of float CullDistance) -0:13 'anon@0' (layout(stream=0 ) out block{layout(stream=0 ) out implicitly-sized array of float CullDistance gl_CullDistance}) +0:13 gl_CullDistance: direct index for structure (layout(stream=0 ) out 3-element array of float CullDistance) +0:13 'anon@0' (layout(stream=0 ) out block{layout(stream=0 ) out 3-element array of float CullDistance gl_CullDistance}) 0:13 Constant: 0:13 3 (const uint) 0:13 Constant: 0:13 2 (const int) 0:13 direct index (temp float CullDistance) -0:13 gl_CullDistance: direct index for structure (in implicitly-sized array of float CullDistance) -0:13 direct index (temp block{in implicitly-sized array of float CullDistance gl_CullDistance}) -0:13 'gl_in' (in implicitly-sized array of block{in implicitly-sized array of float CullDistance gl_CullDistance}) +0:13 gl_CullDistance: direct index for structure (in 3-element array of float CullDistance) +0:13 direct index (temp block{in 3-element array of float CullDistance gl_CullDistance}) +0:13 'gl_in' (in implicitly-sized array of block{in 3-element array of float CullDistance gl_CullDistance}) 0:13 Constant: 0:13 1 (const int) 0:13 Constant: @@ -29,8 +29,8 @@ output primitive = none 0:13 Constant: 0:13 2 (const int) 0:? Linker Objects -0:? 'gl_in' (in implicitly-sized array of block{in implicitly-sized array of float CullDistance gl_CullDistance}) -0:? 'anon@0' (layout(stream=0 ) out block{layout(stream=0 ) out implicitly-sized array of float CullDistance gl_CullDistance}) +0:? 'gl_in' (in implicitly-sized array of block{in 3-element array of float CullDistance gl_CullDistance}) +0:? 'anon@0' (layout(stream=0 ) out block{layout(stream=0 ) out 3-element array of float CullDistance gl_CullDistance}) Linked geometry stage: @@ -57,9 +57,9 @@ output primitive = none 0:13 Constant: 0:13 2 (const int) 0:13 direct index (temp float CullDistance) -0:13 gl_CullDistance: direct index for structure (in 1-element array of float CullDistance) -0:13 direct index (temp block{in 1-element array of float CullDistance gl_CullDistance}) -0:13 'gl_in' (in 2-element array of block{in 1-element array of float CullDistance gl_CullDistance}) +0:13 gl_CullDistance: direct index for structure (in 3-element array of float CullDistance) +0:13 direct index (temp block{in 3-element array of float CullDistance gl_CullDistance}) +0:13 'gl_in' (in 2-element array of block{in 3-element array of float CullDistance gl_CullDistance}) 0:13 Constant: 0:13 1 (const int) 0:13 Constant: @@ -67,6 +67,6 @@ output primitive = none 0:13 Constant: 0:13 2 (const int) 0:? Linker Objects -0:? 'gl_in' (in 2-element array of block{in 1-element array of float CullDistance gl_CullDistance}) +0:? 'gl_in' (in 2-element array of block{in 3-element array of float CullDistance gl_CullDistance}) 0:? 'anon@0' (layout(stream=0 ) out block{layout(stream=0 ) out 3-element array of float CullDistance gl_CullDistance}) diff --git a/Test/baseResults/450.tesc.out b/Test/baseResults/450.tesc.out index 8a8e9fbf..aeef6cb3 100644 --- a/Test/baseResults/450.tesc.out +++ b/Test/baseResults/450.tesc.out @@ -9,18 +9,18 @@ vertices = -1 0:13 Sequence 0:13 move second child to first child (temp float) 0:13 direct index (temp float CullDistance) -0:13 gl_CullDistance: direct index for structure (out implicitly-sized array of float CullDistance) -0:13 indirect index (temp block{out implicitly-sized array of float CullDistance gl_CullDistance}) -0:13 'gl_out' (out 4-element array of block{out implicitly-sized array of float CullDistance gl_CullDistance}) +0:13 gl_CullDistance: direct index for structure (out 3-element array of float CullDistance) +0:13 indirect index (temp block{out 3-element array of float CullDistance gl_CullDistance}) +0:13 'gl_out' (out 4-element array of block{out 3-element array of float CullDistance gl_CullDistance}) 0:13 'gl_InvocationID' (in int InvocationID) 0:13 Constant: 0:13 0 (const int) 0:13 Constant: 0:13 2 (const int) 0:13 direct index (temp float CullDistance) -0:13 gl_CullDistance: direct index for structure (in implicitly-sized array of float CullDistance) -0:13 direct index (temp block{in implicitly-sized array of float CullDistance gl_CullDistance}) -0:13 'gl_in' (in 32-element array of block{in implicitly-sized array of float CullDistance gl_CullDistance}) +0:13 gl_CullDistance: direct index for structure (in 3-element array of float CullDistance) +0:13 direct index (temp block{in 3-element array of float CullDistance gl_CullDistance}) +0:13 'gl_in' (in 32-element array of block{in 3-element array of float CullDistance gl_CullDistance}) 0:13 Constant: 0:13 1 (const int) 0:13 Constant: @@ -28,8 +28,8 @@ vertices = -1 0:13 Constant: 0:13 2 (const int) 0:? Linker Objects -0:? 'gl_in' (in 32-element array of block{in implicitly-sized array of float CullDistance gl_CullDistance}) -0:? 'gl_out' (out 4-element array of block{out implicitly-sized array of float CullDistance gl_CullDistance}) +0:? 'gl_in' (in 32-element array of block{in 3-element array of float CullDistance gl_CullDistance}) +0:? 'gl_out' (out 4-element array of block{out 3-element array of float CullDistance gl_CullDistance}) Linked tessellation control stage: @@ -44,18 +44,18 @@ vertices = -1 0:13 Sequence 0:13 move second child to first child (temp float) 0:13 direct index (temp float CullDistance) -0:13 gl_CullDistance: direct index for structure (out 1-element array of float CullDistance) -0:13 indirect index (temp block{out 1-element array of float CullDistance gl_CullDistance}) -0:13 'gl_out' (out 4-element array of block{out 1-element array of float CullDistance gl_CullDistance}) +0:13 gl_CullDistance: direct index for structure (out 3-element array of float CullDistance) +0:13 indirect index (temp block{out 3-element array of float CullDistance gl_CullDistance}) +0:13 'gl_out' (out 4-element array of block{out 3-element array of float CullDistance gl_CullDistance}) 0:13 'gl_InvocationID' (in int InvocationID) 0:13 Constant: 0:13 0 (const int) 0:13 Constant: 0:13 2 (const int) 0:13 direct index (temp float CullDistance) -0:13 gl_CullDistance: direct index for structure (in 1-element array of float CullDistance) -0:13 direct index (temp block{in 1-element array of float CullDistance gl_CullDistance}) -0:13 'gl_in' (in 32-element array of block{in 1-element array of float CullDistance gl_CullDistance}) +0:13 gl_CullDistance: direct index for structure (in 3-element array of float CullDistance) +0:13 direct index (temp block{in 3-element array of float CullDistance gl_CullDistance}) +0:13 'gl_in' (in 32-element array of block{in 3-element array of float CullDistance gl_CullDistance}) 0:13 Constant: 0:13 1 (const int) 0:13 Constant: @@ -63,6 +63,6 @@ vertices = -1 0:13 Constant: 0:13 2 (const int) 0:? Linker Objects -0:? 'gl_in' (in 32-element array of block{in 1-element array of float CullDistance gl_CullDistance}) -0:? 'gl_out' (out 4-element array of block{out 1-element array of float CullDistance gl_CullDistance}) +0:? 'gl_in' (in 32-element array of block{in 3-element array of float CullDistance gl_CullDistance}) +0:? 'gl_out' (out 4-element array of block{out 3-element array of float CullDistance gl_CullDistance}) diff --git a/Test/baseResults/450.tese.out b/Test/baseResults/450.tese.out index c6e97b8d..f988f108 100644 --- a/Test/baseResults/450.tese.out +++ b/Test/baseResults/450.tese.out @@ -11,16 +11,16 @@ triangle order = none 0:13 Sequence 0:13 move second child to first child (temp float) 0:13 direct index (temp float CullDistance) -0:13 gl_CullDistance: direct index for structure (out implicitly-sized array of float CullDistance) -0:13 'anon@0' (out block{out implicitly-sized array of float CullDistance gl_CullDistance}) +0:13 gl_CullDistance: direct index for structure (out 3-element array of float CullDistance) +0:13 'anon@0' (out block{out 3-element array of float CullDistance gl_CullDistance}) 0:13 Constant: 0:13 3 (const uint) 0:13 Constant: 0:13 2 (const int) 0:13 direct index (temp float CullDistance) -0:13 gl_CullDistance: direct index for structure (in implicitly-sized array of float CullDistance) -0:13 direct index (temp block{in implicitly-sized array of float CullDistance gl_CullDistance}) -0:13 'gl_in' (in 32-element array of block{in implicitly-sized array of float CullDistance gl_CullDistance}) +0:13 gl_CullDistance: direct index for structure (in 3-element array of float CullDistance) +0:13 direct index (temp block{in 3-element array of float CullDistance gl_CullDistance}) +0:13 'gl_in' (in 32-element array of block{in 3-element array of float CullDistance gl_CullDistance}) 0:13 Constant: 0:13 1 (const int) 0:13 Constant: @@ -28,8 +28,8 @@ triangle order = none 0:13 Constant: 0:13 2 (const int) 0:? Linker Objects -0:? 'gl_in' (in 32-element array of block{in implicitly-sized array of float CullDistance gl_CullDistance}) -0:? 'anon@0' (out block{out implicitly-sized array of float CullDistance gl_CullDistance}) +0:? 'gl_in' (in 32-element array of block{in 3-element array of float CullDistance gl_CullDistance}) +0:? 'anon@0' (out block{out 3-element array of float CullDistance gl_CullDistance}) Linked tessellation evaluation stage: @@ -53,9 +53,9 @@ triangle order = ccw 0:13 Constant: 0:13 2 (const int) 0:13 direct index (temp float CullDistance) -0:13 gl_CullDistance: direct index for structure (in 1-element array of float CullDistance) -0:13 direct index (temp block{in 1-element array of float CullDistance gl_CullDistance}) -0:13 'gl_in' (in 32-element array of block{in 1-element array of float CullDistance gl_CullDistance}) +0:13 gl_CullDistance: direct index for structure (in 3-element array of float CullDistance) +0:13 direct index (temp block{in 3-element array of float CullDistance gl_CullDistance}) +0:13 'gl_in' (in 32-element array of block{in 3-element array of float CullDistance gl_CullDistance}) 0:13 Constant: 0:13 1 (const int) 0:13 Constant: @@ -63,6 +63,6 @@ triangle order = ccw 0:13 Constant: 0:13 2 (const int) 0:? Linker Objects -0:? 'gl_in' (in 32-element array of block{in 1-element array of float CullDistance gl_CullDistance}) +0:? 'gl_in' (in 32-element array of block{in 3-element array of float CullDistance gl_CullDistance}) 0:? 'anon@0' (out block{out 3-element array of float CullDistance gl_CullDistance}) diff --git a/Test/baseResults/450.vert.out b/Test/baseResults/450.vert.out index 39cce382..86338c76 100644 --- a/Test/baseResults/450.vert.out +++ b/Test/baseResults/450.vert.out @@ -12,8 +12,8 @@ ERROR: node is still EOpNull! 0:9 Sequence 0:9 move second child to first child (temp float) 0:9 direct index (temp float CullDistance) -0:9 gl_CullDistance: direct index for structure (out implicitly-sized array of float CullDistance) -0:9 'anon@0' (out block{out implicitly-sized array of float CullDistance gl_CullDistance}) +0:9 gl_CullDistance: direct index for structure (out 3-element array of float CullDistance) +0:9 'anon@0' (out block{out 3-element array of float CullDistance gl_CullDistance}) 0:9 Constant: 0:9 10 (const uint) 0:9 Constant: @@ -21,7 +21,7 @@ ERROR: node is still EOpNull! 0:9 Constant: 0:9 4.500000 0:? Linker Objects -0:? 'anon@0' (out block{out implicitly-sized array of float CullDistance gl_CullDistance}) +0:? 'anon@0' (out block{out 3-element array of float CullDistance gl_CullDistance}) 0:? 'outb' (smooth out bool) 0:? 'outo' (smooth out sampler2D) 0:? 'outa' (smooth out 4-element array of float) diff --git a/Test/baseResults/empty.frag.out b/Test/baseResults/empty.frag.out index d3c244a5..be186bb9 100644 --- a/Test/baseResults/empty.frag.out +++ b/Test/baseResults/empty.frag.out @@ -13,16 +13,5 @@ Shader version: 110 0:? Sequence 0:? Linker Objects - -Linked fragment stage: - -ERROR: Linking fragment stage: Cannot mix ES profile with non-ES profile shaders - -ERROR: Linking fragment stage: Cannot mix ES profile with non-ES profile shaders - -ERROR: Linking fragment stage: Missing entry point: Each stage requires one "void main()" entry point - -Shader version: 110 -0:? Sequence -0:? Linker Objects +ERROR: Cannot mix ES profile with non-ES profile shaders diff --git a/Test/baseResults/es-link1.frag.out b/Test/baseResults/es-link1.frag.out new file mode 100644 index 00000000..41ce9a0f --- /dev/null +++ b/Test/baseResults/es-link1.frag.out @@ -0,0 +1,27 @@ +es-link1.frag +Shader version: 100 +0:? Sequence +0:5 Function Definition: main( (global void) +0:5 Function Parameters: +0:7 Sequence +0:7 move second child to first child (temp mediump 4-component vector of float) +0:7 'gl_FragColor' (fragColor mediump 4-component vector of float FragColor) +0:7 Function Call: calculateColor( (global mediump 4-component vector of float) +0:? Linker Objects + +es-link2.frag +Shader version: 100 +0:? Sequence +0:5 Function Definition: calculateColor( (global mediump 4-component vector of float) +0:5 Function Parameters: +0:7 Sequence +0:7 Branch: Return with expression +0:7 vector-scale (temp mediump 4-component vector of float) +0:7 'varyingColor' (smooth in mediump 4-component vector of float) +0:7 Constant: +0:7 0.500000 +0:? Linker Objects +0:? 'varyingColor' (smooth in mediump 4-component vector of float) + +ERROR: Cannot attach multiple ES shaders of the same type to a single program + diff --git a/Test/baseResults/hlsl.assoc.frag.out b/Test/baseResults/hlsl.assoc.frag.out new file mode 100755 index 00000000..a027a62c --- /dev/null +++ b/Test/baseResults/hlsl.assoc.frag.out @@ -0,0 +1,113 @@ +hlsl.assoc.frag +Shader version: 450 +gl_FragCoord origin is upper left +0:? Sequence +0:12 Function Definition: PixelShaderFunction(vf4;vf4;vf4;vf4;vf4; (temp 4-component vector of float) +0:8 Function Parameters: +0:8 'a1' (temp 4-component vector of float) +0:8 'a2' (temp 4-component vector of float) +0:8 'a3' (temp 4-component vector of float) +0:8 'a4' (temp 4-component vector of float) +0:8 'a5' (temp 4-component vector of float) +0:? Sequence +0:9 move second child to first child (temp 4-component vector of float) +0:9 'a1' (temp 4-component vector of float) +0:9 move second child to first child (temp 4-component vector of float) +0:9 'a2' (temp 4-component vector of float) +0:9 move second child to first child (temp 4-component vector of float) +0:9 'a3' (temp 4-component vector of float) +0:9 move second child to first child (temp 4-component vector of float) +0:9 'a4' (temp 4-component vector of float) +0:9 'a5' (temp 4-component vector of float) +0:10 Branch: Return with expression +0:10 add (temp 4-component vector of float) +0:10 add (temp 4-component vector of float) +0:10 add (temp 4-component vector of float) +0:10 'a1' (temp 4-component vector of float) +0:10 'a2' (temp 4-component vector of float) +0:10 add (temp 4-component vector of float) +0:10 'a3' (temp 4-component vector of float) +0:10 'a4' (temp 4-component vector of float) +0:10 'a5' (temp 4-component vector of float) +0:? Linker Objects + + +Linked fragment stage: + + +Shader version: 450 +gl_FragCoord origin is upper left +0:? Sequence +0:12 Function Definition: PixelShaderFunction(vf4;vf4;vf4;vf4;vf4; (temp 4-component vector of float) +0:8 Function Parameters: +0:8 'a1' (temp 4-component vector of float) +0:8 'a2' (temp 4-component vector of float) +0:8 'a3' (temp 4-component vector of float) +0:8 'a4' (temp 4-component vector of float) +0:8 'a5' (temp 4-component vector of float) +0:? Sequence +0:9 move second child to first child (temp 4-component vector of float) +0:9 'a1' (temp 4-component vector of float) +0:9 move second child to first child (temp 4-component vector of float) +0:9 'a2' (temp 4-component vector of float) +0:9 move second child to first child (temp 4-component vector of float) +0:9 'a3' (temp 4-component vector of float) +0:9 move second child to first child (temp 4-component vector of float) +0:9 'a4' (temp 4-component vector of float) +0:9 'a5' (temp 4-component vector of float) +0:10 Branch: Return with expression +0:10 add (temp 4-component vector of float) +0:10 add (temp 4-component vector of float) +0:10 add (temp 4-component vector of float) +0:10 'a1' (temp 4-component vector of float) +0:10 'a2' (temp 4-component vector of float) +0:10 add (temp 4-component vector of float) +0:10 'a3' (temp 4-component vector of float) +0:10 'a4' (temp 4-component vector of float) +0:10 'a5' (temp 4-component vector of float) +0:? Linker Objects + +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 25 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "PixelShaderFunction" + ExecutionMode 4 OriginUpperLeft + Source HLSL 450 + Name 4 "PixelShaderFunction" + Name 9 "a1" + Name 10 "a2" + Name 11 "a3" + Name 12 "a4" + Name 13 "a5" + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Function 7(fvec4) +4(PixelShaderFunction): 2 Function None 3 + 5: Label + 9(a1): 8(ptr) Variable Function + 10(a2): 8(ptr) Variable Function + 11(a3): 8(ptr) Variable Function + 12(a4): 8(ptr) Variable Function + 13(a5): 8(ptr) Variable Function + 14: 7(fvec4) Load 13(a5) + Store 12(a4) 14 + Store 11(a3) 14 + Store 10(a2) 14 + Store 9(a1) 14 + 15: 7(fvec4) Load 9(a1) + 16: 7(fvec4) Load 10(a2) + 17: 7(fvec4) FAdd 15 16 + 18: 7(fvec4) Load 11(a3) + 19: 7(fvec4) Load 12(a4) + 20: 7(fvec4) FAdd 18 19 + 21: 7(fvec4) FAdd 17 20 + 22: 7(fvec4) Load 13(a5) + 23: 7(fvec4) FAdd 21 22 + ReturnValue 23 + FunctionEnd diff --git a/Test/baseResults/hlsl.attribute.frag.out b/Test/baseResults/hlsl.attribute.frag.out new file mode 100755 index 00000000..6ee4a246 --- /dev/null +++ b/Test/baseResults/hlsl.attribute.frag.out @@ -0,0 +1,57 @@ +hlsl.attribute.frag +Shader version: 450 +gl_FragCoord origin is upper left +0:? Sequence +0:14 Function Definition: PixelShaderFunction(vf4; (temp 4-component vector of float) +0:2 Function Parameters: +0:2 'input' (temp 4-component vector of float) +0:? Sequence +0:11 Test condition and select (temp void) +0:11 Condition +0:11 Constant: +0:11 0 (const int) +0:11 true case is null +0:? Linker Objects + + +Linked fragment stage: + + +Shader version: 450 +gl_FragCoord origin is upper left +0:? Sequence +0:14 Function Definition: PixelShaderFunction(vf4; (temp 4-component vector of float) +0:2 Function Parameters: +0:2 'input' (temp 4-component vector of float) +0:? Sequence +0:11 Test condition and select (temp void) +0:11 Condition +0:11 Constant: +0:11 0 (const int) +0:11 true case is null +0:? Linker Objects + +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 10 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "PixelShaderFunction" + ExecutionMode 4 OriginUpperLeft + Source HLSL 450 + Name 4 "PixelShaderFunction" + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 1 + 7: 6(int) Constant 0 +4(PixelShaderFunction): 2 Function None 3 + 5: Label + SelectionMerge 9 None + BranchConditional 7 8 9 + 8: Label + Branch 9 + 9: Label + Return + FunctionEnd diff --git a/Test/baseResults/hlsl.cast.frag.out b/Test/baseResults/hlsl.cast.frag.out new file mode 100755 index 00000000..1e689788 --- /dev/null +++ b/Test/baseResults/hlsl.cast.frag.out @@ -0,0 +1,86 @@ +hlsl.cast.frag +Shader version: 450 +gl_FragCoord origin is upper left +0:? Sequence +0:5 Function Definition: PixelShaderFunction(vf4; (temp 4-component vector of float) +0:2 Function Parameters: +0:2 'input' (temp 4-component vector of float) +0:? Sequence +0:3 Branch: Return with expression +0:3 add (temp 4-component vector of float) +0:3 add (temp 4-component vector of float) +0:3 Construct vec4 (temp 4-component vector of float) +0:3 'input' (temp 4-component vector of float) +0:3 Convert int to float (temp 4-component vector of float) +0:3 Convert float to int (temp 4-component vector of int) +0:3 'input' (temp 4-component vector of float) +0:3 Constant: +0:3 1.198000 +0:3 1.198000 +0:3 1.198000 +0:3 1.198000 +0:? Linker Objects + + +Linked fragment stage: + + +Shader version: 450 +gl_FragCoord origin is upper left +0:? Sequence +0:5 Function Definition: PixelShaderFunction(vf4; (temp 4-component vector of float) +0:2 Function Parameters: +0:2 'input' (temp 4-component vector of float) +0:? Sequence +0:3 Branch: Return with expression +0:3 add (temp 4-component vector of float) +0:3 add (temp 4-component vector of float) +0:3 Construct vec4 (temp 4-component vector of float) +0:3 'input' (temp 4-component vector of float) +0:3 Convert int to float (temp 4-component vector of float) +0:3 Convert float to int (temp 4-component vector of int) +0:3 'input' (temp 4-component vector of float) +0:3 Constant: +0:3 1.198000 +0:3 1.198000 +0:3 1.198000 +0:3 1.198000 +0:? Linker Objects + +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 26 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "PixelShaderFunction" + ExecutionMode 4 OriginUpperLeft + Source HLSL 450 + Name 4 "PixelShaderFunction" + Name 9 "input" + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Function 7(fvec4) + 17: TypeInt 32 1 + 18: TypeVector 17(int) 4 + 22: 6(float) Constant 1067014160 + 23: 7(fvec4) ConstantComposite 22 22 22 22 +4(PixelShaderFunction): 2 Function None 3 + 5: Label + 9(input): 8(ptr) Variable Function + 10: 7(fvec4) Load 9(input) + 11: 6(float) CompositeExtract 10 0 + 12: 6(float) CompositeExtract 10 1 + 13: 6(float) CompositeExtract 10 2 + 14: 6(float) CompositeExtract 10 3 + 15: 7(fvec4) CompositeConstruct 11 12 13 14 + 16: 7(fvec4) Load 9(input) + 19: 18(ivec4) ConvertFToS 16 + 20: 7(fvec4) ConvertSToF 19 + 21: 7(fvec4) FAdd 15 20 + 24: 7(fvec4) FAdd 21 23 + ReturnValue 24 + FunctionEnd diff --git a/Test/baseResults/hlsl.doLoop.frag.out b/Test/baseResults/hlsl.doLoop.frag.out new file mode 100755 index 00000000..eed2d913 --- /dev/null +++ b/Test/baseResults/hlsl.doLoop.frag.out @@ -0,0 +1,116 @@ +hlsl.doLoop.frag +Shader version: 450 +gl_FragCoord origin is upper left +0:? Sequence +0:7 Function Definition: PixelShaderFunction(vf4; (temp 4-component vector of float) +0:2 Function Parameters: +0:2 'input' (temp 4-component vector of float) +0:? Sequence +0:3 Loop with condition not tested first +0:3 Loop Condition +0:3 Constant: +0:3 false (const bool) +0:3 No loop body +0:4 Loop with condition not tested first +0:4 Loop Condition +0:4 Constant: +0:4 false (const bool) +0:4 No loop body +0:5 Loop with condition not tested first +0:5 Loop Condition +0:5 Compare Equal (temp bool) +0:5 'input' (temp 4-component vector of float) +0:5 'input' (temp 4-component vector of float) +0:5 Loop Body +0:5 Branch: Return with expression +0:5 'input' (temp 4-component vector of float) +0:? Linker Objects + + +Linked fragment stage: + + +Shader version: 450 +gl_FragCoord origin is upper left +0:? Sequence +0:7 Function Definition: PixelShaderFunction(vf4; (temp 4-component vector of float) +0:2 Function Parameters: +0:2 'input' (temp 4-component vector of float) +0:? Sequence +0:3 Loop with condition not tested first +0:3 Loop Condition +0:3 Constant: +0:3 false (const bool) +0:3 No loop body +0:4 Loop with condition not tested first +0:4 Loop Condition +0:4 Constant: +0:4 false (const bool) +0:4 No loop body +0:5 Loop with condition not tested first +0:5 Loop Condition +0:5 Compare Equal (temp bool) +0:5 'input' (temp 4-component vector of float) +0:5 'input' (temp 4-component vector of float) +0:5 Loop Body +0:5 Branch: Return with expression +0:5 'input' (temp 4-component vector of float) +0:? Linker Objects + +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 31 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "PixelShaderFunction" + ExecutionMode 4 OriginUpperLeft + Source HLSL 450 + Name 4 "PixelShaderFunction" + Name 23 "input" + 2: TypeVoid + 3: TypeFunction 2 + 10: TypeBool + 11: 10(bool) ConstantFalse + 20: TypeFloat 32 + 21: TypeVector 20(float) 4 + 22: TypePointer Function 21(fvec4) + 28: TypeVector 10(bool) 4 +4(PixelShaderFunction): 2 Function None 3 + 5: Label + 23(input): 22(ptr) Variable Function + Branch 6 + 6: Label + LoopMerge 8 9 None + Branch 7 + 7: Label + Branch 9 + 9: Label + BranchConditional 11 6 8 + 8: Label + Branch 12 + 12: Label + LoopMerge 14 15 None + Branch 13 + 13: Label + Branch 15 + 15: Label + BranchConditional 11 12 14 + 14: Label + Branch 16 + 16: Label + LoopMerge 18 19 None + Branch 17 + 17: Label + 24: 21(fvec4) Load 23(input) + ReturnValue 24 + 19: Label + 26: 21(fvec4) Load 23(input) + 27: 21(fvec4) Load 23(input) + 29: 28(bvec4) FOrdEqual 26 27 + 30: 10(bool) All 29 + BranchConditional 30 16 18 + 18: Label + Return + FunctionEnd diff --git a/Test/baseResults/hlsl.float1.frag.out b/Test/baseResults/hlsl.float1.frag.out new file mode 100755 index 00000000..4cf0a0d1 --- /dev/null +++ b/Test/baseResults/hlsl.float1.frag.out @@ -0,0 +1,100 @@ +hlsl.float1.frag +Shader version: 450 +gl_FragCoord origin is upper left +0:? Sequence +0:1 move second child to first child (temp 1-component vector of float) +0:1 'f1' (temp 1-component vector of float) +0:1 Constant: +0:1 1.000000 +0:2 move second child to first child (temp float) +0:2 'scalar' (temp float) +0:2 Constant: +0:2 2.000000 +0:8 Function Definition: ShaderFunction(vf1;f1; (temp 1-component vector of float) +0:5 Function Parameters: +0:5 'inFloat1' (temp 1-component vector of float) +0:5 'inScalar' (temp float) +0:? Sequence +0:6 Branch: Return with expression +0:6 add (temp 1-component vector of float) +0:6 vector-scale (temp 1-component vector of float) +0:6 'f1' (temp 1-component vector of float) +0:6 'scalar' (temp float) +0:6 vector-scale (temp 1-component vector of float) +0:6 'inFloat1' (temp 1-component vector of float) +0:6 'inScalar' (temp float) +0:? Linker Objects +0:? 'f1' (temp 1-component vector of float) +0:? 'scalar' (temp float) + + +Linked fragment stage: + + +Shader version: 450 +gl_FragCoord origin is upper left +0:? Sequence +0:1 move second child to first child (temp 1-component vector of float) +0:1 'f1' (temp 1-component vector of float) +0:1 Constant: +0:1 1.000000 +0:2 move second child to first child (temp float) +0:2 'scalar' (temp float) +0:2 Constant: +0:2 2.000000 +0:8 Function Definition: ShaderFunction(vf1;f1; (temp 1-component vector of float) +0:5 Function Parameters: +0:5 'inFloat1' (temp 1-component vector of float) +0:5 'inScalar' (temp float) +0:? Sequence +0:6 Branch: Return with expression +0:6 add (temp 1-component vector of float) +0:6 vector-scale (temp 1-component vector of float) +0:6 'f1' (temp 1-component vector of float) +0:6 'scalar' (temp float) +0:6 vector-scale (temp 1-component vector of float) +0:6 'inFloat1' (temp 1-component vector of float) +0:6 'inScalar' (temp float) +0:? Linker Objects +0:? 'f1' (temp 1-component vector of float) +0:? 'scalar' (temp float) + +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 24 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "PixelShaderFunction" + ExecutionMode 4 OriginUpperLeft + Source HLSL 450 + Name 4 "PixelShaderFunction" + Name 11 "ShaderFunction(vf1;f1;" + Name 9 "inFloat1" + Name 10 "inScalar" + Name 13 "f1" + Name 15 "scalar" + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypePointer Function 6(float) + 8: TypeFunction 6(float) 7(ptr) 7(ptr) +4(PixelShaderFunction): 2 Function None 3 + 5: Label + FunctionEnd +11(ShaderFunction(vf1;f1;): 6(float) Function None 8 + 9(inFloat1): 7(ptr) FunctionParameter + 10(inScalar): 7(ptr) FunctionParameter + 12: Label + 13(f1): 7(ptr) Variable Function + 15(scalar): 7(ptr) Variable Function + 14: 6(float) Load 13(f1) + 16: 6(float) Load 15(scalar) + 17: 6(float) IMul 14 16 + 18: 6(float) Load 9(inFloat1) + 19: 6(float) Load 10(inScalar) + 20: 6(float) IMul 18 19 + 21: 6(float) FAdd 17 20 + ReturnValue 21 + FunctionEnd diff --git a/Test/baseResults/hlsl.float4.frag.out b/Test/baseResults/hlsl.float4.frag.out new file mode 100755 index 00000000..ba757c98 --- /dev/null +++ b/Test/baseResults/hlsl.float4.frag.out @@ -0,0 +1,79 @@ +hlsl.float4.frag +Shader version: 450 +gl_FragCoord origin is upper left +0:? Sequence +0:1 move second child to first child (temp 4-component vector of float) +0:1 'AmbientColor' (temp 4-component vector of float) +0:? Constant: +0:? 1.000000 +0:? 0.500000 +0:? 0.000000 +0:? 1.000000 +0:7 Function Definition: ShaderFunction(vf4; (temp 4-component vector of float) +0:4 Function Parameters: +0:4 'input' (temp 4-component vector of float) +0:? Sequence +0:5 Branch: Return with expression +0:5 component-wise multiply (temp 4-component vector of float) +0:5 'input' (temp 4-component vector of float) +0:5 'AmbientColor' (temp 4-component vector of float) +0:? Linker Objects +0:? 'AmbientColor' (temp 4-component vector of float) + + +Linked fragment stage: + + +Shader version: 450 +gl_FragCoord origin is upper left +0:? Sequence +0:1 move second child to first child (temp 4-component vector of float) +0:1 'AmbientColor' (temp 4-component vector of float) +0:? Constant: +0:? 1.000000 +0:? 0.500000 +0:? 0.000000 +0:? 1.000000 +0:7 Function Definition: ShaderFunction(vf4; (temp 4-component vector of float) +0:4 Function Parameters: +0:4 'input' (temp 4-component vector of float) +0:? Sequence +0:5 Branch: Return with expression +0:5 component-wise multiply (temp 4-component vector of float) +0:5 'input' (temp 4-component vector of float) +0:5 'AmbientColor' (temp 4-component vector of float) +0:? Linker Objects +0:? 'AmbientColor' (temp 4-component vector of float) + +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 19 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "PixelShaderFunction" + ExecutionMode 4 OriginUpperLeft + Source HLSL 450 + Name 4 "PixelShaderFunction" + Name 11 "ShaderFunction(vf4;" + Name 10 "input" + Name 14 "AmbientColor" + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Function 7(fvec4) + 9: TypeFunction 7(fvec4) 8(ptr) +4(PixelShaderFunction): 2 Function None 3 + 5: Label + FunctionEnd +11(ShaderFunction(vf4;): 7(fvec4) Function None 9 + 10(input): 8(ptr) FunctionParameter + 12: Label +14(AmbientColor): 8(ptr) Variable Function + 13: 7(fvec4) Load 10(input) + 15: 7(fvec4) Load 14(AmbientColor) + 16: 7(fvec4) FMul 13 15 + ReturnValue 16 + FunctionEnd diff --git a/Test/baseResults/hlsl.forLoop.frag.out b/Test/baseResults/hlsl.forLoop.frag.out new file mode 100755 index 00000000..2e654e19 --- /dev/null +++ b/Test/baseResults/hlsl.forLoop.frag.out @@ -0,0 +1,220 @@ +hlsl.forLoop.frag +Shader version: 450 +gl_FragCoord origin is upper left +0:? Sequence +0:9 Function Definition: PixelShaderFunction(vf4; (temp 4-component vector of float) +0:2 Function Parameters: +0:2 'input' (temp 4-component vector of float) +0:? Sequence +0:? Sequence +0:3 Loop with condition tested first +0:3 No loop condition +0:3 No loop body +0:4 Sequence +0:4 Pre-Increment (temp 4-component vector of float) +0:4 'input' (temp 4-component vector of float) +0:4 Loop with condition tested first +0:4 No loop condition +0:4 No loop body +0:? Sequence +0:5 Loop with condition tested first +0:5 Loop Condition +0:5 Compare Not Equal (temp bool) +0:5 'input' (temp 4-component vector of float) +0:5 'input' (temp 4-component vector of float) +0:5 No loop body +0:? Sequence +0:6 Loop with condition tested first +0:6 Loop Condition +0:6 Compare Not Equal (temp bool) +0:6 'input' (temp 4-component vector of float) +0:6 'input' (temp 4-component vector of float) +0:6 Loop Body +0:? Sequence +0:6 Branch: Return with expression +0:6 Negate value (temp 4-component vector of float) +0:6 'input' (temp 4-component vector of float) +0:7 Sequence +0:7 Pre-Decrement (temp 4-component vector of float) +0:7 'input' (temp 4-component vector of float) +0:7 Loop with condition tested first +0:7 Loop Condition +0:7 Compare Not Equal (temp bool) +0:7 'input' (temp 4-component vector of float) +0:7 'input' (temp 4-component vector of float) +0:7 Loop Body +0:? Sequence +0:7 Branch: Return with expression +0:7 Negate value (temp 4-component vector of float) +0:7 'input' (temp 4-component vector of float) +0:7 Loop Terminal Expression +0:7 add second child into first child (temp 4-component vector of float) +0:7 'input' (temp 4-component vector of float) +0:7 Constant: +0:7 2.000000 +0:? Linker Objects + + +Linked fragment stage: + + +Shader version: 450 +gl_FragCoord origin is upper left +0:? Sequence +0:9 Function Definition: PixelShaderFunction(vf4; (temp 4-component vector of float) +0:2 Function Parameters: +0:2 'input' (temp 4-component vector of float) +0:? Sequence +0:? Sequence +0:3 Loop with condition tested first +0:3 No loop condition +0:3 No loop body +0:4 Sequence +0:4 Pre-Increment (temp 4-component vector of float) +0:4 'input' (temp 4-component vector of float) +0:4 Loop with condition tested first +0:4 No loop condition +0:4 No loop body +0:? Sequence +0:5 Loop with condition tested first +0:5 Loop Condition +0:5 Compare Not Equal (temp bool) +0:5 'input' (temp 4-component vector of float) +0:5 'input' (temp 4-component vector of float) +0:5 No loop body +0:? Sequence +0:6 Loop with condition tested first +0:6 Loop Condition +0:6 Compare Not Equal (temp bool) +0:6 'input' (temp 4-component vector of float) +0:6 'input' (temp 4-component vector of float) +0:6 Loop Body +0:? Sequence +0:6 Branch: Return with expression +0:6 Negate value (temp 4-component vector of float) +0:6 'input' (temp 4-component vector of float) +0:7 Sequence +0:7 Pre-Decrement (temp 4-component vector of float) +0:7 'input' (temp 4-component vector of float) +0:7 Loop with condition tested first +0:7 Loop Condition +0:7 Compare Not Equal (temp bool) +0:7 'input' (temp 4-component vector of float) +0:7 'input' (temp 4-component vector of float) +0:7 Loop Body +0:? Sequence +0:7 Branch: Return with expression +0:7 Negate value (temp 4-component vector of float) +0:7 'input' (temp 4-component vector of float) +0:7 Loop Terminal Expression +0:7 add second child into first child (temp 4-component vector of float) +0:7 'input' (temp 4-component vector of float) +0:7 Constant: +0:7 2.000000 +0:? Linker Objects + +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 64 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "PixelShaderFunction" + ExecutionMode 4 OriginUpperLeft + Source HLSL 450 + Name 4 "PixelShaderFunction" + Name 13 "input" + 2: TypeVoid + 3: TypeFunction 2 + 10: TypeFloat 32 + 11: TypeVector 10(float) 4 + 12: TypePointer Function 11(fvec4) + 15: 10(float) Constant 1065353216 + 29: TypeBool + 30: TypeVector 29(bool) 4 + 60: 10(float) Constant 1073741824 +4(PixelShaderFunction): 2 Function None 3 + 5: Label + 13(input): 12(ptr) Variable Function + Branch 6 + 6: Label + LoopMerge 8 9 None + Branch 7 + 7: Label + Branch 9 + 9: Label + Branch 6 + 8: Label + 14: 11(fvec4) Load 13(input) + 16: 11(fvec4) CompositeConstruct 15 15 15 15 + 17: 11(fvec4) FAdd 14 16 + Store 13(input) 17 + Branch 18 + 18: Label + LoopMerge 20 21 None + Branch 19 + 19: Label + Branch 21 + 21: Label + Branch 18 + 20: Label + Branch 22 + 22: Label + LoopMerge 24 25 None + Branch 26 + 26: Label + 27: 11(fvec4) Load 13(input) + 28: 11(fvec4) Load 13(input) + 31: 30(bvec4) FOrdNotEqual 27 28 + 32: 29(bool) Any 31 + BranchConditional 32 23 24 + 23: Label + Branch 25 + 25: Label + Branch 22 + 24: Label + Branch 33 + 33: Label + LoopMerge 35 36 None + Branch 37 + 37: Label + 38: 11(fvec4) Load 13(input) + 39: 11(fvec4) Load 13(input) + 40: 30(bvec4) FOrdNotEqual 38 39 + 41: 29(bool) Any 40 + BranchConditional 41 34 35 + 34: Label + 42: 11(fvec4) Load 13(input) + 43: 11(fvec4) FNegate 42 + ReturnValue 43 + 36: Label + Branch 33 + 35: Label + 45: 11(fvec4) Load 13(input) + 46: 11(fvec4) CompositeConstruct 15 15 15 15 + 47: 11(fvec4) FSub 45 46 + Store 13(input) 47 + Branch 48 + 48: Label + LoopMerge 50 51 None + Branch 52 + 52: Label + 53: 11(fvec4) Load 13(input) + 54: 11(fvec4) Load 13(input) + 55: 30(bvec4) FOrdNotEqual 53 54 + 56: 29(bool) Any 55 + BranchConditional 56 49 50 + 49: Label + 57: 11(fvec4) Load 13(input) + 58: 11(fvec4) FNegate 57 + ReturnValue 58 + 51: Label + 61: 11(fvec4) Load 13(input) + 62: 11(fvec4) CompositeConstruct 60 60 60 60 + 63: 11(fvec4) FAdd 61 62 + Store 13(input) 63 + Branch 48 + 50: Label + Return + FunctionEnd diff --git a/Test/baseResults/hlsl.frag.out b/Test/baseResults/hlsl.frag.out new file mode 100644 index 00000000..cfed9051 --- /dev/null +++ b/Test/baseResults/hlsl.frag.out @@ -0,0 +1,160 @@ +hlsl.frag +Shader version: 450 +gl_FragCoord origin is upper left +0:? Sequence +0:1 move second child to first child (temp 4-component vector of float) +0:1 'AmbientColor' (temp 4-component vector of float) +0:? Constant: +0:? 1.000000 +0:? 0.500000 +0:? 0.000000 +0:? 1.000000 +0:2 move second child to first child (temp float) +0:2 'AmbientIntensity' (temp float) +0:2 Constant: +0:2 0.100000 +0:13 Function Definition: PixelShaderFunction(vf4; (temp 4-component vector of float) +0:5 Function Parameters: +0:5 'input' (temp 4-component vector of float) +0:? Sequence +0:6 Branch: Return with expression +0:6 add (temp 4-component vector of float) +0:6 vector-scale (temp 4-component vector of float) +0:6 'input' (temp 4-component vector of float) +0:6 'AmbientIntensity' (temp float) +0:6 'AmbientColor' (temp 4-component vector of float) +0:7 Branch: Return with expression +0:7 add (temp 4-component vector of float) +0:7 component-wise multiply (temp 4-component vector of float) +0:7 'input' (temp 4-component vector of float) +0:7 'input' (temp 4-component vector of float) +0:7 component-wise multiply (temp 4-component vector of float) +0:7 'input' (temp 4-component vector of float) +0:7 'input' (temp 4-component vector of float) +0:8 Branch: Return with expression +0:8 add (temp 4-component vector of float) +0:8 add (temp 4-component vector of float) +0:8 'input' (temp 4-component vector of float) +0:8 component-wise multiply (temp 4-component vector of float) +0:8 'input' (temp 4-component vector of float) +0:8 'input' (temp 4-component vector of float) +0:8 'input' (temp 4-component vector of float) +0:9 Branch: Return with expression +0:9 component-wise multiply (temp 4-component vector of float) +0:9 Pre-Increment (temp 4-component vector of float) +0:9 'input' (temp 4-component vector of float) +0:9 Negate value (temp 4-component vector of float) +0:9 Negate value (temp 4-component vector of float) +0:9 Pre-Decrement (temp 4-component vector of float) +0:9 'input' (temp 4-component vector of float) +0:10 Branch: Return with expression +0:10 add (temp 4-component vector of float) +0:10 Post-Increment (temp 4-component vector of float) +0:10 'input' (temp 4-component vector of float) +0:10 Pre-Increment (temp 4-component vector of float) +0:10 'input' (temp 4-component vector of float) +0:11 Branch: Return with expression +0:11 sine (global 4-component vector of float) +0:11 'input' (temp 4-component vector of float) +0:? Linker Objects +0:? 'AmbientColor' (temp 4-component vector of float) +0:? 'AmbientIntensity' (temp float) + + +Linked fragment stage: + + +Shader version: 450 +gl_FragCoord origin is upper left +0:? Sequence +0:1 move second child to first child (temp 4-component vector of float) +0:1 'AmbientColor' (temp 4-component vector of float) +0:? Constant: +0:? 1.000000 +0:? 0.500000 +0:? 0.000000 +0:? 1.000000 +0:2 move second child to first child (temp float) +0:2 'AmbientIntensity' (temp float) +0:2 Constant: +0:2 0.100000 +0:13 Function Definition: PixelShaderFunction(vf4; (temp 4-component vector of float) +0:5 Function Parameters: +0:5 'input' (temp 4-component vector of float) +0:? Sequence +0:6 Branch: Return with expression +0:6 add (temp 4-component vector of float) +0:6 vector-scale (temp 4-component vector of float) +0:6 'input' (temp 4-component vector of float) +0:6 'AmbientIntensity' (temp float) +0:6 'AmbientColor' (temp 4-component vector of float) +0:7 Branch: Return with expression +0:7 add (temp 4-component vector of float) +0:7 component-wise multiply (temp 4-component vector of float) +0:7 'input' (temp 4-component vector of float) +0:7 'input' (temp 4-component vector of float) +0:7 component-wise multiply (temp 4-component vector of float) +0:7 'input' (temp 4-component vector of float) +0:7 'input' (temp 4-component vector of float) +0:8 Branch: Return with expression +0:8 add (temp 4-component vector of float) +0:8 add (temp 4-component vector of float) +0:8 'input' (temp 4-component vector of float) +0:8 component-wise multiply (temp 4-component vector of float) +0:8 'input' (temp 4-component vector of float) +0:8 'input' (temp 4-component vector of float) +0:8 'input' (temp 4-component vector of float) +0:9 Branch: Return with expression +0:9 component-wise multiply (temp 4-component vector of float) +0:9 Pre-Increment (temp 4-component vector of float) +0:9 'input' (temp 4-component vector of float) +0:9 Negate value (temp 4-component vector of float) +0:9 Negate value (temp 4-component vector of float) +0:9 Pre-Decrement (temp 4-component vector of float) +0:9 'input' (temp 4-component vector of float) +0:10 Branch: Return with expression +0:10 add (temp 4-component vector of float) +0:10 Post-Increment (temp 4-component vector of float) +0:10 'input' (temp 4-component vector of float) +0:10 Pre-Increment (temp 4-component vector of float) +0:10 'input' (temp 4-component vector of float) +0:11 Branch: Return with expression +0:11 sine (global 4-component vector of float) +0:11 'input' (temp 4-component vector of float) +0:? Linker Objects +0:? 'AmbientColor' (temp 4-component vector of float) +0:? 'AmbientIntensity' (temp float) + +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 57 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "PixelShaderFunction" + ExecutionMode 4 OriginUpperLeft + Source HLSL 450 + Name 4 "PixelShaderFunction" + Name 9 "input" + Name 12 "AmbientIntensity" + Name 15 "AmbientColor" + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Function 7(fvec4) + 11: TypePointer Function 6(float) + 36: 6(float) Constant 1065353216 +4(PixelShaderFunction): 2 Function None 3 + 5: Label + 9(input): 8(ptr) Variable Function +12(AmbientIntensity): 11(ptr) Variable Function +15(AmbientColor): 8(ptr) Variable Function + 10: 7(fvec4) Load 9(input) + 13: 6(float) Load 12(AmbientIntensity) + 14: 7(fvec4) VectorTimesScalar 10 13 + 16: 7(fvec4) Load 15(AmbientColor) + 17: 7(fvec4) FAdd 14 16 + ReturnValue 17 + FunctionEnd diff --git a/Test/baseResults/hlsl.if.frag.out b/Test/baseResults/hlsl.if.frag.out new file mode 100755 index 00000000..8908279b --- /dev/null +++ b/Test/baseResults/hlsl.if.frag.out @@ -0,0 +1,223 @@ +hlsl.if.frag +Shader version: 450 +gl_FragCoord origin is upper left +0:? Sequence +0:29 Function Definition: PixelShaderFunction(vf4; (temp 4-component vector of float) +0:2 Function Parameters: +0:2 'input' (temp 4-component vector of float) +0:? Sequence +0:3 Test condition and select (temp void) +0:3 Condition +0:3 Compare Equal (temp bool) +0:3 'input' (temp 4-component vector of float) +0:3 'input' (temp 4-component vector of float) +0:3 true case +0:4 Branch: Return with expression +0:4 'input' (temp 4-component vector of float) +0:6 Test condition and select (temp void) +0:6 Condition +0:6 Compare Equal (temp bool) +0:6 'input' (temp 4-component vector of float) +0:6 'input' (temp 4-component vector of float) +0:6 true case +0:7 Branch: Return with expression +0:7 'input' (temp 4-component vector of float) +0:6 false case +0:9 Branch: Return with expression +0:9 Negate value (temp 4-component vector of float) +0:9 'input' (temp 4-component vector of float) +0:11 Test condition and select (temp void) +0:11 Condition +0:11 Compare Equal (temp bool) +0:11 'input' (temp 4-component vector of float) +0:11 'input' (temp 4-component vector of float) +0:11 true case is null +0:14 Test condition and select (temp void) +0:14 Condition +0:14 Compare Equal (temp bool) +0:14 'input' (temp 4-component vector of float) +0:14 'input' (temp 4-component vector of float) +0:14 true case is null +0:19 Test condition and select (temp void) +0:19 Condition +0:19 Compare Equal (temp bool) +0:19 'input' (temp 4-component vector of float) +0:19 'input' (temp 4-component vector of float) +0:19 true case +0:? Sequence +0:20 Branch: Return with expression +0:20 'input' (temp 4-component vector of float) +0:23 Test condition and select (temp void) +0:23 Condition +0:23 Compare Equal (temp bool) +0:23 'input' (temp 4-component vector of float) +0:23 'input' (temp 4-component vector of float) +0:23 true case +0:? Sequence +0:24 Branch: Return with expression +0:24 'input' (temp 4-component vector of float) +0:23 false case +0:? Sequence +0:26 Branch: Return with expression +0:26 Negate value (temp 4-component vector of float) +0:26 'input' (temp 4-component vector of float) +0:? Linker Objects + + +Linked fragment stage: + + +Shader version: 450 +gl_FragCoord origin is upper left +0:? Sequence +0:29 Function Definition: PixelShaderFunction(vf4; (temp 4-component vector of float) +0:2 Function Parameters: +0:2 'input' (temp 4-component vector of float) +0:? Sequence +0:3 Test condition and select (temp void) +0:3 Condition +0:3 Compare Equal (temp bool) +0:3 'input' (temp 4-component vector of float) +0:3 'input' (temp 4-component vector of float) +0:3 true case +0:4 Branch: Return with expression +0:4 'input' (temp 4-component vector of float) +0:6 Test condition and select (temp void) +0:6 Condition +0:6 Compare Equal (temp bool) +0:6 'input' (temp 4-component vector of float) +0:6 'input' (temp 4-component vector of float) +0:6 true case +0:7 Branch: Return with expression +0:7 'input' (temp 4-component vector of float) +0:6 false case +0:9 Branch: Return with expression +0:9 Negate value (temp 4-component vector of float) +0:9 'input' (temp 4-component vector of float) +0:11 Test condition and select (temp void) +0:11 Condition +0:11 Compare Equal (temp bool) +0:11 'input' (temp 4-component vector of float) +0:11 'input' (temp 4-component vector of float) +0:11 true case is null +0:14 Test condition and select (temp void) +0:14 Condition +0:14 Compare Equal (temp bool) +0:14 'input' (temp 4-component vector of float) +0:14 'input' (temp 4-component vector of float) +0:14 true case is null +0:19 Test condition and select (temp void) +0:19 Condition +0:19 Compare Equal (temp bool) +0:19 'input' (temp 4-component vector of float) +0:19 'input' (temp 4-component vector of float) +0:19 true case +0:? Sequence +0:20 Branch: Return with expression +0:20 'input' (temp 4-component vector of float) +0:23 Test condition and select (temp void) +0:23 Condition +0:23 Compare Equal (temp bool) +0:23 'input' (temp 4-component vector of float) +0:23 'input' (temp 4-component vector of float) +0:23 true case +0:? Sequence +0:24 Branch: Return with expression +0:24 'input' (temp 4-component vector of float) +0:23 false case +0:? Sequence +0:26 Branch: Return with expression +0:26 Negate value (temp 4-component vector of float) +0:26 'input' (temp 4-component vector of float) +0:? Linker Objects + +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 64 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "PixelShaderFunction" + ExecutionMode 4 OriginUpperLeft + Source HLSL 450 + Name 4 "PixelShaderFunction" + Name 9 "input" + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Function 7(fvec4) + 12: TypeBool + 13: TypeVector 12(bool) 4 +4(PixelShaderFunction): 2 Function None 3 + 5: Label + 9(input): 8(ptr) Variable Function + 10: 7(fvec4) Load 9(input) + 11: 7(fvec4) Load 9(input) + 14: 13(bvec4) FOrdEqual 10 11 + 15: 12(bool) All 14 + SelectionMerge 17 None + BranchConditional 15 16 17 + 16: Label + 18: 7(fvec4) Load 9(input) + ReturnValue 18 + 17: Label + 20: 7(fvec4) Load 9(input) + 21: 7(fvec4) Load 9(input) + 22: 13(bvec4) FOrdEqual 20 21 + 23: 12(bool) All 22 + SelectionMerge 25 None + BranchConditional 23 24 28 + 24: Label + 26: 7(fvec4) Load 9(input) + ReturnValue 26 + 28: Label + 29: 7(fvec4) Load 9(input) + 30: 7(fvec4) FNegate 29 + ReturnValue 30 + 25: Label + 32: 7(fvec4) Load 9(input) + 33: 7(fvec4) Load 9(input) + 34: 13(bvec4) FOrdEqual 32 33 + 35: 12(bool) All 34 + SelectionMerge 37 None + BranchConditional 35 36 37 + 36: Label + Branch 37 + 37: Label + 38: 7(fvec4) Load 9(input) + 39: 7(fvec4) Load 9(input) + 40: 13(bvec4) FOrdEqual 38 39 + 41: 12(bool) All 40 + SelectionMerge 43 None + BranchConditional 41 42 43 + 42: Label + Branch 43 + 43: Label + 44: 7(fvec4) Load 9(input) + 45: 7(fvec4) Load 9(input) + 46: 13(bvec4) FOrdEqual 44 45 + 47: 12(bool) All 46 + SelectionMerge 49 None + BranchConditional 47 48 49 + 48: Label + 50: 7(fvec4) Load 9(input) + ReturnValue 50 + 49: Label + 52: 7(fvec4) Load 9(input) + 53: 7(fvec4) Load 9(input) + 54: 13(bvec4) FOrdEqual 52 53 + 55: 12(bool) All 54 + SelectionMerge 57 None + BranchConditional 55 56 60 + 56: Label + 58: 7(fvec4) Load 9(input) + ReturnValue 58 + 60: Label + 61: 7(fvec4) Load 9(input) + 62: 7(fvec4) FNegate 61 + ReturnValue 62 + 57: Label + Return + FunctionEnd diff --git a/Test/baseResults/hlsl.intrinsics.frag.out b/Test/baseResults/hlsl.intrinsics.frag.out new file mode 100644 index 00000000..ec057844 --- /dev/null +++ b/Test/baseResults/hlsl.intrinsics.frag.out @@ -0,0 +1,2178 @@ +hlsl.intrinsics.frag +Shader version: 450 +gl_FragCoord origin is upper left +0:? Sequence +0:62 Function Definition: PixelShaderFunction(f1;f1;f1; (temp float) +0:2 Function Parameters: +0:2 'inF0' (temp float) +0:2 'inF1' (temp float) +0:2 'inF2' (temp float) +0:? Sequence +0:3 all (global bool) +0:3 'inF0' (temp float) +0:4 Absolute value (global float) +0:4 'inF0' (temp float) +0:5 arc cosine (global float) +0:5 'inF0' (temp float) +0:6 any (global bool) +0:6 'inF0' (temp float) +0:7 arc sine (global float) +0:7 'inF0' (temp float) +0:8 arc tangent (global float) +0:8 'inF0' (temp float) +0:9 arc tangent (global float) +0:9 'inF0' (temp float) +0:9 'inF1' (temp float) +0:10 Ceiling (global float) +0:10 'inF0' (temp float) +0:11 clamp (global float) +0:11 'inF0' (temp float) +0:11 'inF1' (temp float) +0:11 'inF2' (temp float) +0:12 cosine (global float) +0:12 'inF0' (temp float) +0:13 hyp. cosine (global float) +0:13 'inF0' (temp float) +0:14 bitCount (global uint) +0:14 Constant: +0:14 7 (const uint) +0:15 dPdx (global float) +0:15 'inF0' (temp float) +0:16 dPdxCoarse (global float) +0:16 'inF0' (temp float) +0:17 dPdxFine (global float) +0:17 'inF0' (temp float) +0:18 dPdy (global float) +0:18 'inF0' (temp float) +0:19 dPdyCoarse (global float) +0:19 'inF0' (temp float) +0:20 dPdyFine (global float) +0:20 'inF0' (temp float) +0:21 degrees (global float) +0:21 'inF0' (temp float) +0:25 exp (global float) +0:25 'inF0' (temp float) +0:26 exp2 (global float) +0:26 'inF0' (temp float) +0:27 findMSB (global int) +0:27 Constant: +0:27 7 (const int) +0:28 findLSB (global int) +0:28 Constant: +0:28 7 (const int) +0:29 Floor (global float) +0:29 'inF0' (temp float) +0:31 Function Call: fmod(f1;f1; (global float) +0:31 'inF0' (temp float) +0:31 'inF1' (temp float) +0:32 Fraction (global float) +0:32 'inF0' (temp float) +0:33 frexp (global float) +0:33 'inF0' (temp float) +0:33 'inF1' (temp float) +0:34 fwidth (global float) +0:34 'inF0' (temp float) +0:35 isinf (global bool) +0:35 'inF0' (temp float) +0:36 isnan (global bool) +0:36 'inF0' (temp float) +0:37 ldexp (global float) +0:37 'inF0' (temp float) +0:37 'inF1' (temp float) +0:38 log (global float) +0:38 'inF0' (temp float) +0:39 log2 (global float) +0:39 'inF0' (temp float) +0:40 max (global float) +0:40 'inF0' (temp float) +0:40 'inF1' (temp float) +0:41 min (global float) +0:41 'inF0' (temp float) +0:41 'inF1' (temp float) +0:43 pow (global float) +0:43 'inF0' (temp float) +0:43 'inF1' (temp float) +0:44 radians (global float) +0:44 'inF0' (temp float) +0:45 bitFieldReverse (global uint) +0:45 Constant: +0:45 2 (const uint) +0:46 roundEven (global float) +0:46 'inF0' (temp float) +0:47 inverse sqrt (global float) +0:47 'inF0' (temp float) +0:48 Sign (global float) +0:48 'inF0' (temp float) +0:49 sine (global float) +0:49 'inF0' (temp float) +0:50 hyp. sine (global float) +0:50 'inF0' (temp float) +0:51 smoothstep (global float) +0:51 'inF0' (temp float) +0:51 'inF1' (temp float) +0:51 'inF2' (temp float) +0:52 sqrt (global float) +0:52 'inF0' (temp float) +0:53 step (global float) +0:53 'inF0' (temp float) +0:53 'inF1' (temp float) +0:54 tangent (global float) +0:54 'inF0' (temp float) +0:55 hyp. tangent (global float) +0:55 'inF0' (temp float) +0:57 trunc (global float) +0:57 'inF0' (temp float) +0:59 Branch: Return with expression +0:59 Constant: +0:59 0.000000 +0:68 Function Definition: PixelShaderFunction(vf1;vf1;vf1; (temp 1-component vector of float) +0:63 Function Parameters: +0:63 'inF0' (temp 1-component vector of float) +0:63 'inF1' (temp 1-component vector of float) +0:63 'inF2' (temp 1-component vector of float) +0:? Sequence +0:65 Branch: Return with expression +0:65 Constant: +0:65 0.000000 +0:137 Function Definition: PixelShaderFunction(vf2;vf2;vf2; (temp 2-component vector of float) +0:69 Function Parameters: +0:69 'inF0' (temp 2-component vector of float) +0:69 'inF1' (temp 2-component vector of float) +0:69 'inF2' (temp 2-component vector of float) +0:? Sequence +0:70 all (global bool) +0:70 'inF0' (temp 2-component vector of float) +0:71 Absolute value (global 2-component vector of float) +0:71 'inF0' (temp 2-component vector of float) +0:72 arc cosine (global 2-component vector of float) +0:72 'inF0' (temp 2-component vector of float) +0:73 any (global bool) +0:73 'inF0' (temp 2-component vector of float) +0:74 arc sine (global 2-component vector of float) +0:74 'inF0' (temp 2-component vector of float) +0:75 arc tangent (global 2-component vector of float) +0:75 'inF0' (temp 2-component vector of float) +0:76 arc tangent (global 2-component vector of float) +0:76 'inF0' (temp 2-component vector of float) +0:76 'inF1' (temp 2-component vector of float) +0:77 Ceiling (global 2-component vector of float) +0:77 'inF0' (temp 2-component vector of float) +0:78 clamp (global 2-component vector of float) +0:78 'inF0' (temp 2-component vector of float) +0:78 'inF1' (temp 2-component vector of float) +0:78 'inF2' (temp 2-component vector of float) +0:79 cosine (global 2-component vector of float) +0:79 'inF0' (temp 2-component vector of float) +0:80 hyp. cosine (global 2-component vector of float) +0:80 'inF0' (temp 2-component vector of float) +0:? bitCount (global 2-component vector of uint) +0:? Constant: +0:? 7 (const uint) +0:? 3 (const uint) +0:82 dPdx (global 2-component vector of float) +0:82 'inF0' (temp 2-component vector of float) +0:83 dPdxCoarse (global 2-component vector of float) +0:83 'inF0' (temp 2-component vector of float) +0:84 dPdxFine (global 2-component vector of float) +0:84 'inF0' (temp 2-component vector of float) +0:85 dPdy (global 2-component vector of float) +0:85 'inF0' (temp 2-component vector of float) +0:86 dPdyCoarse (global 2-component vector of float) +0:86 'inF0' (temp 2-component vector of float) +0:87 dPdyFine (global 2-component vector of float) +0:87 'inF0' (temp 2-component vector of float) +0:88 degrees (global 2-component vector of float) +0:88 'inF0' (temp 2-component vector of float) +0:89 distance (global float) +0:89 'inF0' (temp 2-component vector of float) +0:89 'inF1' (temp 2-component vector of float) +0:90 dot-product (global float) +0:90 'inF0' (temp 2-component vector of float) +0:90 'inF1' (temp 2-component vector of float) +0:94 exp (global 2-component vector of float) +0:94 'inF0' (temp 2-component vector of float) +0:95 exp2 (global 2-component vector of float) +0:95 'inF0' (temp 2-component vector of float) +0:96 face-forward (global 2-component vector of float) +0:96 'inF0' (temp 2-component vector of float) +0:96 'inF1' (temp 2-component vector of float) +0:96 'inF2' (temp 2-component vector of float) +0:97 findMSB (global int) +0:97 Constant: +0:97 7 (const int) +0:98 findLSB (global int) +0:98 Constant: +0:98 7 (const int) +0:99 Floor (global 2-component vector of float) +0:99 'inF0' (temp 2-component vector of float) +0:101 Function Call: fmod(vf2;vf2; (global 2-component vector of float) +0:101 'inF0' (temp 2-component vector of float) +0:101 'inF1' (temp 2-component vector of float) +0:102 Fraction (global 2-component vector of float) +0:102 'inF0' (temp 2-component vector of float) +0:103 frexp (global 2-component vector of float) +0:103 'inF0' (temp 2-component vector of float) +0:103 'inF1' (temp 2-component vector of float) +0:104 fwidth (global 2-component vector of float) +0:104 'inF0' (temp 2-component vector of float) +0:105 isinf (global 2-component vector of bool) +0:105 'inF0' (temp 2-component vector of float) +0:106 isnan (global 2-component vector of bool) +0:106 'inF0' (temp 2-component vector of float) +0:107 ldexp (global 2-component vector of float) +0:107 'inF0' (temp 2-component vector of float) +0:107 'inF1' (temp 2-component vector of float) +0:108 length (global float) +0:108 'inF0' (temp 2-component vector of float) +0:109 log (global 2-component vector of float) +0:109 'inF0' (temp 2-component vector of float) +0:110 log2 (global 2-component vector of float) +0:110 'inF0' (temp 2-component vector of float) +0:111 max (global 2-component vector of float) +0:111 'inF0' (temp 2-component vector of float) +0:111 'inF1' (temp 2-component vector of float) +0:112 min (global 2-component vector of float) +0:112 'inF0' (temp 2-component vector of float) +0:112 'inF1' (temp 2-component vector of float) +0:114 normalize (global 2-component vector of float) +0:114 'inF0' (temp 2-component vector of float) +0:115 pow (global 2-component vector of float) +0:115 'inF0' (temp 2-component vector of float) +0:115 'inF1' (temp 2-component vector of float) +0:116 radians (global 2-component vector of float) +0:116 'inF0' (temp 2-component vector of float) +0:117 reflect (global 2-component vector of float) +0:117 'inF0' (temp 2-component vector of float) +0:117 'inF1' (temp 2-component vector of float) +0:118 refract (global 2-component vector of float) +0:118 'inF0' (temp 2-component vector of float) +0:118 'inF1' (temp 2-component vector of float) +0:118 Constant: +0:118 2.000000 +0:? bitFieldReverse (global 2-component vector of uint) +0:? Constant: +0:? 1 (const uint) +0:? 2 (const uint) +0:120 roundEven (global 2-component vector of float) +0:120 'inF0' (temp 2-component vector of float) +0:121 inverse sqrt (global 2-component vector of float) +0:121 'inF0' (temp 2-component vector of float) +0:122 Sign (global 2-component vector of float) +0:122 'inF0' (temp 2-component vector of float) +0:123 sine (global 2-component vector of float) +0:123 'inF0' (temp 2-component vector of float) +0:124 hyp. sine (global 2-component vector of float) +0:124 'inF0' (temp 2-component vector of float) +0:125 smoothstep (global 2-component vector of float) +0:125 'inF0' (temp 2-component vector of float) +0:125 'inF1' (temp 2-component vector of float) +0:125 'inF2' (temp 2-component vector of float) +0:126 sqrt (global 2-component vector of float) +0:126 'inF0' (temp 2-component vector of float) +0:127 step (global 2-component vector of float) +0:127 'inF0' (temp 2-component vector of float) +0:127 'inF1' (temp 2-component vector of float) +0:128 tangent (global 2-component vector of float) +0:128 'inF0' (temp 2-component vector of float) +0:129 hyp. tangent (global 2-component vector of float) +0:129 'inF0' (temp 2-component vector of float) +0:131 trunc (global 2-component vector of float) +0:131 'inF0' (temp 2-component vector of float) +0:134 Branch: Return with expression +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:207 Function Definition: PixelShaderFunction(vf3;vf3;vf3; (temp 3-component vector of float) +0:138 Function Parameters: +0:138 'inF0' (temp 3-component vector of float) +0:138 'inF1' (temp 3-component vector of float) +0:138 'inF2' (temp 3-component vector of float) +0:? Sequence +0:139 all (global bool) +0:139 'inF0' (temp 3-component vector of float) +0:140 Absolute value (global 3-component vector of float) +0:140 'inF0' (temp 3-component vector of float) +0:141 arc cosine (global 3-component vector of float) +0:141 'inF0' (temp 3-component vector of float) +0:142 any (global bool) +0:142 'inF0' (temp 3-component vector of float) +0:143 arc sine (global 3-component vector of float) +0:143 'inF0' (temp 3-component vector of float) +0:144 arc tangent (global 3-component vector of float) +0:144 'inF0' (temp 3-component vector of float) +0:145 arc tangent (global 3-component vector of float) +0:145 'inF0' (temp 3-component vector of float) +0:145 'inF1' (temp 3-component vector of float) +0:146 Ceiling (global 3-component vector of float) +0:146 'inF0' (temp 3-component vector of float) +0:147 clamp (global 3-component vector of float) +0:147 'inF0' (temp 3-component vector of float) +0:147 'inF1' (temp 3-component vector of float) +0:147 'inF2' (temp 3-component vector of float) +0:148 cosine (global 3-component vector of float) +0:148 'inF0' (temp 3-component vector of float) +0:149 hyp. cosine (global 3-component vector of float) +0:149 'inF0' (temp 3-component vector of float) +0:? bitCount (global 3-component vector of uint) +0:? Constant: +0:? 7 (const uint) +0:? 3 (const uint) +0:? 5 (const uint) +0:151 cross-product (global 3-component vector of float) +0:151 'inF0' (temp 3-component vector of float) +0:151 'inF1' (temp 3-component vector of float) +0:152 dPdx (global 3-component vector of float) +0:152 'inF0' (temp 3-component vector of float) +0:153 dPdxCoarse (global 3-component vector of float) +0:153 'inF0' (temp 3-component vector of float) +0:154 dPdxFine (global 3-component vector of float) +0:154 'inF0' (temp 3-component vector of float) +0:155 dPdy (global 3-component vector of float) +0:155 'inF0' (temp 3-component vector of float) +0:156 dPdyCoarse (global 3-component vector of float) +0:156 'inF0' (temp 3-component vector of float) +0:157 dPdyFine (global 3-component vector of float) +0:157 'inF0' (temp 3-component vector of float) +0:158 degrees (global 3-component vector of float) +0:158 'inF0' (temp 3-component vector of float) +0:159 distance (global float) +0:159 'inF0' (temp 3-component vector of float) +0:159 'inF1' (temp 3-component vector of float) +0:160 dot-product (global float) +0:160 'inF0' (temp 3-component vector of float) +0:160 'inF1' (temp 3-component vector of float) +0:164 exp (global 3-component vector of float) +0:164 'inF0' (temp 3-component vector of float) +0:165 exp2 (global 3-component vector of float) +0:165 'inF0' (temp 3-component vector of float) +0:166 face-forward (global 3-component vector of float) +0:166 'inF0' (temp 3-component vector of float) +0:166 'inF1' (temp 3-component vector of float) +0:166 'inF2' (temp 3-component vector of float) +0:167 findMSB (global int) +0:167 Constant: +0:167 7 (const int) +0:168 findLSB (global int) +0:168 Constant: +0:168 7 (const int) +0:169 Floor (global 3-component vector of float) +0:169 'inF0' (temp 3-component vector of float) +0:171 Function Call: fmod(vf3;vf3; (global 3-component vector of float) +0:171 'inF0' (temp 3-component vector of float) +0:171 'inF1' (temp 3-component vector of float) +0:172 Fraction (global 3-component vector of float) +0:172 'inF0' (temp 3-component vector of float) +0:173 frexp (global 3-component vector of float) +0:173 'inF0' (temp 3-component vector of float) +0:173 'inF1' (temp 3-component vector of float) +0:174 fwidth (global 3-component vector of float) +0:174 'inF0' (temp 3-component vector of float) +0:175 isinf (global 3-component vector of bool) +0:175 'inF0' (temp 3-component vector of float) +0:176 isnan (global 3-component vector of bool) +0:176 'inF0' (temp 3-component vector of float) +0:177 ldexp (global 3-component vector of float) +0:177 'inF0' (temp 3-component vector of float) +0:177 'inF1' (temp 3-component vector of float) +0:178 length (global float) +0:178 'inF0' (temp 3-component vector of float) +0:179 log (global 3-component vector of float) +0:179 'inF0' (temp 3-component vector of float) +0:180 log2 (global 3-component vector of float) +0:180 'inF0' (temp 3-component vector of float) +0:181 max (global 3-component vector of float) +0:181 'inF0' (temp 3-component vector of float) +0:181 'inF1' (temp 3-component vector of float) +0:182 min (global 3-component vector of float) +0:182 'inF0' (temp 3-component vector of float) +0:182 'inF1' (temp 3-component vector of float) +0:184 normalize (global 3-component vector of float) +0:184 'inF0' (temp 3-component vector of float) +0:185 pow (global 3-component vector of float) +0:185 'inF0' (temp 3-component vector of float) +0:185 'inF1' (temp 3-component vector of float) +0:186 radians (global 3-component vector of float) +0:186 'inF0' (temp 3-component vector of float) +0:187 reflect (global 3-component vector of float) +0:187 'inF0' (temp 3-component vector of float) +0:187 'inF1' (temp 3-component vector of float) +0:188 refract (global 3-component vector of float) +0:188 'inF0' (temp 3-component vector of float) +0:188 'inF1' (temp 3-component vector of float) +0:188 Constant: +0:188 2.000000 +0:? bitFieldReverse (global 3-component vector of uint) +0:? Constant: +0:? 1 (const uint) +0:? 2 (const uint) +0:? 3 (const uint) +0:190 roundEven (global 3-component vector of float) +0:190 'inF0' (temp 3-component vector of float) +0:191 inverse sqrt (global 3-component vector of float) +0:191 'inF0' (temp 3-component vector of float) +0:192 Sign (global 3-component vector of float) +0:192 'inF0' (temp 3-component vector of float) +0:193 sine (global 3-component vector of float) +0:193 'inF0' (temp 3-component vector of float) +0:194 hyp. sine (global 3-component vector of float) +0:194 'inF0' (temp 3-component vector of float) +0:195 smoothstep (global 3-component vector of float) +0:195 'inF0' (temp 3-component vector of float) +0:195 'inF1' (temp 3-component vector of float) +0:195 'inF2' (temp 3-component vector of float) +0:196 sqrt (global 3-component vector of float) +0:196 'inF0' (temp 3-component vector of float) +0:197 step (global 3-component vector of float) +0:197 'inF0' (temp 3-component vector of float) +0:197 'inF1' (temp 3-component vector of float) +0:198 tangent (global 3-component vector of float) +0:198 'inF0' (temp 3-component vector of float) +0:199 hyp. tangent (global 3-component vector of float) +0:199 'inF0' (temp 3-component vector of float) +0:201 trunc (global 3-component vector of float) +0:201 'inF0' (temp 3-component vector of float) +0:204 Branch: Return with expression +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:328 Function Definition: PixelShaderFunction(vf4;vf4;vf4; (temp 4-component vector of float) +0:208 Function Parameters: +0:208 'inF0' (temp 4-component vector of float) +0:208 'inF1' (temp 4-component vector of float) +0:208 'inF2' (temp 4-component vector of float) +0:? Sequence +0:209 all (global bool) +0:209 'inF0' (temp 4-component vector of float) +0:210 Absolute value (global 4-component vector of float) +0:210 'inF0' (temp 4-component vector of float) +0:211 arc cosine (global 4-component vector of float) +0:211 'inF0' (temp 4-component vector of float) +0:212 any (global bool) +0:212 'inF0' (temp 4-component vector of float) +0:213 arc sine (global 4-component vector of float) +0:213 'inF0' (temp 4-component vector of float) +0:214 arc tangent (global 4-component vector of float) +0:214 'inF0' (temp 4-component vector of float) +0:215 arc tangent (global 4-component vector of float) +0:215 'inF0' (temp 4-component vector of float) +0:215 'inF1' (temp 4-component vector of float) +0:216 Ceiling (global 4-component vector of float) +0:216 'inF0' (temp 4-component vector of float) +0:217 clamp (global 4-component vector of float) +0:217 'inF0' (temp 4-component vector of float) +0:217 'inF1' (temp 4-component vector of float) +0:217 'inF2' (temp 4-component vector of float) +0:218 cosine (global 4-component vector of float) +0:218 'inF0' (temp 4-component vector of float) +0:219 hyp. cosine (global 4-component vector of float) +0:219 'inF0' (temp 4-component vector of float) +0:? bitCount (global 4-component vector of uint) +0:? Constant: +0:? 7 (const uint) +0:? 3 (const uint) +0:? 5 (const uint) +0:? 2 (const uint) +0:221 dPdx (global 4-component vector of float) +0:221 'inF0' (temp 4-component vector of float) +0:222 dPdxCoarse (global 4-component vector of float) +0:222 'inF0' (temp 4-component vector of float) +0:223 dPdxFine (global 4-component vector of float) +0:223 'inF0' (temp 4-component vector of float) +0:224 dPdy (global 4-component vector of float) +0:224 'inF0' (temp 4-component vector of float) +0:225 dPdyCoarse (global 4-component vector of float) +0:225 'inF0' (temp 4-component vector of float) +0:226 dPdyFine (global 4-component vector of float) +0:226 'inF0' (temp 4-component vector of float) +0:227 degrees (global 4-component vector of float) +0:227 'inF0' (temp 4-component vector of float) +0:228 distance (global float) +0:228 'inF0' (temp 4-component vector of float) +0:228 'inF1' (temp 4-component vector of float) +0:229 dot-product (global float) +0:229 'inF0' (temp 4-component vector of float) +0:229 'inF1' (temp 4-component vector of float) +0:233 exp (global 4-component vector of float) +0:233 'inF0' (temp 4-component vector of float) +0:234 exp2 (global 4-component vector of float) +0:234 'inF0' (temp 4-component vector of float) +0:235 face-forward (global 4-component vector of float) +0:235 'inF0' (temp 4-component vector of float) +0:235 'inF1' (temp 4-component vector of float) +0:235 'inF2' (temp 4-component vector of float) +0:236 findMSB (global int) +0:236 Constant: +0:236 7 (const int) +0:237 findLSB (global int) +0:237 Constant: +0:237 7 (const int) +0:238 Floor (global 4-component vector of float) +0:238 'inF0' (temp 4-component vector of float) +0:240 Function Call: fmod(vf4;vf4; (global 4-component vector of float) +0:240 'inF0' (temp 4-component vector of float) +0:240 'inF1' (temp 4-component vector of float) +0:241 Fraction (global 4-component vector of float) +0:241 'inF0' (temp 4-component vector of float) +0:242 frexp (global 4-component vector of float) +0:242 'inF0' (temp 4-component vector of float) +0:242 'inF1' (temp 4-component vector of float) +0:243 fwidth (global 4-component vector of float) +0:243 'inF0' (temp 4-component vector of float) +0:244 isinf (global 4-component vector of bool) +0:244 'inF0' (temp 4-component vector of float) +0:245 isnan (global 4-component vector of bool) +0:245 'inF0' (temp 4-component vector of float) +0:246 ldexp (global 4-component vector of float) +0:246 'inF0' (temp 4-component vector of float) +0:246 'inF1' (temp 4-component vector of float) +0:247 length (global float) +0:247 'inF0' (temp 4-component vector of float) +0:248 log (global 4-component vector of float) +0:248 'inF0' (temp 4-component vector of float) +0:249 log2 (global 4-component vector of float) +0:249 'inF0' (temp 4-component vector of float) +0:250 max (global 4-component vector of float) +0:250 'inF0' (temp 4-component vector of float) +0:250 'inF1' (temp 4-component vector of float) +0:251 min (global 4-component vector of float) +0:251 'inF0' (temp 4-component vector of float) +0:251 'inF1' (temp 4-component vector of float) +0:253 normalize (global 4-component vector of float) +0:253 'inF0' (temp 4-component vector of float) +0:254 pow (global 4-component vector of float) +0:254 'inF0' (temp 4-component vector of float) +0:254 'inF1' (temp 4-component vector of float) +0:255 radians (global 4-component vector of float) +0:255 'inF0' (temp 4-component vector of float) +0:256 reflect (global 4-component vector of float) +0:256 'inF0' (temp 4-component vector of float) +0:256 'inF1' (temp 4-component vector of float) +0:257 refract (global 4-component vector of float) +0:257 'inF0' (temp 4-component vector of float) +0:257 'inF1' (temp 4-component vector of float) +0:257 Constant: +0:257 2.000000 +0:? bitFieldReverse (global 4-component vector of uint) +0:? Constant: +0:? 1 (const uint) +0:? 2 (const uint) +0:? 3 (const uint) +0:? 4 (const uint) +0:259 roundEven (global 4-component vector of float) +0:259 'inF0' (temp 4-component vector of float) +0:260 inverse sqrt (global 4-component vector of float) +0:260 'inF0' (temp 4-component vector of float) +0:261 Sign (global 4-component vector of float) +0:261 'inF0' (temp 4-component vector of float) +0:262 sine (global 4-component vector of float) +0:262 'inF0' (temp 4-component vector of float) +0:263 hyp. sine (global 4-component vector of float) +0:263 'inF0' (temp 4-component vector of float) +0:264 smoothstep (global 4-component vector of float) +0:264 'inF0' (temp 4-component vector of float) +0:264 'inF1' (temp 4-component vector of float) +0:264 'inF2' (temp 4-component vector of float) +0:265 sqrt (global 4-component vector of float) +0:265 'inF0' (temp 4-component vector of float) +0:266 step (global 4-component vector of float) +0:266 'inF0' (temp 4-component vector of float) +0:266 'inF1' (temp 4-component vector of float) +0:267 tangent (global 4-component vector of float) +0:267 'inF0' (temp 4-component vector of float) +0:268 hyp. tangent (global 4-component vector of float) +0:268 'inF0' (temp 4-component vector of float) +0:270 trunc (global 4-component vector of float) +0:270 'inF0' (temp 4-component vector of float) +0:273 Branch: Return with expression +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:? 4.000000 +0:337 Function Definition: PixelShaderFunction(mf22;mf22;mf22; (temp 2X2 matrix of float) +0:329 Function Parameters: +0:329 'inF0' (temp 2X2 matrix of float) +0:329 'inF1' (temp 2X2 matrix of float) +0:329 'inF2' (temp 2X2 matrix of float) +0:? Sequence +0:331 all (global bool) +0:331 'inF0' (temp 2X2 matrix of float) +0:331 Absolute value (global 2X2 matrix of float) +0:331 'inF0' (temp 2X2 matrix of float) +0:331 arc cosine (global 2X2 matrix of float) +0:331 'inF0' (temp 2X2 matrix of float) +0:331 any (global bool) +0:331 'inF0' (temp 2X2 matrix of float) +0:331 arc sine (global 2X2 matrix of float) +0:331 'inF0' (temp 2X2 matrix of float) +0:331 arc tangent (global 2X2 matrix of float) +0:331 'inF0' (temp 2X2 matrix of float) +0:331 arc tangent (global 2X2 matrix of float) +0:331 'inF0' (temp 2X2 matrix of float) +0:331 'inF1' (temp 2X2 matrix of float) +0:331 Ceiling (global 2X2 matrix of float) +0:331 'inF0' (temp 2X2 matrix of float) +0:331 clamp (global 2X2 matrix of float) +0:331 'inF0' (temp 2X2 matrix of float) +0:331 'inF1' (temp 2X2 matrix of float) +0:331 'inF2' (temp 2X2 matrix of float) +0:331 cosine (global 2X2 matrix of float) +0:331 'inF0' (temp 2X2 matrix of float) +0:331 hyp. cosine (global 2X2 matrix of float) +0:331 'inF0' (temp 2X2 matrix of float) +0:331 dPdx (global 2X2 matrix of float) +0:331 'inF0' (temp 2X2 matrix of float) +0:331 dPdxCoarse (global 2X2 matrix of float) +0:331 'inF0' (temp 2X2 matrix of float) +0:331 dPdxFine (global 2X2 matrix of float) +0:331 'inF0' (temp 2X2 matrix of float) +0:331 dPdy (global 2X2 matrix of float) +0:331 'inF0' (temp 2X2 matrix of float) +0:331 dPdyCoarse (global 2X2 matrix of float) +0:331 'inF0' (temp 2X2 matrix of float) +0:331 dPdyFine (global 2X2 matrix of float) +0:331 'inF0' (temp 2X2 matrix of float) +0:331 degrees (global 2X2 matrix of float) +0:331 'inF0' (temp 2X2 matrix of float) +0:331 determinant (global float) +0:331 'inF0' (temp 2X2 matrix of float) +0:331 exp (global 2X2 matrix of float) +0:331 'inF0' (temp 2X2 matrix of float) +0:331 exp2 (global 2X2 matrix of float) +0:331 'inF0' (temp 2X2 matrix of float) +0:331 findMSB (global int) +0:331 Constant: +0:331 7 (const int) +0:331 findLSB (global int) +0:331 Constant: +0:331 7 (const int) +0:331 Floor (global 2X2 matrix of float) +0:331 'inF0' (temp 2X2 matrix of float) +0:331 Function Call: fmod(mf22;mf22; (global 2X2 matrix of float) +0:331 'inF0' (temp 2X2 matrix of float) +0:331 'inF1' (temp 2X2 matrix of float) +0:331 Fraction (global 2X2 matrix of float) +0:331 'inF0' (temp 2X2 matrix of float) +0:331 frexp (global 2X2 matrix of float) +0:331 'inF0' (temp 2X2 matrix of float) +0:331 'inF1' (temp 2X2 matrix of float) +0:331 fwidth (global 2X2 matrix of float) +0:331 'inF0' (temp 2X2 matrix of float) +0:331 ldexp (global 2X2 matrix of float) +0:331 'inF0' (temp 2X2 matrix of float) +0:331 'inF1' (temp 2X2 matrix of float) +0:331 log (global 2X2 matrix of float) +0:331 'inF0' (temp 2X2 matrix of float) +0:331 log2 (global 2X2 matrix of float) +0:331 'inF0' (temp 2X2 matrix of float) +0:331 max (global 2X2 matrix of float) +0:331 'inF0' (temp 2X2 matrix of float) +0:331 'inF1' (temp 2X2 matrix of float) +0:331 min (global 2X2 matrix of float) +0:331 'inF0' (temp 2X2 matrix of float) +0:331 'inF1' (temp 2X2 matrix of float) +0:331 pow (global 2X2 matrix of float) +0:331 'inF0' (temp 2X2 matrix of float) +0:331 'inF1' (temp 2X2 matrix of float) +0:331 radians (global 2X2 matrix of float) +0:331 'inF0' (temp 2X2 matrix of float) +0:331 roundEven (global 2X2 matrix of float) +0:331 'inF0' (temp 2X2 matrix of float) +0:331 inverse sqrt (global 2X2 matrix of float) +0:331 'inF0' (temp 2X2 matrix of float) +0:331 Sign (global 2X2 matrix of float) +0:331 'inF0' (temp 2X2 matrix of float) +0:331 sine (global 2X2 matrix of float) +0:331 'inF0' (temp 2X2 matrix of float) +0:331 hyp. sine (global 2X2 matrix of float) +0:331 'inF0' (temp 2X2 matrix of float) +0:331 smoothstep (global 2X2 matrix of float) +0:331 'inF0' (temp 2X2 matrix of float) +0:331 'inF1' (temp 2X2 matrix of float) +0:331 'inF2' (temp 2X2 matrix of float) +0:331 sqrt (global 2X2 matrix of float) +0:331 'inF0' (temp 2X2 matrix of float) +0:331 step (global 2X2 matrix of float) +0:331 'inF0' (temp 2X2 matrix of float) +0:331 'inF1' (temp 2X2 matrix of float) +0:331 tangent (global 2X2 matrix of float) +0:331 'inF0' (temp 2X2 matrix of float) +0:331 hyp. tangent (global 2X2 matrix of float) +0:331 'inF0' (temp 2X2 matrix of float) +0:331 transpose (global 2X2 matrix of float) +0:331 'inF0' (temp 2X2 matrix of float) +0:331 trunc (global 2X2 matrix of float) +0:331 'inF0' (temp 2X2 matrix of float) +0:334 Branch: Return with expression +0:? Constant: +0:? 2.000000 +0:? 2.000000 +0:? 2.000000 +0:? 2.000000 +0:346 Function Definition: PixelShaderFunction(mf33;mf33;mf33; (temp 3X3 matrix of float) +0:338 Function Parameters: +0:338 'inF0' (temp 3X3 matrix of float) +0:338 'inF1' (temp 3X3 matrix of float) +0:338 'inF2' (temp 3X3 matrix of float) +0:? Sequence +0:340 all (global bool) +0:340 'inF0' (temp 3X3 matrix of float) +0:340 Absolute value (global 3X3 matrix of float) +0:340 'inF0' (temp 3X3 matrix of float) +0:340 arc cosine (global 3X3 matrix of float) +0:340 'inF0' (temp 3X3 matrix of float) +0:340 any (global bool) +0:340 'inF0' (temp 3X3 matrix of float) +0:340 arc sine (global 3X3 matrix of float) +0:340 'inF0' (temp 3X3 matrix of float) +0:340 arc tangent (global 3X3 matrix of float) +0:340 'inF0' (temp 3X3 matrix of float) +0:340 arc tangent (global 3X3 matrix of float) +0:340 'inF0' (temp 3X3 matrix of float) +0:340 'inF1' (temp 3X3 matrix of float) +0:340 Ceiling (global 3X3 matrix of float) +0:340 'inF0' (temp 3X3 matrix of float) +0:340 clamp (global 3X3 matrix of float) +0:340 'inF0' (temp 3X3 matrix of float) +0:340 'inF1' (temp 3X3 matrix of float) +0:340 'inF2' (temp 3X3 matrix of float) +0:340 cosine (global 3X3 matrix of float) +0:340 'inF0' (temp 3X3 matrix of float) +0:340 hyp. cosine (global 3X3 matrix of float) +0:340 'inF0' (temp 3X3 matrix of float) +0:340 dPdx (global 3X3 matrix of float) +0:340 'inF0' (temp 3X3 matrix of float) +0:340 dPdxCoarse (global 3X3 matrix of float) +0:340 'inF0' (temp 3X3 matrix of float) +0:340 dPdxFine (global 3X3 matrix of float) +0:340 'inF0' (temp 3X3 matrix of float) +0:340 dPdy (global 3X3 matrix of float) +0:340 'inF0' (temp 3X3 matrix of float) +0:340 dPdyCoarse (global 3X3 matrix of float) +0:340 'inF0' (temp 3X3 matrix of float) +0:340 dPdyFine (global 3X3 matrix of float) +0:340 'inF0' (temp 3X3 matrix of float) +0:340 degrees (global 3X3 matrix of float) +0:340 'inF0' (temp 3X3 matrix of float) +0:340 determinant (global float) +0:340 'inF0' (temp 3X3 matrix of float) +0:340 exp (global 3X3 matrix of float) +0:340 'inF0' (temp 3X3 matrix of float) +0:340 exp2 (global 3X3 matrix of float) +0:340 'inF0' (temp 3X3 matrix of float) +0:340 findMSB (global int) +0:340 Constant: +0:340 7 (const int) +0:340 findLSB (global int) +0:340 Constant: +0:340 7 (const int) +0:340 Floor (global 3X3 matrix of float) +0:340 'inF0' (temp 3X3 matrix of float) +0:340 Function Call: fmod(mf33;mf33; (global 3X3 matrix of float) +0:340 'inF0' (temp 3X3 matrix of float) +0:340 'inF1' (temp 3X3 matrix of float) +0:340 Fraction (global 3X3 matrix of float) +0:340 'inF0' (temp 3X3 matrix of float) +0:340 frexp (global 3X3 matrix of float) +0:340 'inF0' (temp 3X3 matrix of float) +0:340 'inF1' (temp 3X3 matrix of float) +0:340 fwidth (global 3X3 matrix of float) +0:340 'inF0' (temp 3X3 matrix of float) +0:340 ldexp (global 3X3 matrix of float) +0:340 'inF0' (temp 3X3 matrix of float) +0:340 'inF1' (temp 3X3 matrix of float) +0:340 log (global 3X3 matrix of float) +0:340 'inF0' (temp 3X3 matrix of float) +0:340 log2 (global 3X3 matrix of float) +0:340 'inF0' (temp 3X3 matrix of float) +0:340 max (global 3X3 matrix of float) +0:340 'inF0' (temp 3X3 matrix of float) +0:340 'inF1' (temp 3X3 matrix of float) +0:340 min (global 3X3 matrix of float) +0:340 'inF0' (temp 3X3 matrix of float) +0:340 'inF1' (temp 3X3 matrix of float) +0:340 pow (global 3X3 matrix of float) +0:340 'inF0' (temp 3X3 matrix of float) +0:340 'inF1' (temp 3X3 matrix of float) +0:340 radians (global 3X3 matrix of float) +0:340 'inF0' (temp 3X3 matrix of float) +0:340 roundEven (global 3X3 matrix of float) +0:340 'inF0' (temp 3X3 matrix of float) +0:340 inverse sqrt (global 3X3 matrix of float) +0:340 'inF0' (temp 3X3 matrix of float) +0:340 Sign (global 3X3 matrix of float) +0:340 'inF0' (temp 3X3 matrix of float) +0:340 sine (global 3X3 matrix of float) +0:340 'inF0' (temp 3X3 matrix of float) +0:340 hyp. sine (global 3X3 matrix of float) +0:340 'inF0' (temp 3X3 matrix of float) +0:340 smoothstep (global 3X3 matrix of float) +0:340 'inF0' (temp 3X3 matrix of float) +0:340 'inF1' (temp 3X3 matrix of float) +0:340 'inF2' (temp 3X3 matrix of float) +0:340 sqrt (global 3X3 matrix of float) +0:340 'inF0' (temp 3X3 matrix of float) +0:340 step (global 3X3 matrix of float) +0:340 'inF0' (temp 3X3 matrix of float) +0:340 'inF1' (temp 3X3 matrix of float) +0:340 tangent (global 3X3 matrix of float) +0:340 'inF0' (temp 3X3 matrix of float) +0:340 hyp. tangent (global 3X3 matrix of float) +0:340 'inF0' (temp 3X3 matrix of float) +0:340 transpose (global 3X3 matrix of float) +0:340 'inF0' (temp 3X3 matrix of float) +0:340 trunc (global 3X3 matrix of float) +0:340 'inF0' (temp 3X3 matrix of float) +0:343 Branch: Return with expression +0:? Constant: +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:354 Function Definition: PixelShaderFunction(mf44;mf44;mf44; (temp 4X4 matrix of float) +0:347 Function Parameters: +0:347 'inF0' (temp 4X4 matrix of float) +0:347 'inF1' (temp 4X4 matrix of float) +0:347 'inF2' (temp 4X4 matrix of float) +0:? Sequence +0:349 all (global bool) +0:349 'inF0' (temp 4X4 matrix of float) +0:349 Absolute value (global 4X4 matrix of float) +0:349 'inF0' (temp 4X4 matrix of float) +0:349 arc cosine (global 4X4 matrix of float) +0:349 'inF0' (temp 4X4 matrix of float) +0:349 any (global bool) +0:349 'inF0' (temp 4X4 matrix of float) +0:349 arc sine (global 4X4 matrix of float) +0:349 'inF0' (temp 4X4 matrix of float) +0:349 arc tangent (global 4X4 matrix of float) +0:349 'inF0' (temp 4X4 matrix of float) +0:349 arc tangent (global 4X4 matrix of float) +0:349 'inF0' (temp 4X4 matrix of float) +0:349 'inF1' (temp 4X4 matrix of float) +0:349 Ceiling (global 4X4 matrix of float) +0:349 'inF0' (temp 4X4 matrix of float) +0:349 clamp (global 4X4 matrix of float) +0:349 'inF0' (temp 4X4 matrix of float) +0:349 'inF1' (temp 4X4 matrix of float) +0:349 'inF2' (temp 4X4 matrix of float) +0:349 cosine (global 4X4 matrix of float) +0:349 'inF0' (temp 4X4 matrix of float) +0:349 hyp. cosine (global 4X4 matrix of float) +0:349 'inF0' (temp 4X4 matrix of float) +0:349 dPdx (global 4X4 matrix of float) +0:349 'inF0' (temp 4X4 matrix of float) +0:349 dPdxCoarse (global 4X4 matrix of float) +0:349 'inF0' (temp 4X4 matrix of float) +0:349 dPdxFine (global 4X4 matrix of float) +0:349 'inF0' (temp 4X4 matrix of float) +0:349 dPdy (global 4X4 matrix of float) +0:349 'inF0' (temp 4X4 matrix of float) +0:349 dPdyCoarse (global 4X4 matrix of float) +0:349 'inF0' (temp 4X4 matrix of float) +0:349 dPdyFine (global 4X4 matrix of float) +0:349 'inF0' (temp 4X4 matrix of float) +0:349 degrees (global 4X4 matrix of float) +0:349 'inF0' (temp 4X4 matrix of float) +0:349 determinant (global float) +0:349 'inF0' (temp 4X4 matrix of float) +0:349 exp (global 4X4 matrix of float) +0:349 'inF0' (temp 4X4 matrix of float) +0:349 exp2 (global 4X4 matrix of float) +0:349 'inF0' (temp 4X4 matrix of float) +0:349 findMSB (global int) +0:349 Constant: +0:349 7 (const int) +0:349 findLSB (global int) +0:349 Constant: +0:349 7 (const int) +0:349 Floor (global 4X4 matrix of float) +0:349 'inF0' (temp 4X4 matrix of float) +0:349 Function Call: fmod(mf44;mf44; (global 4X4 matrix of float) +0:349 'inF0' (temp 4X4 matrix of float) +0:349 'inF1' (temp 4X4 matrix of float) +0:349 Fraction (global 4X4 matrix of float) +0:349 'inF0' (temp 4X4 matrix of float) +0:349 frexp (global 4X4 matrix of float) +0:349 'inF0' (temp 4X4 matrix of float) +0:349 'inF1' (temp 4X4 matrix of float) +0:349 fwidth (global 4X4 matrix of float) +0:349 'inF0' (temp 4X4 matrix of float) +0:349 ldexp (global 4X4 matrix of float) +0:349 'inF0' (temp 4X4 matrix of float) +0:349 'inF1' (temp 4X4 matrix of float) +0:349 log (global 4X4 matrix of float) +0:349 'inF0' (temp 4X4 matrix of float) +0:349 log2 (global 4X4 matrix of float) +0:349 'inF0' (temp 4X4 matrix of float) +0:349 max (global 4X4 matrix of float) +0:349 'inF0' (temp 4X4 matrix of float) +0:349 'inF1' (temp 4X4 matrix of float) +0:349 min (global 4X4 matrix of float) +0:349 'inF0' (temp 4X4 matrix of float) +0:349 'inF1' (temp 4X4 matrix of float) +0:349 pow (global 4X4 matrix of float) +0:349 'inF0' (temp 4X4 matrix of float) +0:349 'inF1' (temp 4X4 matrix of float) +0:349 radians (global 4X4 matrix of float) +0:349 'inF0' (temp 4X4 matrix of float) +0:349 roundEven (global 4X4 matrix of float) +0:349 'inF0' (temp 4X4 matrix of float) +0:349 inverse sqrt (global 4X4 matrix of float) +0:349 'inF0' (temp 4X4 matrix of float) +0:349 Sign (global 4X4 matrix of float) +0:349 'inF0' (temp 4X4 matrix of float) +0:349 sine (global 4X4 matrix of float) +0:349 'inF0' (temp 4X4 matrix of float) +0:349 hyp. sine (global 4X4 matrix of float) +0:349 'inF0' (temp 4X4 matrix of float) +0:349 smoothstep (global 4X4 matrix of float) +0:349 'inF0' (temp 4X4 matrix of float) +0:349 'inF1' (temp 4X4 matrix of float) +0:349 'inF2' (temp 4X4 matrix of float) +0:349 sqrt (global 4X4 matrix of float) +0:349 'inF0' (temp 4X4 matrix of float) +0:349 step (global 4X4 matrix of float) +0:349 'inF0' (temp 4X4 matrix of float) +0:349 'inF1' (temp 4X4 matrix of float) +0:349 tangent (global 4X4 matrix of float) +0:349 'inF0' (temp 4X4 matrix of float) +0:349 hyp. tangent (global 4X4 matrix of float) +0:349 'inF0' (temp 4X4 matrix of float) +0:349 transpose (global 4X4 matrix of float) +0:349 'inF0' (temp 4X4 matrix of float) +0:349 trunc (global 4X4 matrix of float) +0:349 'inF0' (temp 4X4 matrix of float) +0:352 Branch: Return with expression +0:? Constant: +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? Linker Objects + + +Linked fragment stage: + + +Shader version: 450 +gl_FragCoord origin is upper left +0:? Sequence +0:62 Function Definition: PixelShaderFunction(f1;f1;f1; (temp float) +0:2 Function Parameters: +0:2 'inF0' (temp float) +0:2 'inF1' (temp float) +0:2 'inF2' (temp float) +0:? Sequence +0:3 all (global bool) +0:3 'inF0' (temp float) +0:4 Absolute value (global float) +0:4 'inF0' (temp float) +0:5 arc cosine (global float) +0:5 'inF0' (temp float) +0:6 any (global bool) +0:6 'inF0' (temp float) +0:7 arc sine (global float) +0:7 'inF0' (temp float) +0:8 arc tangent (global float) +0:8 'inF0' (temp float) +0:9 arc tangent (global float) +0:9 'inF0' (temp float) +0:9 'inF1' (temp float) +0:10 Ceiling (global float) +0:10 'inF0' (temp float) +0:11 clamp (global float) +0:11 'inF0' (temp float) +0:11 'inF1' (temp float) +0:11 'inF2' (temp float) +0:12 cosine (global float) +0:12 'inF0' (temp float) +0:13 hyp. cosine (global float) +0:13 'inF0' (temp float) +0:14 bitCount (global uint) +0:14 Constant: +0:14 7 (const uint) +0:15 dPdx (global float) +0:15 'inF0' (temp float) +0:16 dPdxCoarse (global float) +0:16 'inF0' (temp float) +0:17 dPdxFine (global float) +0:17 'inF0' (temp float) +0:18 dPdy (global float) +0:18 'inF0' (temp float) +0:19 dPdyCoarse (global float) +0:19 'inF0' (temp float) +0:20 dPdyFine (global float) +0:20 'inF0' (temp float) +0:21 degrees (global float) +0:21 'inF0' (temp float) +0:25 exp (global float) +0:25 'inF0' (temp float) +0:26 exp2 (global float) +0:26 'inF0' (temp float) +0:27 findMSB (global int) +0:27 Constant: +0:27 7 (const int) +0:28 findLSB (global int) +0:28 Constant: +0:28 7 (const int) +0:29 Floor (global float) +0:29 'inF0' (temp float) +0:31 Function Call: fmod(f1;f1; (global float) +0:31 'inF0' (temp float) +0:31 'inF1' (temp float) +0:32 Fraction (global float) +0:32 'inF0' (temp float) +0:33 frexp (global float) +0:33 'inF0' (temp float) +0:33 'inF1' (temp float) +0:34 fwidth (global float) +0:34 'inF0' (temp float) +0:35 isinf (global bool) +0:35 'inF0' (temp float) +0:36 isnan (global bool) +0:36 'inF0' (temp float) +0:37 ldexp (global float) +0:37 'inF0' (temp float) +0:37 'inF1' (temp float) +0:38 log (global float) +0:38 'inF0' (temp float) +0:39 log2 (global float) +0:39 'inF0' (temp float) +0:40 max (global float) +0:40 'inF0' (temp float) +0:40 'inF1' (temp float) +0:41 min (global float) +0:41 'inF0' (temp float) +0:41 'inF1' (temp float) +0:43 pow (global float) +0:43 'inF0' (temp float) +0:43 'inF1' (temp float) +0:44 radians (global float) +0:44 'inF0' (temp float) +0:45 bitFieldReverse (global uint) +0:45 Constant: +0:45 2 (const uint) +0:46 roundEven (global float) +0:46 'inF0' (temp float) +0:47 inverse sqrt (global float) +0:47 'inF0' (temp float) +0:48 Sign (global float) +0:48 'inF0' (temp float) +0:49 sine (global float) +0:49 'inF0' (temp float) +0:50 hyp. sine (global float) +0:50 'inF0' (temp float) +0:51 smoothstep (global float) +0:51 'inF0' (temp float) +0:51 'inF1' (temp float) +0:51 'inF2' (temp float) +0:52 sqrt (global float) +0:52 'inF0' (temp float) +0:53 step (global float) +0:53 'inF0' (temp float) +0:53 'inF1' (temp float) +0:54 tangent (global float) +0:54 'inF0' (temp float) +0:55 hyp. tangent (global float) +0:55 'inF0' (temp float) +0:57 trunc (global float) +0:57 'inF0' (temp float) +0:59 Branch: Return with expression +0:59 Constant: +0:59 0.000000 +0:68 Function Definition: PixelShaderFunction(vf1;vf1;vf1; (temp 1-component vector of float) +0:63 Function Parameters: +0:63 'inF0' (temp 1-component vector of float) +0:63 'inF1' (temp 1-component vector of float) +0:63 'inF2' (temp 1-component vector of float) +0:? Sequence +0:65 Branch: Return with expression +0:65 Constant: +0:65 0.000000 +0:137 Function Definition: PixelShaderFunction(vf2;vf2;vf2; (temp 2-component vector of float) +0:69 Function Parameters: +0:69 'inF0' (temp 2-component vector of float) +0:69 'inF1' (temp 2-component vector of float) +0:69 'inF2' (temp 2-component vector of float) +0:? Sequence +0:70 all (global bool) +0:70 'inF0' (temp 2-component vector of float) +0:71 Absolute value (global 2-component vector of float) +0:71 'inF0' (temp 2-component vector of float) +0:72 arc cosine (global 2-component vector of float) +0:72 'inF0' (temp 2-component vector of float) +0:73 any (global bool) +0:73 'inF0' (temp 2-component vector of float) +0:74 arc sine (global 2-component vector of float) +0:74 'inF0' (temp 2-component vector of float) +0:75 arc tangent (global 2-component vector of float) +0:75 'inF0' (temp 2-component vector of float) +0:76 arc tangent (global 2-component vector of float) +0:76 'inF0' (temp 2-component vector of float) +0:76 'inF1' (temp 2-component vector of float) +0:77 Ceiling (global 2-component vector of float) +0:77 'inF0' (temp 2-component vector of float) +0:78 clamp (global 2-component vector of float) +0:78 'inF0' (temp 2-component vector of float) +0:78 'inF1' (temp 2-component vector of float) +0:78 'inF2' (temp 2-component vector of float) +0:79 cosine (global 2-component vector of float) +0:79 'inF0' (temp 2-component vector of float) +0:80 hyp. cosine (global 2-component vector of float) +0:80 'inF0' (temp 2-component vector of float) +0:? bitCount (global 2-component vector of uint) +0:? Constant: +0:? 7 (const uint) +0:? 3 (const uint) +0:82 dPdx (global 2-component vector of float) +0:82 'inF0' (temp 2-component vector of float) +0:83 dPdxCoarse (global 2-component vector of float) +0:83 'inF0' (temp 2-component vector of float) +0:84 dPdxFine (global 2-component vector of float) +0:84 'inF0' (temp 2-component vector of float) +0:85 dPdy (global 2-component vector of float) +0:85 'inF0' (temp 2-component vector of float) +0:86 dPdyCoarse (global 2-component vector of float) +0:86 'inF0' (temp 2-component vector of float) +0:87 dPdyFine (global 2-component vector of float) +0:87 'inF0' (temp 2-component vector of float) +0:88 degrees (global 2-component vector of float) +0:88 'inF0' (temp 2-component vector of float) +0:89 distance (global float) +0:89 'inF0' (temp 2-component vector of float) +0:89 'inF1' (temp 2-component vector of float) +0:90 dot-product (global float) +0:90 'inF0' (temp 2-component vector of float) +0:90 'inF1' (temp 2-component vector of float) +0:94 exp (global 2-component vector of float) +0:94 'inF0' (temp 2-component vector of float) +0:95 exp2 (global 2-component vector of float) +0:95 'inF0' (temp 2-component vector of float) +0:96 face-forward (global 2-component vector of float) +0:96 'inF0' (temp 2-component vector of float) +0:96 'inF1' (temp 2-component vector of float) +0:96 'inF2' (temp 2-component vector of float) +0:97 findMSB (global int) +0:97 Constant: +0:97 7 (const int) +0:98 findLSB (global int) +0:98 Constant: +0:98 7 (const int) +0:99 Floor (global 2-component vector of float) +0:99 'inF0' (temp 2-component vector of float) +0:101 Function Call: fmod(vf2;vf2; (global 2-component vector of float) +0:101 'inF0' (temp 2-component vector of float) +0:101 'inF1' (temp 2-component vector of float) +0:102 Fraction (global 2-component vector of float) +0:102 'inF0' (temp 2-component vector of float) +0:103 frexp (global 2-component vector of float) +0:103 'inF0' (temp 2-component vector of float) +0:103 'inF1' (temp 2-component vector of float) +0:104 fwidth (global 2-component vector of float) +0:104 'inF0' (temp 2-component vector of float) +0:105 isinf (global 2-component vector of bool) +0:105 'inF0' (temp 2-component vector of float) +0:106 isnan (global 2-component vector of bool) +0:106 'inF0' (temp 2-component vector of float) +0:107 ldexp (global 2-component vector of float) +0:107 'inF0' (temp 2-component vector of float) +0:107 'inF1' (temp 2-component vector of float) +0:108 length (global float) +0:108 'inF0' (temp 2-component vector of float) +0:109 log (global 2-component vector of float) +0:109 'inF0' (temp 2-component vector of float) +0:110 log2 (global 2-component vector of float) +0:110 'inF0' (temp 2-component vector of float) +0:111 max (global 2-component vector of float) +0:111 'inF0' (temp 2-component vector of float) +0:111 'inF1' (temp 2-component vector of float) +0:112 min (global 2-component vector of float) +0:112 'inF0' (temp 2-component vector of float) +0:112 'inF1' (temp 2-component vector of float) +0:114 normalize (global 2-component vector of float) +0:114 'inF0' (temp 2-component vector of float) +0:115 pow (global 2-component vector of float) +0:115 'inF0' (temp 2-component vector of float) +0:115 'inF1' (temp 2-component vector of float) +0:116 radians (global 2-component vector of float) +0:116 'inF0' (temp 2-component vector of float) +0:117 reflect (global 2-component vector of float) +0:117 'inF0' (temp 2-component vector of float) +0:117 'inF1' (temp 2-component vector of float) +0:118 refract (global 2-component vector of float) +0:118 'inF0' (temp 2-component vector of float) +0:118 'inF1' (temp 2-component vector of float) +0:118 Constant: +0:118 2.000000 +0:? bitFieldReverse (global 2-component vector of uint) +0:? Constant: +0:? 1 (const uint) +0:? 2 (const uint) +0:120 roundEven (global 2-component vector of float) +0:120 'inF0' (temp 2-component vector of float) +0:121 inverse sqrt (global 2-component vector of float) +0:121 'inF0' (temp 2-component vector of float) +0:122 Sign (global 2-component vector of float) +0:122 'inF0' (temp 2-component vector of float) +0:123 sine (global 2-component vector of float) +0:123 'inF0' (temp 2-component vector of float) +0:124 hyp. sine (global 2-component vector of float) +0:124 'inF0' (temp 2-component vector of float) +0:125 smoothstep (global 2-component vector of float) +0:125 'inF0' (temp 2-component vector of float) +0:125 'inF1' (temp 2-component vector of float) +0:125 'inF2' (temp 2-component vector of float) +0:126 sqrt (global 2-component vector of float) +0:126 'inF0' (temp 2-component vector of float) +0:127 step (global 2-component vector of float) +0:127 'inF0' (temp 2-component vector of float) +0:127 'inF1' (temp 2-component vector of float) +0:128 tangent (global 2-component vector of float) +0:128 'inF0' (temp 2-component vector of float) +0:129 hyp. tangent (global 2-component vector of float) +0:129 'inF0' (temp 2-component vector of float) +0:131 trunc (global 2-component vector of float) +0:131 'inF0' (temp 2-component vector of float) +0:134 Branch: Return with expression +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:207 Function Definition: PixelShaderFunction(vf3;vf3;vf3; (temp 3-component vector of float) +0:138 Function Parameters: +0:138 'inF0' (temp 3-component vector of float) +0:138 'inF1' (temp 3-component vector of float) +0:138 'inF2' (temp 3-component vector of float) +0:? Sequence +0:139 all (global bool) +0:139 'inF0' (temp 3-component vector of float) +0:140 Absolute value (global 3-component vector of float) +0:140 'inF0' (temp 3-component vector of float) +0:141 arc cosine (global 3-component vector of float) +0:141 'inF0' (temp 3-component vector of float) +0:142 any (global bool) +0:142 'inF0' (temp 3-component vector of float) +0:143 arc sine (global 3-component vector of float) +0:143 'inF0' (temp 3-component vector of float) +0:144 arc tangent (global 3-component vector of float) +0:144 'inF0' (temp 3-component vector of float) +0:145 arc tangent (global 3-component vector of float) +0:145 'inF0' (temp 3-component vector of float) +0:145 'inF1' (temp 3-component vector of float) +0:146 Ceiling (global 3-component vector of float) +0:146 'inF0' (temp 3-component vector of float) +0:147 clamp (global 3-component vector of float) +0:147 'inF0' (temp 3-component vector of float) +0:147 'inF1' (temp 3-component vector of float) +0:147 'inF2' (temp 3-component vector of float) +0:148 cosine (global 3-component vector of float) +0:148 'inF0' (temp 3-component vector of float) +0:149 hyp. cosine (global 3-component vector of float) +0:149 'inF0' (temp 3-component vector of float) +0:? bitCount (global 3-component vector of uint) +0:? Constant: +0:? 7 (const uint) +0:? 3 (const uint) +0:? 5 (const uint) +0:151 cross-product (global 3-component vector of float) +0:151 'inF0' (temp 3-component vector of float) +0:151 'inF1' (temp 3-component vector of float) +0:152 dPdx (global 3-component vector of float) +0:152 'inF0' (temp 3-component vector of float) +0:153 dPdxCoarse (global 3-component vector of float) +0:153 'inF0' (temp 3-component vector of float) +0:154 dPdxFine (global 3-component vector of float) +0:154 'inF0' (temp 3-component vector of float) +0:155 dPdy (global 3-component vector of float) +0:155 'inF0' (temp 3-component vector of float) +0:156 dPdyCoarse (global 3-component vector of float) +0:156 'inF0' (temp 3-component vector of float) +0:157 dPdyFine (global 3-component vector of float) +0:157 'inF0' (temp 3-component vector of float) +0:158 degrees (global 3-component vector of float) +0:158 'inF0' (temp 3-component vector of float) +0:159 distance (global float) +0:159 'inF0' (temp 3-component vector of float) +0:159 'inF1' (temp 3-component vector of float) +0:160 dot-product (global float) +0:160 'inF0' (temp 3-component vector of float) +0:160 'inF1' (temp 3-component vector of float) +0:164 exp (global 3-component vector of float) +0:164 'inF0' (temp 3-component vector of float) +0:165 exp2 (global 3-component vector of float) +0:165 'inF0' (temp 3-component vector of float) +0:166 face-forward (global 3-component vector of float) +0:166 'inF0' (temp 3-component vector of float) +0:166 'inF1' (temp 3-component vector of float) +0:166 'inF2' (temp 3-component vector of float) +0:167 findMSB (global int) +0:167 Constant: +0:167 7 (const int) +0:168 findLSB (global int) +0:168 Constant: +0:168 7 (const int) +0:169 Floor (global 3-component vector of float) +0:169 'inF0' (temp 3-component vector of float) +0:171 Function Call: fmod(vf3;vf3; (global 3-component vector of float) +0:171 'inF0' (temp 3-component vector of float) +0:171 'inF1' (temp 3-component vector of float) +0:172 Fraction (global 3-component vector of float) +0:172 'inF0' (temp 3-component vector of float) +0:173 frexp (global 3-component vector of float) +0:173 'inF0' (temp 3-component vector of float) +0:173 'inF1' (temp 3-component vector of float) +0:174 fwidth (global 3-component vector of float) +0:174 'inF0' (temp 3-component vector of float) +0:175 isinf (global 3-component vector of bool) +0:175 'inF0' (temp 3-component vector of float) +0:176 isnan (global 3-component vector of bool) +0:176 'inF0' (temp 3-component vector of float) +0:177 ldexp (global 3-component vector of float) +0:177 'inF0' (temp 3-component vector of float) +0:177 'inF1' (temp 3-component vector of float) +0:178 length (global float) +0:178 'inF0' (temp 3-component vector of float) +0:179 log (global 3-component vector of float) +0:179 'inF0' (temp 3-component vector of float) +0:180 log2 (global 3-component vector of float) +0:180 'inF0' (temp 3-component vector of float) +0:181 max (global 3-component vector of float) +0:181 'inF0' (temp 3-component vector of float) +0:181 'inF1' (temp 3-component vector of float) +0:182 min (global 3-component vector of float) +0:182 'inF0' (temp 3-component vector of float) +0:182 'inF1' (temp 3-component vector of float) +0:184 normalize (global 3-component vector of float) +0:184 'inF0' (temp 3-component vector of float) +0:185 pow (global 3-component vector of float) +0:185 'inF0' (temp 3-component vector of float) +0:185 'inF1' (temp 3-component vector of float) +0:186 radians (global 3-component vector of float) +0:186 'inF0' (temp 3-component vector of float) +0:187 reflect (global 3-component vector of float) +0:187 'inF0' (temp 3-component vector of float) +0:187 'inF1' (temp 3-component vector of float) +0:188 refract (global 3-component vector of float) +0:188 'inF0' (temp 3-component vector of float) +0:188 'inF1' (temp 3-component vector of float) +0:188 Constant: +0:188 2.000000 +0:? bitFieldReverse (global 3-component vector of uint) +0:? Constant: +0:? 1 (const uint) +0:? 2 (const uint) +0:? 3 (const uint) +0:190 roundEven (global 3-component vector of float) +0:190 'inF0' (temp 3-component vector of float) +0:191 inverse sqrt (global 3-component vector of float) +0:191 'inF0' (temp 3-component vector of float) +0:192 Sign (global 3-component vector of float) +0:192 'inF0' (temp 3-component vector of float) +0:193 sine (global 3-component vector of float) +0:193 'inF0' (temp 3-component vector of float) +0:194 hyp. sine (global 3-component vector of float) +0:194 'inF0' (temp 3-component vector of float) +0:195 smoothstep (global 3-component vector of float) +0:195 'inF0' (temp 3-component vector of float) +0:195 'inF1' (temp 3-component vector of float) +0:195 'inF2' (temp 3-component vector of float) +0:196 sqrt (global 3-component vector of float) +0:196 'inF0' (temp 3-component vector of float) +0:197 step (global 3-component vector of float) +0:197 'inF0' (temp 3-component vector of float) +0:197 'inF1' (temp 3-component vector of float) +0:198 tangent (global 3-component vector of float) +0:198 'inF0' (temp 3-component vector of float) +0:199 hyp. tangent (global 3-component vector of float) +0:199 'inF0' (temp 3-component vector of float) +0:201 trunc (global 3-component vector of float) +0:201 'inF0' (temp 3-component vector of float) +0:204 Branch: Return with expression +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:328 Function Definition: PixelShaderFunction(vf4;vf4;vf4; (temp 4-component vector of float) +0:208 Function Parameters: +0:208 'inF0' (temp 4-component vector of float) +0:208 'inF1' (temp 4-component vector of float) +0:208 'inF2' (temp 4-component vector of float) +0:? Sequence +0:209 all (global bool) +0:209 'inF0' (temp 4-component vector of float) +0:210 Absolute value (global 4-component vector of float) +0:210 'inF0' (temp 4-component vector of float) +0:211 arc cosine (global 4-component vector of float) +0:211 'inF0' (temp 4-component vector of float) +0:212 any (global bool) +0:212 'inF0' (temp 4-component vector of float) +0:213 arc sine (global 4-component vector of float) +0:213 'inF0' (temp 4-component vector of float) +0:214 arc tangent (global 4-component vector of float) +0:214 'inF0' (temp 4-component vector of float) +0:215 arc tangent (global 4-component vector of float) +0:215 'inF0' (temp 4-component vector of float) +0:215 'inF1' (temp 4-component vector of float) +0:216 Ceiling (global 4-component vector of float) +0:216 'inF0' (temp 4-component vector of float) +0:217 clamp (global 4-component vector of float) +0:217 'inF0' (temp 4-component vector of float) +0:217 'inF1' (temp 4-component vector of float) +0:217 'inF2' (temp 4-component vector of float) +0:218 cosine (global 4-component vector of float) +0:218 'inF0' (temp 4-component vector of float) +0:219 hyp. cosine (global 4-component vector of float) +0:219 'inF0' (temp 4-component vector of float) +0:? bitCount (global 4-component vector of uint) +0:? Constant: +0:? 7 (const uint) +0:? 3 (const uint) +0:? 5 (const uint) +0:? 2 (const uint) +0:221 dPdx (global 4-component vector of float) +0:221 'inF0' (temp 4-component vector of float) +0:222 dPdxCoarse (global 4-component vector of float) +0:222 'inF0' (temp 4-component vector of float) +0:223 dPdxFine (global 4-component vector of float) +0:223 'inF0' (temp 4-component vector of float) +0:224 dPdy (global 4-component vector of float) +0:224 'inF0' (temp 4-component vector of float) +0:225 dPdyCoarse (global 4-component vector of float) +0:225 'inF0' (temp 4-component vector of float) +0:226 dPdyFine (global 4-component vector of float) +0:226 'inF0' (temp 4-component vector of float) +0:227 degrees (global 4-component vector of float) +0:227 'inF0' (temp 4-component vector of float) +0:228 distance (global float) +0:228 'inF0' (temp 4-component vector of float) +0:228 'inF1' (temp 4-component vector of float) +0:229 dot-product (global float) +0:229 'inF0' (temp 4-component vector of float) +0:229 'inF1' (temp 4-component vector of float) +0:233 exp (global 4-component vector of float) +0:233 'inF0' (temp 4-component vector of float) +0:234 exp2 (global 4-component vector of float) +0:234 'inF0' (temp 4-component vector of float) +0:235 face-forward (global 4-component vector of float) +0:235 'inF0' (temp 4-component vector of float) +0:235 'inF1' (temp 4-component vector of float) +0:235 'inF2' (temp 4-component vector of float) +0:236 findMSB (global int) +0:236 Constant: +0:236 7 (const int) +0:237 findLSB (global int) +0:237 Constant: +0:237 7 (const int) +0:238 Floor (global 4-component vector of float) +0:238 'inF0' (temp 4-component vector of float) +0:240 Function Call: fmod(vf4;vf4; (global 4-component vector of float) +0:240 'inF0' (temp 4-component vector of float) +0:240 'inF1' (temp 4-component vector of float) +0:241 Fraction (global 4-component vector of float) +0:241 'inF0' (temp 4-component vector of float) +0:242 frexp (global 4-component vector of float) +0:242 'inF0' (temp 4-component vector of float) +0:242 'inF1' (temp 4-component vector of float) +0:243 fwidth (global 4-component vector of float) +0:243 'inF0' (temp 4-component vector of float) +0:244 isinf (global 4-component vector of bool) +0:244 'inF0' (temp 4-component vector of float) +0:245 isnan (global 4-component vector of bool) +0:245 'inF0' (temp 4-component vector of float) +0:246 ldexp (global 4-component vector of float) +0:246 'inF0' (temp 4-component vector of float) +0:246 'inF1' (temp 4-component vector of float) +0:247 length (global float) +0:247 'inF0' (temp 4-component vector of float) +0:248 log (global 4-component vector of float) +0:248 'inF0' (temp 4-component vector of float) +0:249 log2 (global 4-component vector of float) +0:249 'inF0' (temp 4-component vector of float) +0:250 max (global 4-component vector of float) +0:250 'inF0' (temp 4-component vector of float) +0:250 'inF1' (temp 4-component vector of float) +0:251 min (global 4-component vector of float) +0:251 'inF0' (temp 4-component vector of float) +0:251 'inF1' (temp 4-component vector of float) +0:253 normalize (global 4-component vector of float) +0:253 'inF0' (temp 4-component vector of float) +0:254 pow (global 4-component vector of float) +0:254 'inF0' (temp 4-component vector of float) +0:254 'inF1' (temp 4-component vector of float) +0:255 radians (global 4-component vector of float) +0:255 'inF0' (temp 4-component vector of float) +0:256 reflect (global 4-component vector of float) +0:256 'inF0' (temp 4-component vector of float) +0:256 'inF1' (temp 4-component vector of float) +0:257 refract (global 4-component vector of float) +0:257 'inF0' (temp 4-component vector of float) +0:257 'inF1' (temp 4-component vector of float) +0:257 Constant: +0:257 2.000000 +0:? bitFieldReverse (global 4-component vector of uint) +0:? Constant: +0:? 1 (const uint) +0:? 2 (const uint) +0:? 3 (const uint) +0:? 4 (const uint) +0:259 roundEven (global 4-component vector of float) +0:259 'inF0' (temp 4-component vector of float) +0:260 inverse sqrt (global 4-component vector of float) +0:260 'inF0' (temp 4-component vector of float) +0:261 Sign (global 4-component vector of float) +0:261 'inF0' (temp 4-component vector of float) +0:262 sine (global 4-component vector of float) +0:262 'inF0' (temp 4-component vector of float) +0:263 hyp. sine (global 4-component vector of float) +0:263 'inF0' (temp 4-component vector of float) +0:264 smoothstep (global 4-component vector of float) +0:264 'inF0' (temp 4-component vector of float) +0:264 'inF1' (temp 4-component vector of float) +0:264 'inF2' (temp 4-component vector of float) +0:265 sqrt (global 4-component vector of float) +0:265 'inF0' (temp 4-component vector of float) +0:266 step (global 4-component vector of float) +0:266 'inF0' (temp 4-component vector of float) +0:266 'inF1' (temp 4-component vector of float) +0:267 tangent (global 4-component vector of float) +0:267 'inF0' (temp 4-component vector of float) +0:268 hyp. tangent (global 4-component vector of float) +0:268 'inF0' (temp 4-component vector of float) +0:270 trunc (global 4-component vector of float) +0:270 'inF0' (temp 4-component vector of float) +0:273 Branch: Return with expression +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:? 4.000000 +0:337 Function Definition: PixelShaderFunction(mf22;mf22;mf22; (temp 2X2 matrix of float) +0:329 Function Parameters: +0:329 'inF0' (temp 2X2 matrix of float) +0:329 'inF1' (temp 2X2 matrix of float) +0:329 'inF2' (temp 2X2 matrix of float) +0:? Sequence +0:331 all (global bool) +0:331 'inF0' (temp 2X2 matrix of float) +0:331 Absolute value (global 2X2 matrix of float) +0:331 'inF0' (temp 2X2 matrix of float) +0:331 arc cosine (global 2X2 matrix of float) +0:331 'inF0' (temp 2X2 matrix of float) +0:331 any (global bool) +0:331 'inF0' (temp 2X2 matrix of float) +0:331 arc sine (global 2X2 matrix of float) +0:331 'inF0' (temp 2X2 matrix of float) +0:331 arc tangent (global 2X2 matrix of float) +0:331 'inF0' (temp 2X2 matrix of float) +0:331 arc tangent (global 2X2 matrix of float) +0:331 'inF0' (temp 2X2 matrix of float) +0:331 'inF1' (temp 2X2 matrix of float) +0:331 Ceiling (global 2X2 matrix of float) +0:331 'inF0' (temp 2X2 matrix of float) +0:331 clamp (global 2X2 matrix of float) +0:331 'inF0' (temp 2X2 matrix of float) +0:331 'inF1' (temp 2X2 matrix of float) +0:331 'inF2' (temp 2X2 matrix of float) +0:331 cosine (global 2X2 matrix of float) +0:331 'inF0' (temp 2X2 matrix of float) +0:331 hyp. cosine (global 2X2 matrix of float) +0:331 'inF0' (temp 2X2 matrix of float) +0:331 dPdx (global 2X2 matrix of float) +0:331 'inF0' (temp 2X2 matrix of float) +0:331 dPdxCoarse (global 2X2 matrix of float) +0:331 'inF0' (temp 2X2 matrix of float) +0:331 dPdxFine (global 2X2 matrix of float) +0:331 'inF0' (temp 2X2 matrix of float) +0:331 dPdy (global 2X2 matrix of float) +0:331 'inF0' (temp 2X2 matrix of float) +0:331 dPdyCoarse (global 2X2 matrix of float) +0:331 'inF0' (temp 2X2 matrix of float) +0:331 dPdyFine (global 2X2 matrix of float) +0:331 'inF0' (temp 2X2 matrix of float) +0:331 degrees (global 2X2 matrix of float) +0:331 'inF0' (temp 2X2 matrix of float) +0:331 determinant (global float) +0:331 'inF0' (temp 2X2 matrix of float) +0:331 exp (global 2X2 matrix of float) +0:331 'inF0' (temp 2X2 matrix of float) +0:331 exp2 (global 2X2 matrix of float) +0:331 'inF0' (temp 2X2 matrix of float) +0:331 findMSB (global int) +0:331 Constant: +0:331 7 (const int) +0:331 findLSB (global int) +0:331 Constant: +0:331 7 (const int) +0:331 Floor (global 2X2 matrix of float) +0:331 'inF0' (temp 2X2 matrix of float) +0:331 Function Call: fmod(mf22;mf22; (global 2X2 matrix of float) +0:331 'inF0' (temp 2X2 matrix of float) +0:331 'inF1' (temp 2X2 matrix of float) +0:331 Fraction (global 2X2 matrix of float) +0:331 'inF0' (temp 2X2 matrix of float) +0:331 frexp (global 2X2 matrix of float) +0:331 'inF0' (temp 2X2 matrix of float) +0:331 'inF1' (temp 2X2 matrix of float) +0:331 fwidth (global 2X2 matrix of float) +0:331 'inF0' (temp 2X2 matrix of float) +0:331 ldexp (global 2X2 matrix of float) +0:331 'inF0' (temp 2X2 matrix of float) +0:331 'inF1' (temp 2X2 matrix of float) +0:331 log (global 2X2 matrix of float) +0:331 'inF0' (temp 2X2 matrix of float) +0:331 log2 (global 2X2 matrix of float) +0:331 'inF0' (temp 2X2 matrix of float) +0:331 max (global 2X2 matrix of float) +0:331 'inF0' (temp 2X2 matrix of float) +0:331 'inF1' (temp 2X2 matrix of float) +0:331 min (global 2X2 matrix of float) +0:331 'inF0' (temp 2X2 matrix of float) +0:331 'inF1' (temp 2X2 matrix of float) +0:331 pow (global 2X2 matrix of float) +0:331 'inF0' (temp 2X2 matrix of float) +0:331 'inF1' (temp 2X2 matrix of float) +0:331 radians (global 2X2 matrix of float) +0:331 'inF0' (temp 2X2 matrix of float) +0:331 roundEven (global 2X2 matrix of float) +0:331 'inF0' (temp 2X2 matrix of float) +0:331 inverse sqrt (global 2X2 matrix of float) +0:331 'inF0' (temp 2X2 matrix of float) +0:331 Sign (global 2X2 matrix of float) +0:331 'inF0' (temp 2X2 matrix of float) +0:331 sine (global 2X2 matrix of float) +0:331 'inF0' (temp 2X2 matrix of float) +0:331 hyp. sine (global 2X2 matrix of float) +0:331 'inF0' (temp 2X2 matrix of float) +0:331 smoothstep (global 2X2 matrix of float) +0:331 'inF0' (temp 2X2 matrix of float) +0:331 'inF1' (temp 2X2 matrix of float) +0:331 'inF2' (temp 2X2 matrix of float) +0:331 sqrt (global 2X2 matrix of float) +0:331 'inF0' (temp 2X2 matrix of float) +0:331 step (global 2X2 matrix of float) +0:331 'inF0' (temp 2X2 matrix of float) +0:331 'inF1' (temp 2X2 matrix of float) +0:331 tangent (global 2X2 matrix of float) +0:331 'inF0' (temp 2X2 matrix of float) +0:331 hyp. tangent (global 2X2 matrix of float) +0:331 'inF0' (temp 2X2 matrix of float) +0:331 transpose (global 2X2 matrix of float) +0:331 'inF0' (temp 2X2 matrix of float) +0:331 trunc (global 2X2 matrix of float) +0:331 'inF0' (temp 2X2 matrix of float) +0:334 Branch: Return with expression +0:? Constant: +0:? 2.000000 +0:? 2.000000 +0:? 2.000000 +0:? 2.000000 +0:346 Function Definition: PixelShaderFunction(mf33;mf33;mf33; (temp 3X3 matrix of float) +0:338 Function Parameters: +0:338 'inF0' (temp 3X3 matrix of float) +0:338 'inF1' (temp 3X3 matrix of float) +0:338 'inF2' (temp 3X3 matrix of float) +0:? Sequence +0:340 all (global bool) +0:340 'inF0' (temp 3X3 matrix of float) +0:340 Absolute value (global 3X3 matrix of float) +0:340 'inF0' (temp 3X3 matrix of float) +0:340 arc cosine (global 3X3 matrix of float) +0:340 'inF0' (temp 3X3 matrix of float) +0:340 any (global bool) +0:340 'inF0' (temp 3X3 matrix of float) +0:340 arc sine (global 3X3 matrix of float) +0:340 'inF0' (temp 3X3 matrix of float) +0:340 arc tangent (global 3X3 matrix of float) +0:340 'inF0' (temp 3X3 matrix of float) +0:340 arc tangent (global 3X3 matrix of float) +0:340 'inF0' (temp 3X3 matrix of float) +0:340 'inF1' (temp 3X3 matrix of float) +0:340 Ceiling (global 3X3 matrix of float) +0:340 'inF0' (temp 3X3 matrix of float) +0:340 clamp (global 3X3 matrix of float) +0:340 'inF0' (temp 3X3 matrix of float) +0:340 'inF1' (temp 3X3 matrix of float) +0:340 'inF2' (temp 3X3 matrix of float) +0:340 cosine (global 3X3 matrix of float) +0:340 'inF0' (temp 3X3 matrix of float) +0:340 hyp. cosine (global 3X3 matrix of float) +0:340 'inF0' (temp 3X3 matrix of float) +0:340 dPdx (global 3X3 matrix of float) +0:340 'inF0' (temp 3X3 matrix of float) +0:340 dPdxCoarse (global 3X3 matrix of float) +0:340 'inF0' (temp 3X3 matrix of float) +0:340 dPdxFine (global 3X3 matrix of float) +0:340 'inF0' (temp 3X3 matrix of float) +0:340 dPdy (global 3X3 matrix of float) +0:340 'inF0' (temp 3X3 matrix of float) +0:340 dPdyCoarse (global 3X3 matrix of float) +0:340 'inF0' (temp 3X3 matrix of float) +0:340 dPdyFine (global 3X3 matrix of float) +0:340 'inF0' (temp 3X3 matrix of float) +0:340 degrees (global 3X3 matrix of float) +0:340 'inF0' (temp 3X3 matrix of float) +0:340 determinant (global float) +0:340 'inF0' (temp 3X3 matrix of float) +0:340 exp (global 3X3 matrix of float) +0:340 'inF0' (temp 3X3 matrix of float) +0:340 exp2 (global 3X3 matrix of float) +0:340 'inF0' (temp 3X3 matrix of float) +0:340 findMSB (global int) +0:340 Constant: +0:340 7 (const int) +0:340 findLSB (global int) +0:340 Constant: +0:340 7 (const int) +0:340 Floor (global 3X3 matrix of float) +0:340 'inF0' (temp 3X3 matrix of float) +0:340 Function Call: fmod(mf33;mf33; (global 3X3 matrix of float) +0:340 'inF0' (temp 3X3 matrix of float) +0:340 'inF1' (temp 3X3 matrix of float) +0:340 Fraction (global 3X3 matrix of float) +0:340 'inF0' (temp 3X3 matrix of float) +0:340 frexp (global 3X3 matrix of float) +0:340 'inF0' (temp 3X3 matrix of float) +0:340 'inF1' (temp 3X3 matrix of float) +0:340 fwidth (global 3X3 matrix of float) +0:340 'inF0' (temp 3X3 matrix of float) +0:340 ldexp (global 3X3 matrix of float) +0:340 'inF0' (temp 3X3 matrix of float) +0:340 'inF1' (temp 3X3 matrix of float) +0:340 log (global 3X3 matrix of float) +0:340 'inF0' (temp 3X3 matrix of float) +0:340 log2 (global 3X3 matrix of float) +0:340 'inF0' (temp 3X3 matrix of float) +0:340 max (global 3X3 matrix of float) +0:340 'inF0' (temp 3X3 matrix of float) +0:340 'inF1' (temp 3X3 matrix of float) +0:340 min (global 3X3 matrix of float) +0:340 'inF0' (temp 3X3 matrix of float) +0:340 'inF1' (temp 3X3 matrix of float) +0:340 pow (global 3X3 matrix of float) +0:340 'inF0' (temp 3X3 matrix of float) +0:340 'inF1' (temp 3X3 matrix of float) +0:340 radians (global 3X3 matrix of float) +0:340 'inF0' (temp 3X3 matrix of float) +0:340 roundEven (global 3X3 matrix of float) +0:340 'inF0' (temp 3X3 matrix of float) +0:340 inverse sqrt (global 3X3 matrix of float) +0:340 'inF0' (temp 3X3 matrix of float) +0:340 Sign (global 3X3 matrix of float) +0:340 'inF0' (temp 3X3 matrix of float) +0:340 sine (global 3X3 matrix of float) +0:340 'inF0' (temp 3X3 matrix of float) +0:340 hyp. sine (global 3X3 matrix of float) +0:340 'inF0' (temp 3X3 matrix of float) +0:340 smoothstep (global 3X3 matrix of float) +0:340 'inF0' (temp 3X3 matrix of float) +0:340 'inF1' (temp 3X3 matrix of float) +0:340 'inF2' (temp 3X3 matrix of float) +0:340 sqrt (global 3X3 matrix of float) +0:340 'inF0' (temp 3X3 matrix of float) +0:340 step (global 3X3 matrix of float) +0:340 'inF0' (temp 3X3 matrix of float) +0:340 'inF1' (temp 3X3 matrix of float) +0:340 tangent (global 3X3 matrix of float) +0:340 'inF0' (temp 3X3 matrix of float) +0:340 hyp. tangent (global 3X3 matrix of float) +0:340 'inF0' (temp 3X3 matrix of float) +0:340 transpose (global 3X3 matrix of float) +0:340 'inF0' (temp 3X3 matrix of float) +0:340 trunc (global 3X3 matrix of float) +0:340 'inF0' (temp 3X3 matrix of float) +0:343 Branch: Return with expression +0:? Constant: +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:354 Function Definition: PixelShaderFunction(mf44;mf44;mf44; (temp 4X4 matrix of float) +0:347 Function Parameters: +0:347 'inF0' (temp 4X4 matrix of float) +0:347 'inF1' (temp 4X4 matrix of float) +0:347 'inF2' (temp 4X4 matrix of float) +0:? Sequence +0:349 all (global bool) +0:349 'inF0' (temp 4X4 matrix of float) +0:349 Absolute value (global 4X4 matrix of float) +0:349 'inF0' (temp 4X4 matrix of float) +0:349 arc cosine (global 4X4 matrix of float) +0:349 'inF0' (temp 4X4 matrix of float) +0:349 any (global bool) +0:349 'inF0' (temp 4X4 matrix of float) +0:349 arc sine (global 4X4 matrix of float) +0:349 'inF0' (temp 4X4 matrix of float) +0:349 arc tangent (global 4X4 matrix of float) +0:349 'inF0' (temp 4X4 matrix of float) +0:349 arc tangent (global 4X4 matrix of float) +0:349 'inF0' (temp 4X4 matrix of float) +0:349 'inF1' (temp 4X4 matrix of float) +0:349 Ceiling (global 4X4 matrix of float) +0:349 'inF0' (temp 4X4 matrix of float) +0:349 clamp (global 4X4 matrix of float) +0:349 'inF0' (temp 4X4 matrix of float) +0:349 'inF1' (temp 4X4 matrix of float) +0:349 'inF2' (temp 4X4 matrix of float) +0:349 cosine (global 4X4 matrix of float) +0:349 'inF0' (temp 4X4 matrix of float) +0:349 hyp. cosine (global 4X4 matrix of float) +0:349 'inF0' (temp 4X4 matrix of float) +0:349 dPdx (global 4X4 matrix of float) +0:349 'inF0' (temp 4X4 matrix of float) +0:349 dPdxCoarse (global 4X4 matrix of float) +0:349 'inF0' (temp 4X4 matrix of float) +0:349 dPdxFine (global 4X4 matrix of float) +0:349 'inF0' (temp 4X4 matrix of float) +0:349 dPdy (global 4X4 matrix of float) +0:349 'inF0' (temp 4X4 matrix of float) +0:349 dPdyCoarse (global 4X4 matrix of float) +0:349 'inF0' (temp 4X4 matrix of float) +0:349 dPdyFine (global 4X4 matrix of float) +0:349 'inF0' (temp 4X4 matrix of float) +0:349 degrees (global 4X4 matrix of float) +0:349 'inF0' (temp 4X4 matrix of float) +0:349 determinant (global float) +0:349 'inF0' (temp 4X4 matrix of float) +0:349 exp (global 4X4 matrix of float) +0:349 'inF0' (temp 4X4 matrix of float) +0:349 exp2 (global 4X4 matrix of float) +0:349 'inF0' (temp 4X4 matrix of float) +0:349 findMSB (global int) +0:349 Constant: +0:349 7 (const int) +0:349 findLSB (global int) +0:349 Constant: +0:349 7 (const int) +0:349 Floor (global 4X4 matrix of float) +0:349 'inF0' (temp 4X4 matrix of float) +0:349 Function Call: fmod(mf44;mf44; (global 4X4 matrix of float) +0:349 'inF0' (temp 4X4 matrix of float) +0:349 'inF1' (temp 4X4 matrix of float) +0:349 Fraction (global 4X4 matrix of float) +0:349 'inF0' (temp 4X4 matrix of float) +0:349 frexp (global 4X4 matrix of float) +0:349 'inF0' (temp 4X4 matrix of float) +0:349 'inF1' (temp 4X4 matrix of float) +0:349 fwidth (global 4X4 matrix of float) +0:349 'inF0' (temp 4X4 matrix of float) +0:349 ldexp (global 4X4 matrix of float) +0:349 'inF0' (temp 4X4 matrix of float) +0:349 'inF1' (temp 4X4 matrix of float) +0:349 log (global 4X4 matrix of float) +0:349 'inF0' (temp 4X4 matrix of float) +0:349 log2 (global 4X4 matrix of float) +0:349 'inF0' (temp 4X4 matrix of float) +0:349 max (global 4X4 matrix of float) +0:349 'inF0' (temp 4X4 matrix of float) +0:349 'inF1' (temp 4X4 matrix of float) +0:349 min (global 4X4 matrix of float) +0:349 'inF0' (temp 4X4 matrix of float) +0:349 'inF1' (temp 4X4 matrix of float) +0:349 pow (global 4X4 matrix of float) +0:349 'inF0' (temp 4X4 matrix of float) +0:349 'inF1' (temp 4X4 matrix of float) +0:349 radians (global 4X4 matrix of float) +0:349 'inF0' (temp 4X4 matrix of float) +0:349 roundEven (global 4X4 matrix of float) +0:349 'inF0' (temp 4X4 matrix of float) +0:349 inverse sqrt (global 4X4 matrix of float) +0:349 'inF0' (temp 4X4 matrix of float) +0:349 Sign (global 4X4 matrix of float) +0:349 'inF0' (temp 4X4 matrix of float) +0:349 sine (global 4X4 matrix of float) +0:349 'inF0' (temp 4X4 matrix of float) +0:349 hyp. sine (global 4X4 matrix of float) +0:349 'inF0' (temp 4X4 matrix of float) +0:349 smoothstep (global 4X4 matrix of float) +0:349 'inF0' (temp 4X4 matrix of float) +0:349 'inF1' (temp 4X4 matrix of float) +0:349 'inF2' (temp 4X4 matrix of float) +0:349 sqrt (global 4X4 matrix of float) +0:349 'inF0' (temp 4X4 matrix of float) +0:349 step (global 4X4 matrix of float) +0:349 'inF0' (temp 4X4 matrix of float) +0:349 'inF1' (temp 4X4 matrix of float) +0:349 tangent (global 4X4 matrix of float) +0:349 'inF0' (temp 4X4 matrix of float) +0:349 hyp. tangent (global 4X4 matrix of float) +0:349 'inF0' (temp 4X4 matrix of float) +0:349 transpose (global 4X4 matrix of float) +0:349 'inF0' (temp 4X4 matrix of float) +0:349 trunc (global 4X4 matrix of float) +0:349 'inF0' (temp 4X4 matrix of float) +0:352 Branch: Return with expression +0:? Constant: +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? Linker Objects + +Missing functionality: missing user function; linker needs to catch that +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 880 + + Capability Shader + Capability DerivativeControl + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "PixelShaderFunction" + ExecutionMode 4 OriginUpperLeft + Source HLSL 450 + Name 4 "PixelShaderFunction" + Name 8 "inF0" + Name 23 "inF1" + Name 30 "inF2" + Name 67 "ResType" + Name 127 "inF0" + Name 141 "inF1" + Name 148 "inF2" + Name 195 "ResType" + Name 268 "inF0" + Name 282 "inF1" + Name 289 "inF2" + Name 339 "ResType" + Name 410 "inF0" + Name 424 "inF1" + Name 431 "inF2" + Name 477 "ResType" + Name 549 "inF0" + Name 563 "inF1" + Name 570 "inF2" + Name 604 "ResType" + Name 660 "inF0" + Name 674 "inF1" + Name 681 "inF2" + Name 715 "ResType" + Name 771 "inF0" + Name 785 "inF1" + Name 792 "inF2" + Name 826 "ResType" + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypePointer Function 6(float) + 10: TypeBool + 37: TypeInt 32 0 + 38: 37(int) Constant 7 + 58: TypeInt 32 1 + 59: 58(int) Constant 7 + 67(ResType): TypeStruct 6(float) 58(int) + 95: 37(int) Constant 2 + 122: 6(float) Constant 0 + 125: TypeVector 6(float) 2 + 126: TypePointer Function 125(fvec2) + 155: TypeVector 37(int) 2 + 156: 37(int) Constant 3 + 157: 155(ivec2) ConstantComposite 38 156 + 194: TypeVector 58(int) 2 + 195(ResType): TypeStruct 125(fvec2) 194(ivec2) + 202: TypeVector 10(bool) 2 + 233: 6(float) Constant 1073741824 + 235: 37(int) Constant 1 + 236: 155(ivec2) ConstantComposite 235 95 + 263: 6(float) Constant 1065353216 + 264: 125(fvec2) ConstantComposite 263 233 + 266: TypeVector 6(float) 3 + 267: TypePointer Function 266(fvec3) + 296: TypeVector 37(int) 3 + 297: 37(int) Constant 5 + 298: 296(ivec3) ConstantComposite 38 156 297 + 338: TypeVector 58(int) 3 + 339(ResType): TypeStruct 266(fvec3) 338(ivec3) + 346: TypeVector 10(bool) 3 + 378: 296(ivec3) ConstantComposite 235 95 156 + 405: 6(float) Constant 1077936128 + 406: 266(fvec3) ConstantComposite 263 233 405 + 408: TypeVector 6(float) 4 + 409: TypePointer Function 408(fvec4) + 438: TypeVector 37(int) 4 + 439: 438(ivec4) ConstantComposite 38 156 297 95 + 476: TypeVector 58(int) 4 + 477(ResType): TypeStruct 408(fvec4) 476(ivec4) + 484: TypeVector 10(bool) 4 + 516: 37(int) Constant 4 + 517: 438(ivec4) ConstantComposite 235 95 156 516 + 544: 6(float) Constant 1082130432 + 545: 408(fvec4) ConstantComposite 263 233 405 544 + 547: TypeMatrix 125(fvec2) 2 + 548: TypePointer Function 547 + 604(ResType): TypeStruct 547 194(ivec2) + 655: 125(fvec2) ConstantComposite 233 233 + 656: 547 ConstantComposite 655 655 + 658: TypeMatrix 266(fvec3) 3 + 659: TypePointer Function 658 + 715(ResType): TypeStruct 658 338(ivec3) + 766: 266(fvec3) ConstantComposite 405 405 405 + 767: 658 ConstantComposite 766 766 766 + 769: TypeMatrix 408(fvec4) 4 + 770: TypePointer Function 769 + 826(ResType): TypeStruct 769 476(ivec4) + 877: 408(fvec4) ConstantComposite 544 544 544 544 + 878: 769 ConstantComposite 877 877 877 877 +4(PixelShaderFunction): 2 Function None 3 + 5: Label + 8(inF0): 7(ptr) Variable Function + 23(inF1): 7(ptr) Variable Function + 30(inF2): 7(ptr) Variable Function + 127(inF0): 126(ptr) Variable Function + 141(inF1): 126(ptr) Variable Function + 148(inF2): 126(ptr) Variable Function + 268(inF0): 267(ptr) Variable Function + 282(inF1): 267(ptr) Variable Function + 289(inF2): 267(ptr) Variable Function + 410(inF0): 409(ptr) Variable Function + 424(inF1): 409(ptr) Variable Function + 431(inF2): 409(ptr) Variable Function + 549(inF0): 548(ptr) Variable Function + 563(inF1): 548(ptr) Variable Function + 570(inF2): 548(ptr) Variable Function + 660(inF0): 659(ptr) Variable Function + 674(inF1): 659(ptr) Variable Function + 681(inF2): 659(ptr) Variable Function + 771(inF0): 770(ptr) Variable Function + 785(inF1): 770(ptr) Variable Function + 792(inF2): 770(ptr) Variable Function + 9: 6(float) Load 8(inF0) + 11: 10(bool) All 9 + 12: 6(float) Load 8(inF0) + 13: 6(float) ExtInst 1(GLSL.std.450) 4(FAbs) 12 + 14: 6(float) Load 8(inF0) + 15: 6(float) ExtInst 1(GLSL.std.450) 17(Acos) 14 + 16: 6(float) Load 8(inF0) + 17: 10(bool) Any 16 + 18: 6(float) Load 8(inF0) + 19: 6(float) ExtInst 1(GLSL.std.450) 16(Asin) 18 + 20: 6(float) Load 8(inF0) + 21: 6(float) ExtInst 1(GLSL.std.450) 18(Atan) 20 + 22: 6(float) Load 8(inF0) + 24: 6(float) Load 23(inF1) + 25: 6(float) ExtInst 1(GLSL.std.450) 25(Atan2) 22 24 + 26: 6(float) Load 8(inF0) + 27: 6(float) ExtInst 1(GLSL.std.450) 9(Ceil) 26 + 28: 6(float) Load 8(inF0) + 29: 6(float) Load 23(inF1) + 31: 6(float) Load 30(inF2) + 32: 6(float) ExtInst 1(GLSL.std.450) 43(FClamp) 28 29 31 + 33: 6(float) Load 8(inF0) + 34: 6(float) ExtInst 1(GLSL.std.450) 14(Cos) 33 + 35: 6(float) Load 8(inF0) + 36: 6(float) ExtInst 1(GLSL.std.450) 20(Cosh) 35 + 39: 37(int) BitCount 38 + 40: 6(float) Load 8(inF0) + 41: 6(float) DPdx 40 + 42: 6(float) Load 8(inF0) + 43: 6(float) DPdxCoarse 42 + 44: 6(float) Load 8(inF0) + 45: 6(float) DPdxFine 44 + 46: 6(float) Load 8(inF0) + 47: 6(float) DPdy 46 + 48: 6(float) Load 8(inF0) + 49: 6(float) DPdyCoarse 48 + 50: 6(float) Load 8(inF0) + 51: 6(float) DPdyFine 50 + 52: 6(float) Load 8(inF0) + 53: 6(float) ExtInst 1(GLSL.std.450) 12(Degrees) 52 + 54: 6(float) Load 8(inF0) + 55: 6(float) ExtInst 1(GLSL.std.450) 27(Exp) 54 + 56: 6(float) Load 8(inF0) + 57: 6(float) ExtInst 1(GLSL.std.450) 29(Exp2) 56 + 60: 58(int) ExtInst 1(GLSL.std.450) 74(FindSMsb) 59 + 61: 58(int) ExtInst 1(GLSL.std.450) 73(FindILsb) 59 + 62: 6(float) Load 8(inF0) + 63: 6(float) ExtInst 1(GLSL.std.450) 8(Floor) 62 + 64: 6(float) Load 8(inF0) + 65: 6(float) ExtInst 1(GLSL.std.450) 10(Fract) 64 + 66: 6(float) Load 8(inF0) + 68: 67(ResType) ExtInst 1(GLSL.std.450) 52(FrexpStruct) 66 + 69: 58(int) CompositeExtract 68 1 + Store 23(inF1) 69 + 70: 6(float) CompositeExtract 68 0 + 71: 6(float) Load 8(inF0) + 72: 6(float) Fwidth 71 + 73: 6(float) Load 8(inF0) + 74: 10(bool) IsInf 73 + 75: 6(float) Load 8(inF0) + 76: 10(bool) IsNan 75 + 77: 6(float) Load 8(inF0) + 78: 6(float) Load 23(inF1) + 79: 6(float) ExtInst 1(GLSL.std.450) 53(Ldexp) 77 78 + 80: 6(float) Load 8(inF0) + 81: 6(float) ExtInst 1(GLSL.std.450) 28(Log) 80 + 82: 6(float) Load 8(inF0) + 83: 6(float) ExtInst 1(GLSL.std.450) 30(Log2) 82 + 84: 6(float) Load 8(inF0) + 85: 6(float) Load 23(inF1) + 86: 6(float) ExtInst 1(GLSL.std.450) 40(FMax) 84 85 + 87: 6(float) Load 8(inF0) + 88: 6(float) Load 23(inF1) + 89: 6(float) ExtInst 1(GLSL.std.450) 37(FMin) 87 88 + 90: 6(float) Load 8(inF0) + 91: 6(float) Load 23(inF1) + 92: 6(float) ExtInst 1(GLSL.std.450) 26(Pow) 90 91 + 93: 6(float) Load 8(inF0) + 94: 6(float) ExtInst 1(GLSL.std.450) 11(Radians) 93 + 96: 37(int) BitReverse 95 + 97: 6(float) Load 8(inF0) + 98: 6(float) ExtInst 1(GLSL.std.450) 2(RoundEven) 97 + 99: 6(float) Load 8(inF0) + 100: 6(float) ExtInst 1(GLSL.std.450) 32(InverseSqrt) 99 + 101: 6(float) Load 8(inF0) + 102: 6(float) ExtInst 1(GLSL.std.450) 6(FSign) 101 + 103: 6(float) Load 8(inF0) + 104: 6(float) ExtInst 1(GLSL.std.450) 13(Sin) 103 + 105: 6(float) Load 8(inF0) + 106: 6(float) ExtInst 1(GLSL.std.450) 19(Sinh) 105 + 107: 6(float) Load 8(inF0) + 108: 6(float) Load 23(inF1) + 109: 6(float) Load 30(inF2) + 110: 6(float) ExtInst 1(GLSL.std.450) 49(SmoothStep) 107 108 109 + 111: 6(float) Load 8(inF0) + 112: 6(float) ExtInst 1(GLSL.std.450) 31(Sqrt) 111 + 113: 6(float) Load 8(inF0) + 114: 6(float) Load 23(inF1) + 115: 6(float) ExtInst 1(GLSL.std.450) 48(Step) 113 114 + 116: 6(float) Load 8(inF0) + 117: 6(float) ExtInst 1(GLSL.std.450) 15(Tan) 116 + 118: 6(float) Load 8(inF0) + 119: 6(float) ExtInst 1(GLSL.std.450) 21(Tanh) 118 + 120: 6(float) Load 8(inF0) + 121: 6(float) ExtInst 1(GLSL.std.450) 3(Trunc) 120 + ReturnValue 122 + FunctionEnd diff --git a/Test/baseResults/hlsl.intrinsics.negative.frag.out b/Test/baseResults/hlsl.intrinsics.negative.frag.out new file mode 100644 index 00000000..9ac39851 --- /dev/null +++ b/Test/baseResults/hlsl.intrinsics.negative.frag.out @@ -0,0 +1,702 @@ +hlsl.intrinsics.negative.frag +ERROR: 0:5: 'asdouble' : no matching overloaded function found +ERROR: 0:6: 'CheckAccessFullyMapped' : no matching overloaded function found +ERROR: 0:7: 'countbits' : no matching overloaded function found +ERROR: 0:8: 'cross' : no matching overloaded function found +ERROR: 0:9: 'D3DCOLORtoUBYTE4' : no matching overloaded function found +ERROR: 0:10: 'determinant' : no matching overloaded function found +ERROR: 0:12: 'f16tof32' : no matching overloaded function found +ERROR: 0:13: 'firstbithigh' : no matching overloaded function found +ERROR: 0:14: 'firstbitlow' : no matching overloaded function found +ERROR: 0:15: 'fma' : no matching overloaded function found +ERROR: 0:23: 'length' : no matching overloaded function found +ERROR: 0:24: 'msad4' : no matching overloaded function found +ERROR: 0:25: 'normalize' : no matching overloaded function found +ERROR: 0:26: 'reflect' : no matching overloaded function found +ERROR: 0:27: 'refract' : no matching overloaded function found +ERROR: 0:28: 'refract' : no matching overloaded function found +ERROR: 0:29: 'reversebits' : no matching overloaded function found +ERROR: 0:30: 'transpose' : no matching overloaded function found +ERROR: 0:39: 'GetRenderTargetSamplePosition' : no matching overloaded function found +ERROR: 0:46: 'asdouble' : no matching overloaded function found +ERROR: 0:47: 'CheckAccessFullyMapped' : no matching overloaded function found +ERROR: 0:48: 'countbits' : no matching overloaded function found +ERROR: 0:49: 'cross' : no matching overloaded function found +ERROR: 0:50: 'D3DCOLORtoUBYTE4' : no matching overloaded function found +ERROR: 0:51: 'determinant' : no matching overloaded function found +ERROR: 0:52: 'f16tof32' : no matching overloaded function found +ERROR: 0:53: 'firstbithigh' : no matching overloaded function found +ERROR: 0:54: 'firstbitlow' : no matching overloaded function found +ERROR: 0:55: 'fma' : no matching overloaded function found +ERROR: 0:56: 'reversebits' : no matching overloaded function found +ERROR: 0:57: 'transpose' : no matching overloaded function found +ERROR: 0:64: 'CheckAccessFullyMapped' : no matching overloaded function found +ERROR: 0:65: 'countbits' : no matching overloaded function found +ERROR: 0:66: 'D3DCOLORtoUBYTE4' : no matching overloaded function found +ERROR: 0:67: 'determinant' : no matching overloaded function found +ERROR: 0:68: 'f16tof32' : no matching overloaded function found +ERROR: 0:69: 'firstbithigh' : no matching overloaded function found +ERROR: 0:70: 'firstbitlow' : no matching overloaded function found +ERROR: 0:71: 'fma' : no matching overloaded function found +ERROR: 0:72: 'reversebits' : no matching overloaded function found +ERROR: 0:73: 'transpose' : no matching overloaded function found +ERROR: 0:81: 'CheckAccessFullyMapped' : no matching overloaded function found +ERROR: 0:82: 'countbits' : no matching overloaded function found +ERROR: 0:83: 'cross' : no matching overloaded function found +ERROR: 0:84: 'determinant' : no matching overloaded function found +ERROR: 0:85: 'f16tof32' : no matching overloaded function found +ERROR: 0:86: 'firstbithigh' : no matching overloaded function found +ERROR: 0:87: 'firstbitlow' : no matching overloaded function found +ERROR: 0:88: 'fma' : no matching overloaded function found +ERROR: 0:89: 'reversebits' : no matching overloaded function found +ERROR: 0:90: 'transpose' : no matching overloaded function found +ERROR: 0:118: 'countbits' : no matching overloaded function found +ERROR: 0:118: 'D3DCOLORtoUBYTE4' : no matching overloaded function found +ERROR: 0:118: 'cross' : no matching overloaded function found +ERROR: 0:118: 'f16tof32' : no matching overloaded function found +ERROR: 0:118: 'firstbithigh' : no matching overloaded function found +ERROR: 0:118: 'firstbitlow' : no matching overloaded function found +ERROR: 0:118: 'fma' : no matching overloaded function found +ERROR: 0:118: 'reversebits' : no matching overloaded function found +ERROR: 0:118: 'length' : no matching overloaded function found +ERROR: 0:118: 'noise' : no matching overloaded function found +ERROR: 0:118: 'normalize' : no matching overloaded function found +ERROR: 0:118: 'reflect' : no matching overloaded function found +ERROR: 0:118: 'refract' : no matching overloaded function found +ERROR: 0:118: 'reversebits' : no matching overloaded function found +ERROR: 0:126: 'countbits' : no matching overloaded function found +ERROR: 0:126: 'D3DCOLORtoUBYTE4' : no matching overloaded function found +ERROR: 0:126: 'cross' : no matching overloaded function found +ERROR: 0:126: 'f16tof32' : no matching overloaded function found +ERROR: 0:126: 'firstbithigh' : no matching overloaded function found +ERROR: 0:126: 'firstbitlow' : no matching overloaded function found +ERROR: 0:126: 'fma' : no matching overloaded function found +ERROR: 0:126: 'reversebits' : no matching overloaded function found +ERROR: 0:126: 'length' : no matching overloaded function found +ERROR: 0:126: 'noise' : no matching overloaded function found +ERROR: 0:126: 'normalize' : no matching overloaded function found +ERROR: 0:126: 'reflect' : no matching overloaded function found +ERROR: 0:126: 'refract' : no matching overloaded function found +ERROR: 0:126: 'reversebits' : no matching overloaded function found +ERROR: 0:134: 'countbits' : no matching overloaded function found +ERROR: 0:134: 'D3DCOLORtoUBYTE4' : no matching overloaded function found +ERROR: 0:134: 'cross' : no matching overloaded function found +ERROR: 0:134: 'f16tof32' : no matching overloaded function found +ERROR: 0:134: 'firstbithigh' : no matching overloaded function found +ERROR: 0:134: 'firstbitlow' : no matching overloaded function found +ERROR: 0:134: 'fma' : no matching overloaded function found +ERROR: 0:134: 'reversebits' : no matching overloaded function found +ERROR: 0:134: 'length' : no matching overloaded function found +ERROR: 0:134: 'noise' : no matching overloaded function found +ERROR: 0:134: 'normalize' : no matching overloaded function found +ERROR: 0:134: 'reflect' : no matching overloaded function found +ERROR: 0:134: 'refract' : no matching overloaded function found +ERROR: 0:134: 'reversebits' : no matching overloaded function found +ERROR: 93 compilation errors. No code generated. + + +Shader version: 450 +gl_FragCoord origin is upper left +ERROR: node is still EOpNull! +0:35 Function Definition: PixelShaderFunction(f1;f1;f1;i1; (temp float) +0:2 Function Parameters: +0:2 'inF0' (temp float) +0:2 'inF1' (temp float) +0:2 'inF2' (temp float) +0:2 'inI0' (temp int) +0:? Sequence +0:5 Constant: +0:5 0.000000 +0:6 Constant: +0:6 0.000000 +0:7 Constant: +0:7 0.000000 +0:8 Constant: +0:8 0.000000 +0:9 Constant: +0:9 0.000000 +0:10 Constant: +0:10 0.000000 +0:12 Constant: +0:12 0.000000 +0:13 Constant: +0:13 0.000000 +0:14 Constant: +0:14 0.000000 +0:15 Constant: +0:15 0.000000 +0:23 Constant: +0:23 0.000000 +0:24 Constant: +0:24 0.000000 +0:25 Constant: +0:25 0.000000 +0:26 Constant: +0:26 0.000000 +0:27 Constant: +0:27 0.000000 +0:28 Constant: +0:28 0.000000 +0:29 Constant: +0:29 0.000000 +0:30 Constant: +0:30 0.000000 +0:32 Branch: Return with expression +0:32 Constant: +0:32 0.000000 +0:44 Function Definition: PixelShaderFunction(vf1;vf1;vf1;i1; (temp 1-component vector of float) +0:36 Function Parameters: +0:36 'inF0' (temp 1-component vector of float) +0:36 'inF1' (temp 1-component vector of float) +0:36 'inF2' (temp 1-component vector of float) +0:36 'inI0' (temp int) +0:? Sequence +0:39 Constant: +0:39 0.000000 +0:41 Branch: Return with expression +0:41 Constant: +0:41 0.000000 +0:62 Function Definition: PixelShaderFunction(vf2;vf2;vf2;vi2; (temp 2-component vector of float) +0:45 Function Parameters: +0:45 'inF0' (temp 2-component vector of float) +0:45 'inF1' (temp 2-component vector of float) +0:45 'inF2' (temp 2-component vector of float) +0:45 'inI0' (temp 2-component vector of int) +0:? Sequence +0:46 Constant: +0:46 0.000000 +0:47 Constant: +0:47 0.000000 +0:48 Constant: +0:48 0.000000 +0:49 Constant: +0:49 0.000000 +0:50 Constant: +0:50 0.000000 +0:51 Constant: +0:51 0.000000 +0:52 Constant: +0:52 0.000000 +0:53 Constant: +0:53 0.000000 +0:54 Constant: +0:54 0.000000 +0:55 Constant: +0:55 0.000000 +0:56 Constant: +0:56 0.000000 +0:57 Constant: +0:57 0.000000 +0:59 Branch: Return with expression +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:79 Function Definition: PixelShaderFunction(vf3;vf3;vf3;vi3; (temp 3-component vector of float) +0:63 Function Parameters: +0:63 'inF0' (temp 3-component vector of float) +0:63 'inF1' (temp 3-component vector of float) +0:63 'inF2' (temp 3-component vector of float) +0:63 'inI0' (temp 3-component vector of int) +0:? Sequence +0:64 Constant: +0:64 0.000000 +0:65 Constant: +0:65 0.000000 +0:66 Constant: +0:66 0.000000 +0:67 Constant: +0:67 0.000000 +0:68 Constant: +0:68 0.000000 +0:69 Constant: +0:69 0.000000 +0:70 Constant: +0:70 0.000000 +0:71 Constant: +0:71 0.000000 +0:72 Constant: +0:72 0.000000 +0:73 Constant: +0:73 0.000000 +0:76 Branch: Return with expression +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:115 Function Definition: PixelShaderFunction(vf4;vf4;vf4;vi4; (temp 4-component vector of float) +0:80 Function Parameters: +0:80 'inF0' (temp 4-component vector of float) +0:80 'inF1' (temp 4-component vector of float) +0:80 'inF2' (temp 4-component vector of float) +0:80 'inI0' (temp 4-component vector of int) +0:? Sequence +0:81 Constant: +0:81 0.000000 +0:82 Constant: +0:82 0.000000 +0:83 Constant: +0:83 0.000000 +0:84 Constant: +0:84 0.000000 +0:85 Constant: +0:85 0.000000 +0:86 Constant: +0:86 0.000000 +0:87 Constant: +0:87 0.000000 +0:88 Constant: +0:88 0.000000 +0:89 Constant: +0:89 0.000000 +0:90 Constant: +0:90 0.000000 +0:92 Branch: Return with expression +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:? 4.000000 +0:123 Function Definition: PixelShaderFunction(mf22;mf22;mf22; (temp 2X2 matrix of float) +0:116 Function Parameters: +0:116 'inF0' (temp 2X2 matrix of float) +0:116 'inF1' (temp 2X2 matrix of float) +0:116 'inF2' (temp 2X2 matrix of float) +0:? Sequence +0:118 Constant: +0:118 0.000000 +0:118 Constant: +0:118 0.000000 +0:118 Constant: +0:118 0.000000 +0:118 Constant: +0:118 0.000000 +0:118 Constant: +0:118 0.000000 +0:118 Constant: +0:118 0.000000 +0:118 Constant: +0:118 0.000000 +0:118 Constant: +0:118 0.000000 +0:118 Constant: +0:118 0.000000 +0:118 Constant: +0:118 0.000000 +0:118 Constant: +0:118 0.000000 +0:118 Constant: +0:118 0.000000 +0:118 Constant: +0:118 0.000000 +0:118 Constant: +0:118 0.000000 +0:120 Branch: Return with expression +0:? Constant: +0:? 2.000000 +0:? 2.000000 +0:? 2.000000 +0:? 2.000000 +0:131 Function Definition: PixelShaderFunction(mf33;mf33;mf33; (temp 3X3 matrix of float) +0:124 Function Parameters: +0:124 'inF0' (temp 3X3 matrix of float) +0:124 'inF1' (temp 3X3 matrix of float) +0:124 'inF2' (temp 3X3 matrix of float) +0:? Sequence +0:126 Constant: +0:126 0.000000 +0:126 Constant: +0:126 0.000000 +0:126 Constant: +0:126 0.000000 +0:126 Constant: +0:126 0.000000 +0:126 Constant: +0:126 0.000000 +0:126 Constant: +0:126 0.000000 +0:126 Constant: +0:126 0.000000 +0:126 Constant: +0:126 0.000000 +0:126 Constant: +0:126 0.000000 +0:126 Constant: +0:126 0.000000 +0:126 Constant: +0:126 0.000000 +0:126 Constant: +0:126 0.000000 +0:126 Constant: +0:126 0.000000 +0:126 Constant: +0:126 0.000000 +0:128 Branch: Return with expression +0:? Constant: +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:138 Function Definition: PixelShaderFunction(mf44;mf44;mf44; (temp 4X4 matrix of float) +0:132 Function Parameters: +0:132 'inF0' (temp 4X4 matrix of float) +0:132 'inF1' (temp 4X4 matrix of float) +0:132 'inF2' (temp 4X4 matrix of float) +0:? Sequence +0:134 Constant: +0:134 0.000000 +0:134 Constant: +0:134 0.000000 +0:134 Constant: +0:134 0.000000 +0:134 Constant: +0:134 0.000000 +0:134 Constant: +0:134 0.000000 +0:134 Constant: +0:134 0.000000 +0:134 Constant: +0:134 0.000000 +0:134 Constant: +0:134 0.000000 +0:134 Constant: +0:134 0.000000 +0:134 Constant: +0:134 0.000000 +0:134 Constant: +0:134 0.000000 +0:134 Constant: +0:134 0.000000 +0:134 Constant: +0:134 0.000000 +0:134 Constant: +0:134 0.000000 +0:136 Branch: Return with expression +0:? Constant: +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? Linker Objects + + +Linked fragment stage: + + +Shader version: 450 +gl_FragCoord origin is upper left +ERROR: node is still EOpNull! +0:35 Function Definition: PixelShaderFunction(f1;f1;f1;i1; (temp float) +0:2 Function Parameters: +0:2 'inF0' (temp float) +0:2 'inF1' (temp float) +0:2 'inF2' (temp float) +0:2 'inI0' (temp int) +0:? Sequence +0:5 Constant: +0:5 0.000000 +0:6 Constant: +0:6 0.000000 +0:7 Constant: +0:7 0.000000 +0:8 Constant: +0:8 0.000000 +0:9 Constant: +0:9 0.000000 +0:10 Constant: +0:10 0.000000 +0:12 Constant: +0:12 0.000000 +0:13 Constant: +0:13 0.000000 +0:14 Constant: +0:14 0.000000 +0:15 Constant: +0:15 0.000000 +0:23 Constant: +0:23 0.000000 +0:24 Constant: +0:24 0.000000 +0:25 Constant: +0:25 0.000000 +0:26 Constant: +0:26 0.000000 +0:27 Constant: +0:27 0.000000 +0:28 Constant: +0:28 0.000000 +0:29 Constant: +0:29 0.000000 +0:30 Constant: +0:30 0.000000 +0:32 Branch: Return with expression +0:32 Constant: +0:32 0.000000 +0:44 Function Definition: PixelShaderFunction(vf1;vf1;vf1;i1; (temp 1-component vector of float) +0:36 Function Parameters: +0:36 'inF0' (temp 1-component vector of float) +0:36 'inF1' (temp 1-component vector of float) +0:36 'inF2' (temp 1-component vector of float) +0:36 'inI0' (temp int) +0:? Sequence +0:39 Constant: +0:39 0.000000 +0:41 Branch: Return with expression +0:41 Constant: +0:41 0.000000 +0:62 Function Definition: PixelShaderFunction(vf2;vf2;vf2;vi2; (temp 2-component vector of float) +0:45 Function Parameters: +0:45 'inF0' (temp 2-component vector of float) +0:45 'inF1' (temp 2-component vector of float) +0:45 'inF2' (temp 2-component vector of float) +0:45 'inI0' (temp 2-component vector of int) +0:? Sequence +0:46 Constant: +0:46 0.000000 +0:47 Constant: +0:47 0.000000 +0:48 Constant: +0:48 0.000000 +0:49 Constant: +0:49 0.000000 +0:50 Constant: +0:50 0.000000 +0:51 Constant: +0:51 0.000000 +0:52 Constant: +0:52 0.000000 +0:53 Constant: +0:53 0.000000 +0:54 Constant: +0:54 0.000000 +0:55 Constant: +0:55 0.000000 +0:56 Constant: +0:56 0.000000 +0:57 Constant: +0:57 0.000000 +0:59 Branch: Return with expression +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:79 Function Definition: PixelShaderFunction(vf3;vf3;vf3;vi3; (temp 3-component vector of float) +0:63 Function Parameters: +0:63 'inF0' (temp 3-component vector of float) +0:63 'inF1' (temp 3-component vector of float) +0:63 'inF2' (temp 3-component vector of float) +0:63 'inI0' (temp 3-component vector of int) +0:? Sequence +0:64 Constant: +0:64 0.000000 +0:65 Constant: +0:65 0.000000 +0:66 Constant: +0:66 0.000000 +0:67 Constant: +0:67 0.000000 +0:68 Constant: +0:68 0.000000 +0:69 Constant: +0:69 0.000000 +0:70 Constant: +0:70 0.000000 +0:71 Constant: +0:71 0.000000 +0:72 Constant: +0:72 0.000000 +0:73 Constant: +0:73 0.000000 +0:76 Branch: Return with expression +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:115 Function Definition: PixelShaderFunction(vf4;vf4;vf4;vi4; (temp 4-component vector of float) +0:80 Function Parameters: +0:80 'inF0' (temp 4-component vector of float) +0:80 'inF1' (temp 4-component vector of float) +0:80 'inF2' (temp 4-component vector of float) +0:80 'inI0' (temp 4-component vector of int) +0:? Sequence +0:81 Constant: +0:81 0.000000 +0:82 Constant: +0:82 0.000000 +0:83 Constant: +0:83 0.000000 +0:84 Constant: +0:84 0.000000 +0:85 Constant: +0:85 0.000000 +0:86 Constant: +0:86 0.000000 +0:87 Constant: +0:87 0.000000 +0:88 Constant: +0:88 0.000000 +0:89 Constant: +0:89 0.000000 +0:90 Constant: +0:90 0.000000 +0:92 Branch: Return with expression +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:? 4.000000 +0:123 Function Definition: PixelShaderFunction(mf22;mf22;mf22; (temp 2X2 matrix of float) +0:116 Function Parameters: +0:116 'inF0' (temp 2X2 matrix of float) +0:116 'inF1' (temp 2X2 matrix of float) +0:116 'inF2' (temp 2X2 matrix of float) +0:? Sequence +0:118 Constant: +0:118 0.000000 +0:118 Constant: +0:118 0.000000 +0:118 Constant: +0:118 0.000000 +0:118 Constant: +0:118 0.000000 +0:118 Constant: +0:118 0.000000 +0:118 Constant: +0:118 0.000000 +0:118 Constant: +0:118 0.000000 +0:118 Constant: +0:118 0.000000 +0:118 Constant: +0:118 0.000000 +0:118 Constant: +0:118 0.000000 +0:118 Constant: +0:118 0.000000 +0:118 Constant: +0:118 0.000000 +0:118 Constant: +0:118 0.000000 +0:118 Constant: +0:118 0.000000 +0:120 Branch: Return with expression +0:? Constant: +0:? 2.000000 +0:? 2.000000 +0:? 2.000000 +0:? 2.000000 +0:131 Function Definition: PixelShaderFunction(mf33;mf33;mf33; (temp 3X3 matrix of float) +0:124 Function Parameters: +0:124 'inF0' (temp 3X3 matrix of float) +0:124 'inF1' (temp 3X3 matrix of float) +0:124 'inF2' (temp 3X3 matrix of float) +0:? Sequence +0:126 Constant: +0:126 0.000000 +0:126 Constant: +0:126 0.000000 +0:126 Constant: +0:126 0.000000 +0:126 Constant: +0:126 0.000000 +0:126 Constant: +0:126 0.000000 +0:126 Constant: +0:126 0.000000 +0:126 Constant: +0:126 0.000000 +0:126 Constant: +0:126 0.000000 +0:126 Constant: +0:126 0.000000 +0:126 Constant: +0:126 0.000000 +0:126 Constant: +0:126 0.000000 +0:126 Constant: +0:126 0.000000 +0:126 Constant: +0:126 0.000000 +0:126 Constant: +0:126 0.000000 +0:128 Branch: Return with expression +0:? Constant: +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:138 Function Definition: PixelShaderFunction(mf44;mf44;mf44; (temp 4X4 matrix of float) +0:132 Function Parameters: +0:132 'inF0' (temp 4X4 matrix of float) +0:132 'inF1' (temp 4X4 matrix of float) +0:132 'inF2' (temp 4X4 matrix of float) +0:? Sequence +0:134 Constant: +0:134 0.000000 +0:134 Constant: +0:134 0.000000 +0:134 Constant: +0:134 0.000000 +0:134 Constant: +0:134 0.000000 +0:134 Constant: +0:134 0.000000 +0:134 Constant: +0:134 0.000000 +0:134 Constant: +0:134 0.000000 +0:134 Constant: +0:134 0.000000 +0:134 Constant: +0:134 0.000000 +0:134 Constant: +0:134 0.000000 +0:134 Constant: +0:134 0.000000 +0:134 Constant: +0:134 0.000000 +0:134 Constant: +0:134 0.000000 +0:134 Constant: +0:134 0.000000 +0:136 Branch: Return with expression +0:? Constant: +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? Linker Objects + +SPIR-V is not generated for failed compile or link diff --git a/Test/baseResults/hlsl.intrinsics.negative.vert.out b/Test/baseResults/hlsl.intrinsics.negative.vert.out new file mode 100644 index 00000000..6fc87bf3 --- /dev/null +++ b/Test/baseResults/hlsl.intrinsics.negative.vert.out @@ -0,0 +1,1055 @@ +hlsl.intrinsics.negative.vert +ERROR: 0:5: 'asdouble' : no matching overloaded function found +ERROR: 0:6: 'CheckAccessFullyMapped' : no matching overloaded function found +ERROR: 0:7: 'CheckAccessFullyMapped' : no matching overloaded function found +ERROR: 0:8: 'clip' : no matching overloaded function found +ERROR: 0:9: 'countbits' : no matching overloaded function found +ERROR: 0:10: 'cross' : no matching overloaded function found +ERROR: 0:11: 'D3DCOLORtoUBYTE4' : no matching overloaded function found +ERROR: 0:14: 'ddx' : no matching overloaded function found +ERROR: 0:15: 'ddx_coarse' : no matching overloaded function found +ERROR: 0:16: 'ddx_fine' : no matching overloaded function found +ERROR: 0:17: 'ddy' : no matching overloaded function found +ERROR: 0:18: 'ddy_coarse' : no matching overloaded function found +ERROR: 0:19: 'ddy_fine' : no matching overloaded function found +ERROR: 0:20: 'determinant' : no matching overloaded function found +ERROR: 0:21: 'EvaluateAttributeAtCentroid' : no matching overloaded function found +ERROR: 0:22: 'EvaluateAttributeAtSample' : no matching overloaded function found +ERROR: 0:23: 'EvaluateAttributeSnapped' : no matching overloaded function found +ERROR: 0:24: 'f16tof32' : no matching overloaded function found +ERROR: 0:25: 'firstbithigh' : no matching overloaded function found +ERROR: 0:26: 'firstbitlow' : no matching overloaded function found +ERROR: 0:27: 'fma' : no matching overloaded function found +ERROR: 0:35: 'length' : no matching overloaded function found +ERROR: 0:36: 'msad4' : no matching overloaded function found +ERROR: 0:37: 'normalize' : no matching overloaded function found +ERROR: 0:38: 'reflect' : no matching overloaded function found +ERROR: 0:39: 'refract' : no matching overloaded function found +ERROR: 0:40: 'refract' : no matching overloaded function found +ERROR: 0:41: 'reversebits' : no matching overloaded function found +ERROR: 0:42: 'transpose' : no matching overloaded function found +ERROR: 0:53: 'GetRenderTargetSamplePosition' : no matching overloaded function found +ERROR: 0:60: 'asdouble' : no matching overloaded function found +ERROR: 0:61: 'CheckAccessFullyMapped' : no matching overloaded function found +ERROR: 0:62: 'countbits' : no matching overloaded function found +ERROR: 0:63: 'cross' : no matching overloaded function found +ERROR: 0:64: 'D3DCOLORtoUBYTE4' : no matching overloaded function found +ERROR: 0:65: 'ddx' : no matching overloaded function found +ERROR: 0:66: 'ddx_coarse' : no matching overloaded function found +ERROR: 0:67: 'ddx_fine' : no matching overloaded function found +ERROR: 0:68: 'ddy' : no matching overloaded function found +ERROR: 0:69: 'ddy_coarse' : no matching overloaded function found +ERROR: 0:70: 'ddy_fine' : no matching overloaded function found +ERROR: 0:71: 'determinant' : no matching overloaded function found +ERROR: 0:72: 'EvaluateAttributeAtCentroid' : no matching overloaded function found +ERROR: 0:73: 'EvaluateAttributeAtSample' : no matching overloaded function found +ERROR: 0:74: 'EvaluateAttributeSnapped' : no matching overloaded function found +ERROR: 0:75: 'f16tof32' : no matching overloaded function found +ERROR: 0:76: 'firstbithigh' : no matching overloaded function found +ERROR: 0:77: 'firstbitlow' : no matching overloaded function found +ERROR: 0:78: 'fma' : no matching overloaded function found +ERROR: 0:79: 'noise' : no matching overloaded function found +ERROR: 0:80: 'reversebits' : no matching overloaded function found +ERROR: 0:81: 'transpose' : no matching overloaded function found +ERROR: 0:90: 'CheckAccessFullyMapped' : no matching overloaded function found +ERROR: 0:91: 'countbits' : no matching overloaded function found +ERROR: 0:92: 'ddx' : no matching overloaded function found +ERROR: 0:93: 'ddx_coarse' : no matching overloaded function found +ERROR: 0:94: 'ddx_fine' : no matching overloaded function found +ERROR: 0:95: 'ddy' : no matching overloaded function found +ERROR: 0:96: 'ddy_coarse' : no matching overloaded function found +ERROR: 0:97: 'ddy_fine' : no matching overloaded function found +ERROR: 0:98: 'D3DCOLORtoUBYTE4' : no matching overloaded function found +ERROR: 0:99: 'determinant' : no matching overloaded function found +ERROR: 0:100: 'EvaluateAttributeAtCentroid' : no matching overloaded function found +ERROR: 0:101: 'EvaluateAttributeAtSample' : no matching overloaded function found +ERROR: 0:102: 'EvaluateAttributeSnapped' : no matching overloaded function found +ERROR: 0:103: 'f16tof32' : no matching overloaded function found +ERROR: 0:104: 'firstbithigh' : no matching overloaded function found +ERROR: 0:105: 'firstbitlow' : no matching overloaded function found +ERROR: 0:106: 'fma' : no matching overloaded function found +ERROR: 0:107: 'noise' : no matching overloaded function found +ERROR: 0:108: 'reversebits' : no matching overloaded function found +ERROR: 0:109: 'transpose' : no matching overloaded function found +ERROR: 0:118: 'CheckAccessFullyMapped' : no matching overloaded function found +ERROR: 0:119: 'countbits' : no matching overloaded function found +ERROR: 0:120: 'cross' : no matching overloaded function found +ERROR: 0:121: 'determinant' : no matching overloaded function found +ERROR: 0:122: 'ddx' : no matching overloaded function found +ERROR: 0:123: 'ddx_coarse' : no matching overloaded function found +ERROR: 0:124: 'ddx_fine' : no matching overloaded function found +ERROR: 0:125: 'ddy' : no matching overloaded function found +ERROR: 0:126: 'ddy_coarse' : no matching overloaded function found +ERROR: 0:127: 'ddy_fine' : no matching overloaded function found +ERROR: 0:128: 'EvaluateAttributeAtCentroid' : no matching overloaded function found +ERROR: 0:129: 'EvaluateAttributeAtSample' : no matching overloaded function found +ERROR: 0:130: 'EvaluateAttributeSnapped' : no matching overloaded function found +ERROR: 0:131: 'f16tof32' : no matching overloaded function found +ERROR: 0:132: 'firstbithigh' : no matching overloaded function found +ERROR: 0:133: 'firstbitlow' : no matching overloaded function found +ERROR: 0:134: 'fma' : no matching overloaded function found +ERROR: 0:135: 'noise' : no matching overloaded function found +ERROR: 0:136: 'reversebits' : no matching overloaded function found +ERROR: 0:137: 'transpose' : no matching overloaded function found +ERROR: 0:177: 'countbits' : no matching overloaded function found +ERROR: 0:177: 'cross' : no matching overloaded function found +ERROR: 0:177: 'D3DCOLORtoUBYTE4' : no matching overloaded function found +ERROR: 0:177: 'ddx' : no matching overloaded function found +ERROR: 0:177: 'ddx_coarse' : no matching overloaded function found +ERROR: 0:177: 'ddx_fine' : no matching overloaded function found +ERROR: 0:177: 'ddy' : no matching overloaded function found +ERROR: 0:177: 'ddy_coarse' : no matching overloaded function found +ERROR: 0:177: 'ddy_fine' : no matching overloaded function found +ERROR: 0:177: 'EvaluateAttributeAtCentroid' : no matching overloaded function found +ERROR: 0:177: 'EvaluateAttributeAtSample' : no matching overloaded function found +ERROR: 0:177: 'EvaluateAttributeSnapped' : no matching overloaded function found +ERROR: 0:177: 'f16tof32' : no matching overloaded function found +ERROR: 0:177: 'firstbithigh' : no matching overloaded function found +ERROR: 0:177: 'firstbitlow' : no matching overloaded function found +ERROR: 0:177: 'fma' : no matching overloaded function found +ERROR: 0:177: 'noise' : no matching overloaded function found +ERROR: 0:177: 'reversebits' : no matching overloaded function found +ERROR: 0:177: 'length' : no matching overloaded function found +ERROR: 0:177: 'noise' : no matching overloaded function found +ERROR: 0:177: 'normalize' : no matching overloaded function found +ERROR: 0:177: 'reflect' : no matching overloaded function found +ERROR: 0:177: 'refract' : no matching overloaded function found +ERROR: 0:177: 'reversebits' : no matching overloaded function found +ERROR: 0:185: 'countbits' : no matching overloaded function found +ERROR: 0:185: 'cross' : no matching overloaded function found +ERROR: 0:185: 'D3DCOLORtoUBYTE4' : no matching overloaded function found +ERROR: 0:185: 'ddx' : no matching overloaded function found +ERROR: 0:185: 'ddx_coarse' : no matching overloaded function found +ERROR: 0:185: 'ddx_fine' : no matching overloaded function found +ERROR: 0:185: 'ddy' : no matching overloaded function found +ERROR: 0:185: 'ddy_coarse' : no matching overloaded function found +ERROR: 0:185: 'ddy_fine' : no matching overloaded function found +ERROR: 0:185: 'EvaluateAttributeAtCentroid' : no matching overloaded function found +ERROR: 0:185: 'EvaluateAttributeAtSample' : no matching overloaded function found +ERROR: 0:185: 'EvaluateAttributeSnapped' : no matching overloaded function found +ERROR: 0:185: 'f16tof32' : no matching overloaded function found +ERROR: 0:185: 'firstbithigh' : no matching overloaded function found +ERROR: 0:185: 'firstbitlow' : no matching overloaded function found +ERROR: 0:185: 'fma' : no matching overloaded function found +ERROR: 0:185: 'noise' : no matching overloaded function found +ERROR: 0:185: 'reversebits' : no matching overloaded function found +ERROR: 0:185: 'length' : no matching overloaded function found +ERROR: 0:185: 'noise' : no matching overloaded function found +ERROR: 0:185: 'normalize' : no matching overloaded function found +ERROR: 0:185: 'reflect' : no matching overloaded function found +ERROR: 0:185: 'refract' : no matching overloaded function found +ERROR: 0:185: 'reversebits' : no matching overloaded function found +ERROR: 0:193: 'countbits' : no matching overloaded function found +ERROR: 0:193: 'cross' : no matching overloaded function found +ERROR: 0:193: 'D3DCOLORtoUBYTE4' : no matching overloaded function found +ERROR: 0:193: 'ddx' : no matching overloaded function found +ERROR: 0:193: 'ddx_coarse' : no matching overloaded function found +ERROR: 0:193: 'ddx_fine' : no matching overloaded function found +ERROR: 0:193: 'ddy' : no matching overloaded function found +ERROR: 0:193: 'ddy_coarse' : no matching overloaded function found +ERROR: 0:193: 'ddy_fine' : no matching overloaded function found +ERROR: 0:193: 'EvaluateAttributeAtCentroid' : no matching overloaded function found +ERROR: 0:193: 'EvaluateAttributeAtSample' : no matching overloaded function found +ERROR: 0:193: 'EvaluateAttributeSnapped' : no matching overloaded function found +ERROR: 0:193: 'f16tof32' : no matching overloaded function found +ERROR: 0:193: 'firstbithigh' : no matching overloaded function found +ERROR: 0:193: 'firstbitlow' : no matching overloaded function found +ERROR: 0:193: 'fma' : no matching overloaded function found +ERROR: 0:193: 'noise' : no matching overloaded function found +ERROR: 0:193: 'reversebits' : no matching overloaded function found +ERROR: 0:193: 'length' : no matching overloaded function found +ERROR: 0:193: 'noise' : no matching overloaded function found +ERROR: 0:193: 'normalize' : no matching overloaded function found +ERROR: 0:193: 'reflect' : no matching overloaded function found +ERROR: 0:193: 'refract' : no matching overloaded function found +ERROR: 0:193: 'reversebits' : no matching overloaded function found +ERROR: 164 compilation errors. No code generated. + + +Shader version: 450 +ERROR: node is still EOpNull! +0:49 Function Definition: VertexShaderFunction(f1;f1;f1;i1; (temp float) +0:2 Function Parameters: +0:2 'inF0' (temp float) +0:2 'inF1' (temp float) +0:2 'inF2' (temp float) +0:2 'inI0' (temp int) +0:? Sequence +0:5 Constant: +0:5 0.000000 +0:6 Constant: +0:6 0.000000 +0:7 Constant: +0:7 0.000000 +0:8 Constant: +0:8 0.000000 +0:9 Constant: +0:9 0.000000 +0:10 Constant: +0:10 0.000000 +0:11 Constant: +0:11 0.000000 +0:14 Constant: +0:14 0.000000 +0:15 Constant: +0:15 0.000000 +0:16 Constant: +0:16 0.000000 +0:17 Constant: +0:17 0.000000 +0:18 Constant: +0:18 0.000000 +0:19 Constant: +0:19 0.000000 +0:20 Constant: +0:20 0.000000 +0:21 Constant: +0:21 0.000000 +0:22 Constant: +0:22 0.000000 +0:23 Constant: +0:23 0.000000 +0:24 Constant: +0:24 0.000000 +0:25 Constant: +0:25 0.000000 +0:26 Constant: +0:26 0.000000 +0:27 Constant: +0:27 0.000000 +0:35 Constant: +0:35 0.000000 +0:36 Constant: +0:36 0.000000 +0:37 Constant: +0:37 0.000000 +0:38 Constant: +0:38 0.000000 +0:39 Constant: +0:39 0.000000 +0:40 Constant: +0:40 0.000000 +0:41 Constant: +0:41 0.000000 +0:42 Constant: +0:42 0.000000 +0:46 Branch: Return with expression +0:46 Constant: +0:46 0.000000 +0:58 Function Definition: VertexShaderFunction(vf1;vf1;vf1;i1; (temp 1-component vector of float) +0:50 Function Parameters: +0:50 'inF0' (temp 1-component vector of float) +0:50 'inF1' (temp 1-component vector of float) +0:50 'inF2' (temp 1-component vector of float) +0:50 'inI0' (temp int) +0:? Sequence +0:53 Constant: +0:53 0.000000 +0:55 Branch: Return with expression +0:55 Constant: +0:55 0.000000 +0:88 Function Definition: VertexShaderFunction(vf2;vf2;vf2;vi2; (temp 2-component vector of float) +0:59 Function Parameters: +0:59 'inF0' (temp 2-component vector of float) +0:59 'inF1' (temp 2-component vector of float) +0:59 'inF2' (temp 2-component vector of float) +0:59 'inI0' (temp 2-component vector of int) +0:? Sequence +0:60 Constant: +0:60 0.000000 +0:61 Constant: +0:61 0.000000 +0:62 Constant: +0:62 0.000000 +0:63 Constant: +0:63 0.000000 +0:64 Constant: +0:64 0.000000 +0:65 Constant: +0:65 0.000000 +0:66 Constant: +0:66 0.000000 +0:67 Constant: +0:67 0.000000 +0:68 Constant: +0:68 0.000000 +0:69 Constant: +0:69 0.000000 +0:70 Constant: +0:70 0.000000 +0:71 Constant: +0:71 0.000000 +0:72 Constant: +0:72 0.000000 +0:73 Constant: +0:73 0.000000 +0:74 Constant: +0:74 0.000000 +0:75 Constant: +0:75 0.000000 +0:76 Constant: +0:76 0.000000 +0:77 Constant: +0:77 0.000000 +0:78 Constant: +0:78 0.000000 +0:79 Constant: +0:79 0.000000 +0:80 Constant: +0:80 0.000000 +0:81 Constant: +0:81 0.000000 +0:85 Branch: Return with expression +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:116 Function Definition: VertexShaderFunction(vf3;vf3;vf3;vi3; (temp 3-component vector of float) +0:89 Function Parameters: +0:89 'inF0' (temp 3-component vector of float) +0:89 'inF1' (temp 3-component vector of float) +0:89 'inF2' (temp 3-component vector of float) +0:89 'inI0' (temp 3-component vector of int) +0:? Sequence +0:90 Constant: +0:90 0.000000 +0:91 Constant: +0:91 0.000000 +0:92 Constant: +0:92 0.000000 +0:93 Constant: +0:93 0.000000 +0:94 Constant: +0:94 0.000000 +0:95 Constant: +0:95 0.000000 +0:96 Constant: +0:96 0.000000 +0:97 Constant: +0:97 0.000000 +0:98 Constant: +0:98 0.000000 +0:99 Constant: +0:99 0.000000 +0:100 Constant: +0:100 0.000000 +0:101 Constant: +0:101 0.000000 +0:102 Constant: +0:102 0.000000 +0:103 Constant: +0:103 0.000000 +0:104 Constant: +0:104 0.000000 +0:105 Constant: +0:105 0.000000 +0:106 Constant: +0:106 0.000000 +0:107 Constant: +0:107 0.000000 +0:108 Constant: +0:108 0.000000 +0:109 Constant: +0:109 0.000000 +0:113 Branch: Return with expression +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:174 Function Definition: VertexShaderFunction(vf4;vf4;vf4;vi4; (temp 4-component vector of float) +0:117 Function Parameters: +0:117 'inF0' (temp 4-component vector of float) +0:117 'inF1' (temp 4-component vector of float) +0:117 'inF2' (temp 4-component vector of float) +0:117 'inI0' (temp 4-component vector of int) +0:? Sequence +0:118 Constant: +0:118 0.000000 +0:119 Constant: +0:119 0.000000 +0:120 Constant: +0:120 0.000000 +0:121 Constant: +0:121 0.000000 +0:122 Constant: +0:122 0.000000 +0:123 Constant: +0:123 0.000000 +0:124 Constant: +0:124 0.000000 +0:125 Constant: +0:125 0.000000 +0:126 Constant: +0:126 0.000000 +0:127 Constant: +0:127 0.000000 +0:128 Constant: +0:128 0.000000 +0:129 Constant: +0:129 0.000000 +0:130 Constant: +0:130 0.000000 +0:131 Constant: +0:131 0.000000 +0:132 Constant: +0:132 0.000000 +0:133 Constant: +0:133 0.000000 +0:134 Constant: +0:134 0.000000 +0:135 Constant: +0:135 0.000000 +0:136 Constant: +0:136 0.000000 +0:137 Constant: +0:137 0.000000 +0:141 Branch: Return with expression +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:? 4.000000 +0:182 Function Definition: VertexShaderFunction(mf22;mf22;mf22; (temp 2X2 matrix of float) +0:175 Function Parameters: +0:175 'inF0' (temp 2X2 matrix of float) +0:175 'inF1' (temp 2X2 matrix of float) +0:175 'inF2' (temp 2X2 matrix of float) +0:? Sequence +0:177 Constant: +0:177 0.000000 +0:177 Constant: +0:177 0.000000 +0:177 Constant: +0:177 0.000000 +0:177 Constant: +0:177 0.000000 +0:177 Constant: +0:177 0.000000 +0:177 Constant: +0:177 0.000000 +0:177 Constant: +0:177 0.000000 +0:177 Constant: +0:177 0.000000 +0:177 Constant: +0:177 0.000000 +0:177 Constant: +0:177 0.000000 +0:177 Constant: +0:177 0.000000 +0:177 Constant: +0:177 0.000000 +0:177 Constant: +0:177 0.000000 +0:177 Constant: +0:177 0.000000 +0:177 Constant: +0:177 0.000000 +0:177 Constant: +0:177 0.000000 +0:177 Constant: +0:177 0.000000 +0:177 Constant: +0:177 0.000000 +0:177 Constant: +0:177 0.000000 +0:177 Constant: +0:177 0.000000 +0:177 Constant: +0:177 0.000000 +0:177 Constant: +0:177 0.000000 +0:177 Constant: +0:177 0.000000 +0:177 Constant: +0:177 0.000000 +0:179 Branch: Return with expression +0:? Constant: +0:? 2.000000 +0:? 2.000000 +0:? 2.000000 +0:? 2.000000 +0:190 Function Definition: VertexShaderFunction(mf33;mf33;mf33; (temp 3X3 matrix of float) +0:183 Function Parameters: +0:183 'inF0' (temp 3X3 matrix of float) +0:183 'inF1' (temp 3X3 matrix of float) +0:183 'inF2' (temp 3X3 matrix of float) +0:? Sequence +0:185 Constant: +0:185 0.000000 +0:185 Constant: +0:185 0.000000 +0:185 Constant: +0:185 0.000000 +0:185 Constant: +0:185 0.000000 +0:185 Constant: +0:185 0.000000 +0:185 Constant: +0:185 0.000000 +0:185 Constant: +0:185 0.000000 +0:185 Constant: +0:185 0.000000 +0:185 Constant: +0:185 0.000000 +0:185 Constant: +0:185 0.000000 +0:185 Constant: +0:185 0.000000 +0:185 Constant: +0:185 0.000000 +0:185 Constant: +0:185 0.000000 +0:185 Constant: +0:185 0.000000 +0:185 Constant: +0:185 0.000000 +0:185 Constant: +0:185 0.000000 +0:185 Constant: +0:185 0.000000 +0:185 Constant: +0:185 0.000000 +0:185 Constant: +0:185 0.000000 +0:185 Constant: +0:185 0.000000 +0:185 Constant: +0:185 0.000000 +0:185 Constant: +0:185 0.000000 +0:185 Constant: +0:185 0.000000 +0:185 Constant: +0:185 0.000000 +0:187 Branch: Return with expression +0:? Constant: +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:197 Function Definition: VertexShaderFunction(mf44;mf44;mf44; (temp 4X4 matrix of float) +0:191 Function Parameters: +0:191 'inF0' (temp 4X4 matrix of float) +0:191 'inF1' (temp 4X4 matrix of float) +0:191 'inF2' (temp 4X4 matrix of float) +0:? Sequence +0:193 Constant: +0:193 0.000000 +0:193 Constant: +0:193 0.000000 +0:193 Constant: +0:193 0.000000 +0:193 Constant: +0:193 0.000000 +0:193 Constant: +0:193 0.000000 +0:193 Constant: +0:193 0.000000 +0:193 Constant: +0:193 0.000000 +0:193 Constant: +0:193 0.000000 +0:193 Constant: +0:193 0.000000 +0:193 Constant: +0:193 0.000000 +0:193 Constant: +0:193 0.000000 +0:193 Constant: +0:193 0.000000 +0:193 Constant: +0:193 0.000000 +0:193 Constant: +0:193 0.000000 +0:193 Constant: +0:193 0.000000 +0:193 Constant: +0:193 0.000000 +0:193 Constant: +0:193 0.000000 +0:193 Constant: +0:193 0.000000 +0:193 Constant: +0:193 0.000000 +0:193 Constant: +0:193 0.000000 +0:193 Constant: +0:193 0.000000 +0:193 Constant: +0:193 0.000000 +0:193 Constant: +0:193 0.000000 +0:193 Constant: +0:193 0.000000 +0:195 Branch: Return with expression +0:? Constant: +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? Linker Objects + + +Linked vertex stage: + + +Shader version: 450 +ERROR: node is still EOpNull! +0:49 Function Definition: VertexShaderFunction(f1;f1;f1;i1; (temp float) +0:2 Function Parameters: +0:2 'inF0' (temp float) +0:2 'inF1' (temp float) +0:2 'inF2' (temp float) +0:2 'inI0' (temp int) +0:? Sequence +0:5 Constant: +0:5 0.000000 +0:6 Constant: +0:6 0.000000 +0:7 Constant: +0:7 0.000000 +0:8 Constant: +0:8 0.000000 +0:9 Constant: +0:9 0.000000 +0:10 Constant: +0:10 0.000000 +0:11 Constant: +0:11 0.000000 +0:14 Constant: +0:14 0.000000 +0:15 Constant: +0:15 0.000000 +0:16 Constant: +0:16 0.000000 +0:17 Constant: +0:17 0.000000 +0:18 Constant: +0:18 0.000000 +0:19 Constant: +0:19 0.000000 +0:20 Constant: +0:20 0.000000 +0:21 Constant: +0:21 0.000000 +0:22 Constant: +0:22 0.000000 +0:23 Constant: +0:23 0.000000 +0:24 Constant: +0:24 0.000000 +0:25 Constant: +0:25 0.000000 +0:26 Constant: +0:26 0.000000 +0:27 Constant: +0:27 0.000000 +0:35 Constant: +0:35 0.000000 +0:36 Constant: +0:36 0.000000 +0:37 Constant: +0:37 0.000000 +0:38 Constant: +0:38 0.000000 +0:39 Constant: +0:39 0.000000 +0:40 Constant: +0:40 0.000000 +0:41 Constant: +0:41 0.000000 +0:42 Constant: +0:42 0.000000 +0:46 Branch: Return with expression +0:46 Constant: +0:46 0.000000 +0:58 Function Definition: VertexShaderFunction(vf1;vf1;vf1;i1; (temp 1-component vector of float) +0:50 Function Parameters: +0:50 'inF0' (temp 1-component vector of float) +0:50 'inF1' (temp 1-component vector of float) +0:50 'inF2' (temp 1-component vector of float) +0:50 'inI0' (temp int) +0:? Sequence +0:53 Constant: +0:53 0.000000 +0:55 Branch: Return with expression +0:55 Constant: +0:55 0.000000 +0:88 Function Definition: VertexShaderFunction(vf2;vf2;vf2;vi2; (temp 2-component vector of float) +0:59 Function Parameters: +0:59 'inF0' (temp 2-component vector of float) +0:59 'inF1' (temp 2-component vector of float) +0:59 'inF2' (temp 2-component vector of float) +0:59 'inI0' (temp 2-component vector of int) +0:? Sequence +0:60 Constant: +0:60 0.000000 +0:61 Constant: +0:61 0.000000 +0:62 Constant: +0:62 0.000000 +0:63 Constant: +0:63 0.000000 +0:64 Constant: +0:64 0.000000 +0:65 Constant: +0:65 0.000000 +0:66 Constant: +0:66 0.000000 +0:67 Constant: +0:67 0.000000 +0:68 Constant: +0:68 0.000000 +0:69 Constant: +0:69 0.000000 +0:70 Constant: +0:70 0.000000 +0:71 Constant: +0:71 0.000000 +0:72 Constant: +0:72 0.000000 +0:73 Constant: +0:73 0.000000 +0:74 Constant: +0:74 0.000000 +0:75 Constant: +0:75 0.000000 +0:76 Constant: +0:76 0.000000 +0:77 Constant: +0:77 0.000000 +0:78 Constant: +0:78 0.000000 +0:79 Constant: +0:79 0.000000 +0:80 Constant: +0:80 0.000000 +0:81 Constant: +0:81 0.000000 +0:85 Branch: Return with expression +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:116 Function Definition: VertexShaderFunction(vf3;vf3;vf3;vi3; (temp 3-component vector of float) +0:89 Function Parameters: +0:89 'inF0' (temp 3-component vector of float) +0:89 'inF1' (temp 3-component vector of float) +0:89 'inF2' (temp 3-component vector of float) +0:89 'inI0' (temp 3-component vector of int) +0:? Sequence +0:90 Constant: +0:90 0.000000 +0:91 Constant: +0:91 0.000000 +0:92 Constant: +0:92 0.000000 +0:93 Constant: +0:93 0.000000 +0:94 Constant: +0:94 0.000000 +0:95 Constant: +0:95 0.000000 +0:96 Constant: +0:96 0.000000 +0:97 Constant: +0:97 0.000000 +0:98 Constant: +0:98 0.000000 +0:99 Constant: +0:99 0.000000 +0:100 Constant: +0:100 0.000000 +0:101 Constant: +0:101 0.000000 +0:102 Constant: +0:102 0.000000 +0:103 Constant: +0:103 0.000000 +0:104 Constant: +0:104 0.000000 +0:105 Constant: +0:105 0.000000 +0:106 Constant: +0:106 0.000000 +0:107 Constant: +0:107 0.000000 +0:108 Constant: +0:108 0.000000 +0:109 Constant: +0:109 0.000000 +0:113 Branch: Return with expression +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:174 Function Definition: VertexShaderFunction(vf4;vf4;vf4;vi4; (temp 4-component vector of float) +0:117 Function Parameters: +0:117 'inF0' (temp 4-component vector of float) +0:117 'inF1' (temp 4-component vector of float) +0:117 'inF2' (temp 4-component vector of float) +0:117 'inI0' (temp 4-component vector of int) +0:? Sequence +0:118 Constant: +0:118 0.000000 +0:119 Constant: +0:119 0.000000 +0:120 Constant: +0:120 0.000000 +0:121 Constant: +0:121 0.000000 +0:122 Constant: +0:122 0.000000 +0:123 Constant: +0:123 0.000000 +0:124 Constant: +0:124 0.000000 +0:125 Constant: +0:125 0.000000 +0:126 Constant: +0:126 0.000000 +0:127 Constant: +0:127 0.000000 +0:128 Constant: +0:128 0.000000 +0:129 Constant: +0:129 0.000000 +0:130 Constant: +0:130 0.000000 +0:131 Constant: +0:131 0.000000 +0:132 Constant: +0:132 0.000000 +0:133 Constant: +0:133 0.000000 +0:134 Constant: +0:134 0.000000 +0:135 Constant: +0:135 0.000000 +0:136 Constant: +0:136 0.000000 +0:137 Constant: +0:137 0.000000 +0:141 Branch: Return with expression +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:? 4.000000 +0:182 Function Definition: VertexShaderFunction(mf22;mf22;mf22; (temp 2X2 matrix of float) +0:175 Function Parameters: +0:175 'inF0' (temp 2X2 matrix of float) +0:175 'inF1' (temp 2X2 matrix of float) +0:175 'inF2' (temp 2X2 matrix of float) +0:? Sequence +0:177 Constant: +0:177 0.000000 +0:177 Constant: +0:177 0.000000 +0:177 Constant: +0:177 0.000000 +0:177 Constant: +0:177 0.000000 +0:177 Constant: +0:177 0.000000 +0:177 Constant: +0:177 0.000000 +0:177 Constant: +0:177 0.000000 +0:177 Constant: +0:177 0.000000 +0:177 Constant: +0:177 0.000000 +0:177 Constant: +0:177 0.000000 +0:177 Constant: +0:177 0.000000 +0:177 Constant: +0:177 0.000000 +0:177 Constant: +0:177 0.000000 +0:177 Constant: +0:177 0.000000 +0:177 Constant: +0:177 0.000000 +0:177 Constant: +0:177 0.000000 +0:177 Constant: +0:177 0.000000 +0:177 Constant: +0:177 0.000000 +0:177 Constant: +0:177 0.000000 +0:177 Constant: +0:177 0.000000 +0:177 Constant: +0:177 0.000000 +0:177 Constant: +0:177 0.000000 +0:177 Constant: +0:177 0.000000 +0:177 Constant: +0:177 0.000000 +0:179 Branch: Return with expression +0:? Constant: +0:? 2.000000 +0:? 2.000000 +0:? 2.000000 +0:? 2.000000 +0:190 Function Definition: VertexShaderFunction(mf33;mf33;mf33; (temp 3X3 matrix of float) +0:183 Function Parameters: +0:183 'inF0' (temp 3X3 matrix of float) +0:183 'inF1' (temp 3X3 matrix of float) +0:183 'inF2' (temp 3X3 matrix of float) +0:? Sequence +0:185 Constant: +0:185 0.000000 +0:185 Constant: +0:185 0.000000 +0:185 Constant: +0:185 0.000000 +0:185 Constant: +0:185 0.000000 +0:185 Constant: +0:185 0.000000 +0:185 Constant: +0:185 0.000000 +0:185 Constant: +0:185 0.000000 +0:185 Constant: +0:185 0.000000 +0:185 Constant: +0:185 0.000000 +0:185 Constant: +0:185 0.000000 +0:185 Constant: +0:185 0.000000 +0:185 Constant: +0:185 0.000000 +0:185 Constant: +0:185 0.000000 +0:185 Constant: +0:185 0.000000 +0:185 Constant: +0:185 0.000000 +0:185 Constant: +0:185 0.000000 +0:185 Constant: +0:185 0.000000 +0:185 Constant: +0:185 0.000000 +0:185 Constant: +0:185 0.000000 +0:185 Constant: +0:185 0.000000 +0:185 Constant: +0:185 0.000000 +0:185 Constant: +0:185 0.000000 +0:185 Constant: +0:185 0.000000 +0:185 Constant: +0:185 0.000000 +0:187 Branch: Return with expression +0:? Constant: +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:197 Function Definition: VertexShaderFunction(mf44;mf44;mf44; (temp 4X4 matrix of float) +0:191 Function Parameters: +0:191 'inF0' (temp 4X4 matrix of float) +0:191 'inF1' (temp 4X4 matrix of float) +0:191 'inF2' (temp 4X4 matrix of float) +0:? Sequence +0:193 Constant: +0:193 0.000000 +0:193 Constant: +0:193 0.000000 +0:193 Constant: +0:193 0.000000 +0:193 Constant: +0:193 0.000000 +0:193 Constant: +0:193 0.000000 +0:193 Constant: +0:193 0.000000 +0:193 Constant: +0:193 0.000000 +0:193 Constant: +0:193 0.000000 +0:193 Constant: +0:193 0.000000 +0:193 Constant: +0:193 0.000000 +0:193 Constant: +0:193 0.000000 +0:193 Constant: +0:193 0.000000 +0:193 Constant: +0:193 0.000000 +0:193 Constant: +0:193 0.000000 +0:193 Constant: +0:193 0.000000 +0:193 Constant: +0:193 0.000000 +0:193 Constant: +0:193 0.000000 +0:193 Constant: +0:193 0.000000 +0:193 Constant: +0:193 0.000000 +0:193 Constant: +0:193 0.000000 +0:193 Constant: +0:193 0.000000 +0:193 Constant: +0:193 0.000000 +0:193 Constant: +0:193 0.000000 +0:193 Constant: +0:193 0.000000 +0:195 Branch: Return with expression +0:? Constant: +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? Linker Objects + +SPIR-V is not generated for failed compile or link diff --git a/Test/baseResults/hlsl.intrinsics.vert.out b/Test/baseResults/hlsl.intrinsics.vert.out new file mode 100644 index 00000000..22b301e0 --- /dev/null +++ b/Test/baseResults/hlsl.intrinsics.vert.out @@ -0,0 +1,1994 @@ +hlsl.intrinsics.vert +Shader version: 450 +0:? Sequence +0:56 Function Definition: VertexShaderFunction(f1;f1;f1; (temp float) +0:2 Function Parameters: +0:2 'inF0' (temp float) +0:2 'inF1' (temp float) +0:2 'inF2' (temp float) +0:? Sequence +0:3 all (global bool) +0:3 'inF0' (temp float) +0:4 Absolute value (global float) +0:4 'inF0' (temp float) +0:5 arc cosine (global float) +0:5 'inF0' (temp float) +0:6 any (global bool) +0:6 'inF0' (temp float) +0:7 arc sine (global float) +0:7 'inF0' (temp float) +0:8 arc tangent (global float) +0:8 'inF0' (temp float) +0:9 arc tangent (global float) +0:9 'inF0' (temp float) +0:9 'inF1' (temp float) +0:10 Ceiling (global float) +0:10 'inF0' (temp float) +0:11 clamp (global float) +0:11 'inF0' (temp float) +0:11 'inF1' (temp float) +0:11 'inF2' (temp float) +0:12 cosine (global float) +0:12 'inF0' (temp float) +0:13 hyp. cosine (global float) +0:13 'inF0' (temp float) +0:14 bitCount (global uint) +0:14 Constant: +0:14 7 (const uint) +0:15 degrees (global float) +0:15 'inF0' (temp float) +0:19 exp (global float) +0:19 'inF0' (temp float) +0:20 exp2 (global float) +0:20 'inF0' (temp float) +0:21 findMSB (global int) +0:21 Constant: +0:21 7 (const int) +0:22 findLSB (global int) +0:22 Constant: +0:22 7 (const int) +0:23 Floor (global float) +0:23 'inF0' (temp float) +0:25 Function Call: fmod(f1;f1; (global float) +0:25 'inF0' (temp float) +0:25 'inF1' (temp float) +0:26 Fraction (global float) +0:26 'inF0' (temp float) +0:27 frexp (global float) +0:27 'inF0' (temp float) +0:27 'inF1' (temp float) +0:28 fwidth (global float) +0:28 'inF0' (temp float) +0:29 isinf (global bool) +0:29 'inF0' (temp float) +0:30 isnan (global bool) +0:30 'inF0' (temp float) +0:31 ldexp (global float) +0:31 'inF0' (temp float) +0:31 'inF1' (temp float) +0:32 log (global float) +0:32 'inF0' (temp float) +0:33 log2 (global float) +0:33 'inF0' (temp float) +0:34 max (global float) +0:34 'inF0' (temp float) +0:34 'inF1' (temp float) +0:35 min (global float) +0:35 'inF0' (temp float) +0:35 'inF1' (temp float) +0:37 pow (global float) +0:37 'inF0' (temp float) +0:37 'inF1' (temp float) +0:38 radians (global float) +0:38 'inF0' (temp float) +0:39 bitFieldReverse (global uint) +0:39 Constant: +0:39 2 (const uint) +0:40 roundEven (global float) +0:40 'inF0' (temp float) +0:41 inverse sqrt (global float) +0:41 'inF0' (temp float) +0:42 Sign (global float) +0:42 'inF0' (temp float) +0:43 sine (global float) +0:43 'inF0' (temp float) +0:44 hyp. sine (global float) +0:44 'inF0' (temp float) +0:45 smoothstep (global float) +0:45 'inF0' (temp float) +0:45 'inF1' (temp float) +0:45 'inF2' (temp float) +0:46 sqrt (global float) +0:46 'inF0' (temp float) +0:47 step (global float) +0:47 'inF0' (temp float) +0:47 'inF1' (temp float) +0:48 tangent (global float) +0:48 'inF0' (temp float) +0:49 hyp. tangent (global float) +0:49 'inF0' (temp float) +0:51 trunc (global float) +0:51 'inF0' (temp float) +0:53 Branch: Return with expression +0:53 Constant: +0:53 0.000000 +0:62 Function Definition: VertexShaderFunction(vf1;vf1;vf1; (temp 1-component vector of float) +0:57 Function Parameters: +0:57 'inF0' (temp 1-component vector of float) +0:57 'inF1' (temp 1-component vector of float) +0:57 'inF2' (temp 1-component vector of float) +0:? Sequence +0:59 Branch: Return with expression +0:59 Constant: +0:59 0.000000 +0:125 Function Definition: VertexShaderFunction(vf2;vf2;vf2; (temp 2-component vector of float) +0:63 Function Parameters: +0:63 'inF0' (temp 2-component vector of float) +0:63 'inF1' (temp 2-component vector of float) +0:63 'inF2' (temp 2-component vector of float) +0:? Sequence +0:64 all (global bool) +0:64 'inF0' (temp 2-component vector of float) +0:65 Absolute value (global 2-component vector of float) +0:65 'inF0' (temp 2-component vector of float) +0:66 arc cosine (global 2-component vector of float) +0:66 'inF0' (temp 2-component vector of float) +0:67 any (global bool) +0:67 'inF0' (temp 2-component vector of float) +0:68 arc sine (global 2-component vector of float) +0:68 'inF0' (temp 2-component vector of float) +0:69 arc tangent (global 2-component vector of float) +0:69 'inF0' (temp 2-component vector of float) +0:70 arc tangent (global 2-component vector of float) +0:70 'inF0' (temp 2-component vector of float) +0:70 'inF1' (temp 2-component vector of float) +0:71 Ceiling (global 2-component vector of float) +0:71 'inF0' (temp 2-component vector of float) +0:72 clamp (global 2-component vector of float) +0:72 'inF0' (temp 2-component vector of float) +0:72 'inF1' (temp 2-component vector of float) +0:72 'inF2' (temp 2-component vector of float) +0:73 cosine (global 2-component vector of float) +0:73 'inF0' (temp 2-component vector of float) +0:74 hyp. cosine (global 2-component vector of float) +0:74 'inF0' (temp 2-component vector of float) +0:? bitCount (global 2-component vector of uint) +0:? Constant: +0:? 7 (const uint) +0:? 3 (const uint) +0:76 degrees (global 2-component vector of float) +0:76 'inF0' (temp 2-component vector of float) +0:77 distance (global float) +0:77 'inF0' (temp 2-component vector of float) +0:77 'inF1' (temp 2-component vector of float) +0:78 dot-product (global float) +0:78 'inF0' (temp 2-component vector of float) +0:78 'inF1' (temp 2-component vector of float) +0:82 exp (global 2-component vector of float) +0:82 'inF0' (temp 2-component vector of float) +0:83 exp2 (global 2-component vector of float) +0:83 'inF0' (temp 2-component vector of float) +0:84 face-forward (global 2-component vector of float) +0:84 'inF0' (temp 2-component vector of float) +0:84 'inF1' (temp 2-component vector of float) +0:84 'inF2' (temp 2-component vector of float) +0:85 findMSB (global int) +0:85 Constant: +0:85 7 (const int) +0:86 findLSB (global int) +0:86 Constant: +0:86 7 (const int) +0:87 Floor (global 2-component vector of float) +0:87 'inF0' (temp 2-component vector of float) +0:89 Function Call: fmod(vf2;vf2; (global 2-component vector of float) +0:89 'inF0' (temp 2-component vector of float) +0:89 'inF1' (temp 2-component vector of float) +0:90 Fraction (global 2-component vector of float) +0:90 'inF0' (temp 2-component vector of float) +0:91 frexp (global 2-component vector of float) +0:91 'inF0' (temp 2-component vector of float) +0:91 'inF1' (temp 2-component vector of float) +0:92 fwidth (global 2-component vector of float) +0:92 'inF0' (temp 2-component vector of float) +0:93 isinf (global 2-component vector of bool) +0:93 'inF0' (temp 2-component vector of float) +0:94 isnan (global 2-component vector of bool) +0:94 'inF0' (temp 2-component vector of float) +0:95 ldexp (global 2-component vector of float) +0:95 'inF0' (temp 2-component vector of float) +0:95 'inF1' (temp 2-component vector of float) +0:96 length (global float) +0:96 'inF0' (temp 2-component vector of float) +0:97 log (global 2-component vector of float) +0:97 'inF0' (temp 2-component vector of float) +0:98 log2 (global 2-component vector of float) +0:98 'inF0' (temp 2-component vector of float) +0:99 max (global 2-component vector of float) +0:99 'inF0' (temp 2-component vector of float) +0:99 'inF1' (temp 2-component vector of float) +0:100 min (global 2-component vector of float) +0:100 'inF0' (temp 2-component vector of float) +0:100 'inF1' (temp 2-component vector of float) +0:102 normalize (global 2-component vector of float) +0:102 'inF0' (temp 2-component vector of float) +0:103 pow (global 2-component vector of float) +0:103 'inF0' (temp 2-component vector of float) +0:103 'inF1' (temp 2-component vector of float) +0:104 radians (global 2-component vector of float) +0:104 'inF0' (temp 2-component vector of float) +0:105 reflect (global 2-component vector of float) +0:105 'inF0' (temp 2-component vector of float) +0:105 'inF1' (temp 2-component vector of float) +0:106 refract (global 2-component vector of float) +0:106 'inF0' (temp 2-component vector of float) +0:106 'inF1' (temp 2-component vector of float) +0:106 Constant: +0:106 2.000000 +0:? bitFieldReverse (global 2-component vector of uint) +0:? Constant: +0:? 1 (const uint) +0:? 2 (const uint) +0:108 roundEven (global 2-component vector of float) +0:108 'inF0' (temp 2-component vector of float) +0:109 inverse sqrt (global 2-component vector of float) +0:109 'inF0' (temp 2-component vector of float) +0:110 Sign (global 2-component vector of float) +0:110 'inF0' (temp 2-component vector of float) +0:111 sine (global 2-component vector of float) +0:111 'inF0' (temp 2-component vector of float) +0:112 hyp. sine (global 2-component vector of float) +0:112 'inF0' (temp 2-component vector of float) +0:113 smoothstep (global 2-component vector of float) +0:113 'inF0' (temp 2-component vector of float) +0:113 'inF1' (temp 2-component vector of float) +0:113 'inF2' (temp 2-component vector of float) +0:114 sqrt (global 2-component vector of float) +0:114 'inF0' (temp 2-component vector of float) +0:115 step (global 2-component vector of float) +0:115 'inF0' (temp 2-component vector of float) +0:115 'inF1' (temp 2-component vector of float) +0:116 tangent (global 2-component vector of float) +0:116 'inF0' (temp 2-component vector of float) +0:117 hyp. tangent (global 2-component vector of float) +0:117 'inF0' (temp 2-component vector of float) +0:119 trunc (global 2-component vector of float) +0:119 'inF0' (temp 2-component vector of float) +0:122 Branch: Return with expression +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:189 Function Definition: VertexShaderFunction(vf3;vf3;vf3; (temp 3-component vector of float) +0:126 Function Parameters: +0:126 'inF0' (temp 3-component vector of float) +0:126 'inF1' (temp 3-component vector of float) +0:126 'inF2' (temp 3-component vector of float) +0:? Sequence +0:127 all (global bool) +0:127 'inF0' (temp 3-component vector of float) +0:128 Absolute value (global 3-component vector of float) +0:128 'inF0' (temp 3-component vector of float) +0:129 arc cosine (global 3-component vector of float) +0:129 'inF0' (temp 3-component vector of float) +0:130 any (global bool) +0:130 'inF0' (temp 3-component vector of float) +0:131 arc sine (global 3-component vector of float) +0:131 'inF0' (temp 3-component vector of float) +0:132 arc tangent (global 3-component vector of float) +0:132 'inF0' (temp 3-component vector of float) +0:133 arc tangent (global 3-component vector of float) +0:133 'inF0' (temp 3-component vector of float) +0:133 'inF1' (temp 3-component vector of float) +0:134 Ceiling (global 3-component vector of float) +0:134 'inF0' (temp 3-component vector of float) +0:135 clamp (global 3-component vector of float) +0:135 'inF0' (temp 3-component vector of float) +0:135 'inF1' (temp 3-component vector of float) +0:135 'inF2' (temp 3-component vector of float) +0:136 cosine (global 3-component vector of float) +0:136 'inF0' (temp 3-component vector of float) +0:137 hyp. cosine (global 3-component vector of float) +0:137 'inF0' (temp 3-component vector of float) +0:? bitCount (global 3-component vector of uint) +0:? Constant: +0:? 7 (const uint) +0:? 3 (const uint) +0:? 5 (const uint) +0:139 cross-product (global 3-component vector of float) +0:139 'inF0' (temp 3-component vector of float) +0:139 'inF1' (temp 3-component vector of float) +0:140 degrees (global 3-component vector of float) +0:140 'inF0' (temp 3-component vector of float) +0:141 distance (global float) +0:141 'inF0' (temp 3-component vector of float) +0:141 'inF1' (temp 3-component vector of float) +0:142 dot-product (global float) +0:142 'inF0' (temp 3-component vector of float) +0:142 'inF1' (temp 3-component vector of float) +0:146 exp (global 3-component vector of float) +0:146 'inF0' (temp 3-component vector of float) +0:147 exp2 (global 3-component vector of float) +0:147 'inF0' (temp 3-component vector of float) +0:148 face-forward (global 3-component vector of float) +0:148 'inF0' (temp 3-component vector of float) +0:148 'inF1' (temp 3-component vector of float) +0:148 'inF2' (temp 3-component vector of float) +0:149 findMSB (global int) +0:149 Constant: +0:149 7 (const int) +0:150 findLSB (global int) +0:150 Constant: +0:150 7 (const int) +0:151 Floor (global 3-component vector of float) +0:151 'inF0' (temp 3-component vector of float) +0:153 Function Call: fmod(vf3;vf3; (global 3-component vector of float) +0:153 'inF0' (temp 3-component vector of float) +0:153 'inF1' (temp 3-component vector of float) +0:154 Fraction (global 3-component vector of float) +0:154 'inF0' (temp 3-component vector of float) +0:155 frexp (global 3-component vector of float) +0:155 'inF0' (temp 3-component vector of float) +0:155 'inF1' (temp 3-component vector of float) +0:156 fwidth (global 3-component vector of float) +0:156 'inF0' (temp 3-component vector of float) +0:157 isinf (global 3-component vector of bool) +0:157 'inF0' (temp 3-component vector of float) +0:158 isnan (global 3-component vector of bool) +0:158 'inF0' (temp 3-component vector of float) +0:159 ldexp (global 3-component vector of float) +0:159 'inF0' (temp 3-component vector of float) +0:159 'inF1' (temp 3-component vector of float) +0:160 length (global float) +0:160 'inF0' (temp 3-component vector of float) +0:161 log (global 3-component vector of float) +0:161 'inF0' (temp 3-component vector of float) +0:162 log2 (global 3-component vector of float) +0:162 'inF0' (temp 3-component vector of float) +0:163 max (global 3-component vector of float) +0:163 'inF0' (temp 3-component vector of float) +0:163 'inF1' (temp 3-component vector of float) +0:164 min (global 3-component vector of float) +0:164 'inF0' (temp 3-component vector of float) +0:164 'inF1' (temp 3-component vector of float) +0:166 normalize (global 3-component vector of float) +0:166 'inF0' (temp 3-component vector of float) +0:167 pow (global 3-component vector of float) +0:167 'inF0' (temp 3-component vector of float) +0:167 'inF1' (temp 3-component vector of float) +0:168 radians (global 3-component vector of float) +0:168 'inF0' (temp 3-component vector of float) +0:169 reflect (global 3-component vector of float) +0:169 'inF0' (temp 3-component vector of float) +0:169 'inF1' (temp 3-component vector of float) +0:170 refract (global 3-component vector of float) +0:170 'inF0' (temp 3-component vector of float) +0:170 'inF1' (temp 3-component vector of float) +0:170 Constant: +0:170 2.000000 +0:? bitFieldReverse (global 3-component vector of uint) +0:? Constant: +0:? 1 (const uint) +0:? 2 (const uint) +0:? 3 (const uint) +0:172 roundEven (global 3-component vector of float) +0:172 'inF0' (temp 3-component vector of float) +0:173 inverse sqrt (global 3-component vector of float) +0:173 'inF0' (temp 3-component vector of float) +0:174 Sign (global 3-component vector of float) +0:174 'inF0' (temp 3-component vector of float) +0:175 sine (global 3-component vector of float) +0:175 'inF0' (temp 3-component vector of float) +0:176 hyp. sine (global 3-component vector of float) +0:176 'inF0' (temp 3-component vector of float) +0:177 smoothstep (global 3-component vector of float) +0:177 'inF0' (temp 3-component vector of float) +0:177 'inF1' (temp 3-component vector of float) +0:177 'inF2' (temp 3-component vector of float) +0:178 sqrt (global 3-component vector of float) +0:178 'inF0' (temp 3-component vector of float) +0:179 step (global 3-component vector of float) +0:179 'inF0' (temp 3-component vector of float) +0:179 'inF1' (temp 3-component vector of float) +0:180 tangent (global 3-component vector of float) +0:180 'inF0' (temp 3-component vector of float) +0:181 hyp. tangent (global 3-component vector of float) +0:181 'inF0' (temp 3-component vector of float) +0:183 trunc (global 3-component vector of float) +0:183 'inF0' (temp 3-component vector of float) +0:186 Branch: Return with expression +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:298 Function Definition: VertexShaderFunction(vf4;vf4;vf4; (temp 4-component vector of float) +0:190 Function Parameters: +0:190 'inF0' (temp 4-component vector of float) +0:190 'inF1' (temp 4-component vector of float) +0:190 'inF2' (temp 4-component vector of float) +0:? Sequence +0:191 all (global bool) +0:191 'inF0' (temp 4-component vector of float) +0:192 Absolute value (global 4-component vector of float) +0:192 'inF0' (temp 4-component vector of float) +0:193 arc cosine (global 4-component vector of float) +0:193 'inF0' (temp 4-component vector of float) +0:194 any (global bool) +0:194 'inF0' (temp 4-component vector of float) +0:195 arc sine (global 4-component vector of float) +0:195 'inF0' (temp 4-component vector of float) +0:196 arc tangent (global 4-component vector of float) +0:196 'inF0' (temp 4-component vector of float) +0:197 arc tangent (global 4-component vector of float) +0:197 'inF0' (temp 4-component vector of float) +0:197 'inF1' (temp 4-component vector of float) +0:198 Ceiling (global 4-component vector of float) +0:198 'inF0' (temp 4-component vector of float) +0:199 clamp (global 4-component vector of float) +0:199 'inF0' (temp 4-component vector of float) +0:199 'inF1' (temp 4-component vector of float) +0:199 'inF2' (temp 4-component vector of float) +0:200 cosine (global 4-component vector of float) +0:200 'inF0' (temp 4-component vector of float) +0:201 hyp. cosine (global 4-component vector of float) +0:201 'inF0' (temp 4-component vector of float) +0:? bitCount (global 4-component vector of uint) +0:? Constant: +0:? 7 (const uint) +0:? 3 (const uint) +0:? 5 (const uint) +0:? 2 (const uint) +0:203 degrees (global 4-component vector of float) +0:203 'inF0' (temp 4-component vector of float) +0:204 distance (global float) +0:204 'inF0' (temp 4-component vector of float) +0:204 'inF1' (temp 4-component vector of float) +0:205 dot-product (global float) +0:205 'inF0' (temp 4-component vector of float) +0:205 'inF1' (temp 4-component vector of float) +0:209 exp (global 4-component vector of float) +0:209 'inF0' (temp 4-component vector of float) +0:210 exp2 (global 4-component vector of float) +0:210 'inF0' (temp 4-component vector of float) +0:211 face-forward (global 4-component vector of float) +0:211 'inF0' (temp 4-component vector of float) +0:211 'inF1' (temp 4-component vector of float) +0:211 'inF2' (temp 4-component vector of float) +0:212 findMSB (global int) +0:212 Constant: +0:212 7 (const int) +0:213 findLSB (global int) +0:213 Constant: +0:213 7 (const int) +0:214 Floor (global 4-component vector of float) +0:214 'inF0' (temp 4-component vector of float) +0:216 Function Call: fmod(vf4;vf4; (global 4-component vector of float) +0:216 'inF0' (temp 4-component vector of float) +0:216 'inF1' (temp 4-component vector of float) +0:217 Fraction (global 4-component vector of float) +0:217 'inF0' (temp 4-component vector of float) +0:218 frexp (global 4-component vector of float) +0:218 'inF0' (temp 4-component vector of float) +0:218 'inF1' (temp 4-component vector of float) +0:219 fwidth (global 4-component vector of float) +0:219 'inF0' (temp 4-component vector of float) +0:220 isinf (global 4-component vector of bool) +0:220 'inF0' (temp 4-component vector of float) +0:221 isnan (global 4-component vector of bool) +0:221 'inF0' (temp 4-component vector of float) +0:222 ldexp (global 4-component vector of float) +0:222 'inF0' (temp 4-component vector of float) +0:222 'inF1' (temp 4-component vector of float) +0:223 length (global float) +0:223 'inF0' (temp 4-component vector of float) +0:224 log (global 4-component vector of float) +0:224 'inF0' (temp 4-component vector of float) +0:225 log2 (global 4-component vector of float) +0:225 'inF0' (temp 4-component vector of float) +0:226 max (global 4-component vector of float) +0:226 'inF0' (temp 4-component vector of float) +0:226 'inF1' (temp 4-component vector of float) +0:227 min (global 4-component vector of float) +0:227 'inF0' (temp 4-component vector of float) +0:227 'inF1' (temp 4-component vector of float) +0:229 normalize (global 4-component vector of float) +0:229 'inF0' (temp 4-component vector of float) +0:230 pow (global 4-component vector of float) +0:230 'inF0' (temp 4-component vector of float) +0:230 'inF1' (temp 4-component vector of float) +0:231 radians (global 4-component vector of float) +0:231 'inF0' (temp 4-component vector of float) +0:232 reflect (global 4-component vector of float) +0:232 'inF0' (temp 4-component vector of float) +0:232 'inF1' (temp 4-component vector of float) +0:233 refract (global 4-component vector of float) +0:233 'inF0' (temp 4-component vector of float) +0:233 'inF1' (temp 4-component vector of float) +0:233 Constant: +0:233 2.000000 +0:? bitFieldReverse (global 4-component vector of uint) +0:? Constant: +0:? 1 (const uint) +0:? 2 (const uint) +0:? 3 (const uint) +0:? 4 (const uint) +0:235 roundEven (global 4-component vector of float) +0:235 'inF0' (temp 4-component vector of float) +0:236 inverse sqrt (global 4-component vector of float) +0:236 'inF0' (temp 4-component vector of float) +0:237 Sign (global 4-component vector of float) +0:237 'inF0' (temp 4-component vector of float) +0:238 sine (global 4-component vector of float) +0:238 'inF0' (temp 4-component vector of float) +0:239 hyp. sine (global 4-component vector of float) +0:239 'inF0' (temp 4-component vector of float) +0:240 smoothstep (global 4-component vector of float) +0:240 'inF0' (temp 4-component vector of float) +0:240 'inF1' (temp 4-component vector of float) +0:240 'inF2' (temp 4-component vector of float) +0:241 sqrt (global 4-component vector of float) +0:241 'inF0' (temp 4-component vector of float) +0:242 step (global 4-component vector of float) +0:242 'inF0' (temp 4-component vector of float) +0:242 'inF1' (temp 4-component vector of float) +0:243 tangent (global 4-component vector of float) +0:243 'inF0' (temp 4-component vector of float) +0:244 hyp. tangent (global 4-component vector of float) +0:244 'inF0' (temp 4-component vector of float) +0:246 trunc (global 4-component vector of float) +0:246 'inF0' (temp 4-component vector of float) +0:249 Branch: Return with expression +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:? 4.000000 +0:307 Function Definition: VertexShaderFunction(mf22;mf22;mf22; (temp 2X2 matrix of float) +0:299 Function Parameters: +0:299 'inF0' (temp 2X2 matrix of float) +0:299 'inF1' (temp 2X2 matrix of float) +0:299 'inF2' (temp 2X2 matrix of float) +0:? Sequence +0:301 all (global bool) +0:301 'inF0' (temp 2X2 matrix of float) +0:301 Absolute value (global 2X2 matrix of float) +0:301 'inF0' (temp 2X2 matrix of float) +0:301 arc cosine (global 2X2 matrix of float) +0:301 'inF0' (temp 2X2 matrix of float) +0:301 any (global bool) +0:301 'inF0' (temp 2X2 matrix of float) +0:301 arc sine (global 2X2 matrix of float) +0:301 'inF0' (temp 2X2 matrix of float) +0:301 arc tangent (global 2X2 matrix of float) +0:301 'inF0' (temp 2X2 matrix of float) +0:301 arc tangent (global 2X2 matrix of float) +0:301 'inF0' (temp 2X2 matrix of float) +0:301 'inF1' (temp 2X2 matrix of float) +0:301 Ceiling (global 2X2 matrix of float) +0:301 'inF0' (temp 2X2 matrix of float) +0:301 clamp (global 2X2 matrix of float) +0:301 'inF0' (temp 2X2 matrix of float) +0:301 'inF1' (temp 2X2 matrix of float) +0:301 'inF2' (temp 2X2 matrix of float) +0:301 cosine (global 2X2 matrix of float) +0:301 'inF0' (temp 2X2 matrix of float) +0:301 hyp. cosine (global 2X2 matrix of float) +0:301 'inF0' (temp 2X2 matrix of float) +0:301 degrees (global 2X2 matrix of float) +0:301 'inF0' (temp 2X2 matrix of float) +0:301 determinant (global float) +0:301 'inF0' (temp 2X2 matrix of float) +0:301 exp (global 2X2 matrix of float) +0:301 'inF0' (temp 2X2 matrix of float) +0:301 exp2 (global 2X2 matrix of float) +0:301 'inF0' (temp 2X2 matrix of float) +0:301 findMSB (global int) +0:301 Constant: +0:301 7 (const int) +0:301 findLSB (global int) +0:301 Constant: +0:301 7 (const int) +0:301 Floor (global 2X2 matrix of float) +0:301 'inF0' (temp 2X2 matrix of float) +0:301 Function Call: fmod(mf22;mf22; (global 2X2 matrix of float) +0:301 'inF0' (temp 2X2 matrix of float) +0:301 'inF1' (temp 2X2 matrix of float) +0:301 Fraction (global 2X2 matrix of float) +0:301 'inF0' (temp 2X2 matrix of float) +0:301 frexp (global 2X2 matrix of float) +0:301 'inF0' (temp 2X2 matrix of float) +0:301 'inF1' (temp 2X2 matrix of float) +0:301 fwidth (global 2X2 matrix of float) +0:301 'inF0' (temp 2X2 matrix of float) +0:301 ldexp (global 2X2 matrix of float) +0:301 'inF0' (temp 2X2 matrix of float) +0:301 'inF1' (temp 2X2 matrix of float) +0:301 log (global 2X2 matrix of float) +0:301 'inF0' (temp 2X2 matrix of float) +0:301 log2 (global 2X2 matrix of float) +0:301 'inF0' (temp 2X2 matrix of float) +0:301 max (global 2X2 matrix of float) +0:301 'inF0' (temp 2X2 matrix of float) +0:301 'inF1' (temp 2X2 matrix of float) +0:301 min (global 2X2 matrix of float) +0:301 'inF0' (temp 2X2 matrix of float) +0:301 'inF1' (temp 2X2 matrix of float) +0:301 pow (global 2X2 matrix of float) +0:301 'inF0' (temp 2X2 matrix of float) +0:301 'inF1' (temp 2X2 matrix of float) +0:301 radians (global 2X2 matrix of float) +0:301 'inF0' (temp 2X2 matrix of float) +0:301 roundEven (global 2X2 matrix of float) +0:301 'inF0' (temp 2X2 matrix of float) +0:301 inverse sqrt (global 2X2 matrix of float) +0:301 'inF0' (temp 2X2 matrix of float) +0:301 Sign (global 2X2 matrix of float) +0:301 'inF0' (temp 2X2 matrix of float) +0:301 sine (global 2X2 matrix of float) +0:301 'inF0' (temp 2X2 matrix of float) +0:301 hyp. sine (global 2X2 matrix of float) +0:301 'inF0' (temp 2X2 matrix of float) +0:301 smoothstep (global 2X2 matrix of float) +0:301 'inF0' (temp 2X2 matrix of float) +0:301 'inF1' (temp 2X2 matrix of float) +0:301 'inF2' (temp 2X2 matrix of float) +0:301 sqrt (global 2X2 matrix of float) +0:301 'inF0' (temp 2X2 matrix of float) +0:301 step (global 2X2 matrix of float) +0:301 'inF0' (temp 2X2 matrix of float) +0:301 'inF1' (temp 2X2 matrix of float) +0:301 tangent (global 2X2 matrix of float) +0:301 'inF0' (temp 2X2 matrix of float) +0:301 hyp. tangent (global 2X2 matrix of float) +0:301 'inF0' (temp 2X2 matrix of float) +0:301 transpose (global 2X2 matrix of float) +0:301 'inF0' (temp 2X2 matrix of float) +0:301 trunc (global 2X2 matrix of float) +0:301 'inF0' (temp 2X2 matrix of float) +0:304 Branch: Return with expression +0:? Constant: +0:? 2.000000 +0:? 2.000000 +0:? 2.000000 +0:? 2.000000 +0:316 Function Definition: VertexShaderFunction(mf33;mf33;mf33; (temp 3X3 matrix of float) +0:308 Function Parameters: +0:308 'inF0' (temp 3X3 matrix of float) +0:308 'inF1' (temp 3X3 matrix of float) +0:308 'inF2' (temp 3X3 matrix of float) +0:? Sequence +0:310 all (global bool) +0:310 'inF0' (temp 3X3 matrix of float) +0:310 Absolute value (global 3X3 matrix of float) +0:310 'inF0' (temp 3X3 matrix of float) +0:310 arc cosine (global 3X3 matrix of float) +0:310 'inF0' (temp 3X3 matrix of float) +0:310 any (global bool) +0:310 'inF0' (temp 3X3 matrix of float) +0:310 arc sine (global 3X3 matrix of float) +0:310 'inF0' (temp 3X3 matrix of float) +0:310 arc tangent (global 3X3 matrix of float) +0:310 'inF0' (temp 3X3 matrix of float) +0:310 arc tangent (global 3X3 matrix of float) +0:310 'inF0' (temp 3X3 matrix of float) +0:310 'inF1' (temp 3X3 matrix of float) +0:310 Ceiling (global 3X3 matrix of float) +0:310 'inF0' (temp 3X3 matrix of float) +0:310 clamp (global 3X3 matrix of float) +0:310 'inF0' (temp 3X3 matrix of float) +0:310 'inF1' (temp 3X3 matrix of float) +0:310 'inF2' (temp 3X3 matrix of float) +0:310 cosine (global 3X3 matrix of float) +0:310 'inF0' (temp 3X3 matrix of float) +0:310 hyp. cosine (global 3X3 matrix of float) +0:310 'inF0' (temp 3X3 matrix of float) +0:310 degrees (global 3X3 matrix of float) +0:310 'inF0' (temp 3X3 matrix of float) +0:310 determinant (global float) +0:310 'inF0' (temp 3X3 matrix of float) +0:310 exp (global 3X3 matrix of float) +0:310 'inF0' (temp 3X3 matrix of float) +0:310 exp2 (global 3X3 matrix of float) +0:310 'inF0' (temp 3X3 matrix of float) +0:310 findMSB (global int) +0:310 Constant: +0:310 7 (const int) +0:310 findLSB (global int) +0:310 Constant: +0:310 7 (const int) +0:310 Floor (global 3X3 matrix of float) +0:310 'inF0' (temp 3X3 matrix of float) +0:310 Function Call: fmod(mf33;mf33; (global 3X3 matrix of float) +0:310 'inF0' (temp 3X3 matrix of float) +0:310 'inF1' (temp 3X3 matrix of float) +0:310 Fraction (global 3X3 matrix of float) +0:310 'inF0' (temp 3X3 matrix of float) +0:310 frexp (global 3X3 matrix of float) +0:310 'inF0' (temp 3X3 matrix of float) +0:310 'inF1' (temp 3X3 matrix of float) +0:310 fwidth (global 3X3 matrix of float) +0:310 'inF0' (temp 3X3 matrix of float) +0:310 ldexp (global 3X3 matrix of float) +0:310 'inF0' (temp 3X3 matrix of float) +0:310 'inF1' (temp 3X3 matrix of float) +0:310 log (global 3X3 matrix of float) +0:310 'inF0' (temp 3X3 matrix of float) +0:310 log2 (global 3X3 matrix of float) +0:310 'inF0' (temp 3X3 matrix of float) +0:310 max (global 3X3 matrix of float) +0:310 'inF0' (temp 3X3 matrix of float) +0:310 'inF1' (temp 3X3 matrix of float) +0:310 min (global 3X3 matrix of float) +0:310 'inF0' (temp 3X3 matrix of float) +0:310 'inF1' (temp 3X3 matrix of float) +0:310 pow (global 3X3 matrix of float) +0:310 'inF0' (temp 3X3 matrix of float) +0:310 'inF1' (temp 3X3 matrix of float) +0:310 radians (global 3X3 matrix of float) +0:310 'inF0' (temp 3X3 matrix of float) +0:310 roundEven (global 3X3 matrix of float) +0:310 'inF0' (temp 3X3 matrix of float) +0:310 inverse sqrt (global 3X3 matrix of float) +0:310 'inF0' (temp 3X3 matrix of float) +0:310 Sign (global 3X3 matrix of float) +0:310 'inF0' (temp 3X3 matrix of float) +0:310 sine (global 3X3 matrix of float) +0:310 'inF0' (temp 3X3 matrix of float) +0:310 hyp. sine (global 3X3 matrix of float) +0:310 'inF0' (temp 3X3 matrix of float) +0:310 smoothstep (global 3X3 matrix of float) +0:310 'inF0' (temp 3X3 matrix of float) +0:310 'inF1' (temp 3X3 matrix of float) +0:310 'inF2' (temp 3X3 matrix of float) +0:310 sqrt (global 3X3 matrix of float) +0:310 'inF0' (temp 3X3 matrix of float) +0:310 step (global 3X3 matrix of float) +0:310 'inF0' (temp 3X3 matrix of float) +0:310 'inF1' (temp 3X3 matrix of float) +0:310 tangent (global 3X3 matrix of float) +0:310 'inF0' (temp 3X3 matrix of float) +0:310 hyp. tangent (global 3X3 matrix of float) +0:310 'inF0' (temp 3X3 matrix of float) +0:310 transpose (global 3X3 matrix of float) +0:310 'inF0' (temp 3X3 matrix of float) +0:310 trunc (global 3X3 matrix of float) +0:310 'inF0' (temp 3X3 matrix of float) +0:313 Branch: Return with expression +0:? Constant: +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:324 Function Definition: VertexShaderFunction(mf44;mf44;mf44; (temp 4X4 matrix of float) +0:317 Function Parameters: +0:317 'inF0' (temp 4X4 matrix of float) +0:317 'inF1' (temp 4X4 matrix of float) +0:317 'inF2' (temp 4X4 matrix of float) +0:? Sequence +0:319 all (global bool) +0:319 'inF0' (temp 4X4 matrix of float) +0:319 Absolute value (global 4X4 matrix of float) +0:319 'inF0' (temp 4X4 matrix of float) +0:319 arc cosine (global 4X4 matrix of float) +0:319 'inF0' (temp 4X4 matrix of float) +0:319 any (global bool) +0:319 'inF0' (temp 4X4 matrix of float) +0:319 arc sine (global 4X4 matrix of float) +0:319 'inF0' (temp 4X4 matrix of float) +0:319 arc tangent (global 4X4 matrix of float) +0:319 'inF0' (temp 4X4 matrix of float) +0:319 arc tangent (global 4X4 matrix of float) +0:319 'inF0' (temp 4X4 matrix of float) +0:319 'inF1' (temp 4X4 matrix of float) +0:319 Ceiling (global 4X4 matrix of float) +0:319 'inF0' (temp 4X4 matrix of float) +0:319 clamp (global 4X4 matrix of float) +0:319 'inF0' (temp 4X4 matrix of float) +0:319 'inF1' (temp 4X4 matrix of float) +0:319 'inF2' (temp 4X4 matrix of float) +0:319 cosine (global 4X4 matrix of float) +0:319 'inF0' (temp 4X4 matrix of float) +0:319 hyp. cosine (global 4X4 matrix of float) +0:319 'inF0' (temp 4X4 matrix of float) +0:319 degrees (global 4X4 matrix of float) +0:319 'inF0' (temp 4X4 matrix of float) +0:319 determinant (global float) +0:319 'inF0' (temp 4X4 matrix of float) +0:319 exp (global 4X4 matrix of float) +0:319 'inF0' (temp 4X4 matrix of float) +0:319 exp2 (global 4X4 matrix of float) +0:319 'inF0' (temp 4X4 matrix of float) +0:319 findMSB (global int) +0:319 Constant: +0:319 7 (const int) +0:319 findLSB (global int) +0:319 Constant: +0:319 7 (const int) +0:319 Floor (global 4X4 matrix of float) +0:319 'inF0' (temp 4X4 matrix of float) +0:319 Function Call: fmod(mf44;mf44; (global 4X4 matrix of float) +0:319 'inF0' (temp 4X4 matrix of float) +0:319 'inF1' (temp 4X4 matrix of float) +0:319 Fraction (global 4X4 matrix of float) +0:319 'inF0' (temp 4X4 matrix of float) +0:319 frexp (global 4X4 matrix of float) +0:319 'inF0' (temp 4X4 matrix of float) +0:319 'inF1' (temp 4X4 matrix of float) +0:319 fwidth (global 4X4 matrix of float) +0:319 'inF0' (temp 4X4 matrix of float) +0:319 ldexp (global 4X4 matrix of float) +0:319 'inF0' (temp 4X4 matrix of float) +0:319 'inF1' (temp 4X4 matrix of float) +0:319 log (global 4X4 matrix of float) +0:319 'inF0' (temp 4X4 matrix of float) +0:319 log2 (global 4X4 matrix of float) +0:319 'inF0' (temp 4X4 matrix of float) +0:319 max (global 4X4 matrix of float) +0:319 'inF0' (temp 4X4 matrix of float) +0:319 'inF1' (temp 4X4 matrix of float) +0:319 min (global 4X4 matrix of float) +0:319 'inF0' (temp 4X4 matrix of float) +0:319 'inF1' (temp 4X4 matrix of float) +0:319 pow (global 4X4 matrix of float) +0:319 'inF0' (temp 4X4 matrix of float) +0:319 'inF1' (temp 4X4 matrix of float) +0:319 radians (global 4X4 matrix of float) +0:319 'inF0' (temp 4X4 matrix of float) +0:319 roundEven (global 4X4 matrix of float) +0:319 'inF0' (temp 4X4 matrix of float) +0:319 inverse sqrt (global 4X4 matrix of float) +0:319 'inF0' (temp 4X4 matrix of float) +0:319 Sign (global 4X4 matrix of float) +0:319 'inF0' (temp 4X4 matrix of float) +0:319 sine (global 4X4 matrix of float) +0:319 'inF0' (temp 4X4 matrix of float) +0:319 hyp. sine (global 4X4 matrix of float) +0:319 'inF0' (temp 4X4 matrix of float) +0:319 smoothstep (global 4X4 matrix of float) +0:319 'inF0' (temp 4X4 matrix of float) +0:319 'inF1' (temp 4X4 matrix of float) +0:319 'inF2' (temp 4X4 matrix of float) +0:319 sqrt (global 4X4 matrix of float) +0:319 'inF0' (temp 4X4 matrix of float) +0:319 step (global 4X4 matrix of float) +0:319 'inF0' (temp 4X4 matrix of float) +0:319 'inF1' (temp 4X4 matrix of float) +0:319 tangent (global 4X4 matrix of float) +0:319 'inF0' (temp 4X4 matrix of float) +0:319 hyp. tangent (global 4X4 matrix of float) +0:319 'inF0' (temp 4X4 matrix of float) +0:319 transpose (global 4X4 matrix of float) +0:319 'inF0' (temp 4X4 matrix of float) +0:319 trunc (global 4X4 matrix of float) +0:319 'inF0' (temp 4X4 matrix of float) +0:322 Branch: Return with expression +0:? Constant: +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? Linker Objects + + +Linked vertex stage: + + +Shader version: 450 +0:? Sequence +0:56 Function Definition: VertexShaderFunction(f1;f1;f1; (temp float) +0:2 Function Parameters: +0:2 'inF0' (temp float) +0:2 'inF1' (temp float) +0:2 'inF2' (temp float) +0:? Sequence +0:3 all (global bool) +0:3 'inF0' (temp float) +0:4 Absolute value (global float) +0:4 'inF0' (temp float) +0:5 arc cosine (global float) +0:5 'inF0' (temp float) +0:6 any (global bool) +0:6 'inF0' (temp float) +0:7 arc sine (global float) +0:7 'inF0' (temp float) +0:8 arc tangent (global float) +0:8 'inF0' (temp float) +0:9 arc tangent (global float) +0:9 'inF0' (temp float) +0:9 'inF1' (temp float) +0:10 Ceiling (global float) +0:10 'inF0' (temp float) +0:11 clamp (global float) +0:11 'inF0' (temp float) +0:11 'inF1' (temp float) +0:11 'inF2' (temp float) +0:12 cosine (global float) +0:12 'inF0' (temp float) +0:13 hyp. cosine (global float) +0:13 'inF0' (temp float) +0:14 bitCount (global uint) +0:14 Constant: +0:14 7 (const uint) +0:15 degrees (global float) +0:15 'inF0' (temp float) +0:19 exp (global float) +0:19 'inF0' (temp float) +0:20 exp2 (global float) +0:20 'inF0' (temp float) +0:21 findMSB (global int) +0:21 Constant: +0:21 7 (const int) +0:22 findLSB (global int) +0:22 Constant: +0:22 7 (const int) +0:23 Floor (global float) +0:23 'inF0' (temp float) +0:25 Function Call: fmod(f1;f1; (global float) +0:25 'inF0' (temp float) +0:25 'inF1' (temp float) +0:26 Fraction (global float) +0:26 'inF0' (temp float) +0:27 frexp (global float) +0:27 'inF0' (temp float) +0:27 'inF1' (temp float) +0:28 fwidth (global float) +0:28 'inF0' (temp float) +0:29 isinf (global bool) +0:29 'inF0' (temp float) +0:30 isnan (global bool) +0:30 'inF0' (temp float) +0:31 ldexp (global float) +0:31 'inF0' (temp float) +0:31 'inF1' (temp float) +0:32 log (global float) +0:32 'inF0' (temp float) +0:33 log2 (global float) +0:33 'inF0' (temp float) +0:34 max (global float) +0:34 'inF0' (temp float) +0:34 'inF1' (temp float) +0:35 min (global float) +0:35 'inF0' (temp float) +0:35 'inF1' (temp float) +0:37 pow (global float) +0:37 'inF0' (temp float) +0:37 'inF1' (temp float) +0:38 radians (global float) +0:38 'inF0' (temp float) +0:39 bitFieldReverse (global uint) +0:39 Constant: +0:39 2 (const uint) +0:40 roundEven (global float) +0:40 'inF0' (temp float) +0:41 inverse sqrt (global float) +0:41 'inF0' (temp float) +0:42 Sign (global float) +0:42 'inF0' (temp float) +0:43 sine (global float) +0:43 'inF0' (temp float) +0:44 hyp. sine (global float) +0:44 'inF0' (temp float) +0:45 smoothstep (global float) +0:45 'inF0' (temp float) +0:45 'inF1' (temp float) +0:45 'inF2' (temp float) +0:46 sqrt (global float) +0:46 'inF0' (temp float) +0:47 step (global float) +0:47 'inF0' (temp float) +0:47 'inF1' (temp float) +0:48 tangent (global float) +0:48 'inF0' (temp float) +0:49 hyp. tangent (global float) +0:49 'inF0' (temp float) +0:51 trunc (global float) +0:51 'inF0' (temp float) +0:53 Branch: Return with expression +0:53 Constant: +0:53 0.000000 +0:62 Function Definition: VertexShaderFunction(vf1;vf1;vf1; (temp 1-component vector of float) +0:57 Function Parameters: +0:57 'inF0' (temp 1-component vector of float) +0:57 'inF1' (temp 1-component vector of float) +0:57 'inF2' (temp 1-component vector of float) +0:? Sequence +0:59 Branch: Return with expression +0:59 Constant: +0:59 0.000000 +0:125 Function Definition: VertexShaderFunction(vf2;vf2;vf2; (temp 2-component vector of float) +0:63 Function Parameters: +0:63 'inF0' (temp 2-component vector of float) +0:63 'inF1' (temp 2-component vector of float) +0:63 'inF2' (temp 2-component vector of float) +0:? Sequence +0:64 all (global bool) +0:64 'inF0' (temp 2-component vector of float) +0:65 Absolute value (global 2-component vector of float) +0:65 'inF0' (temp 2-component vector of float) +0:66 arc cosine (global 2-component vector of float) +0:66 'inF0' (temp 2-component vector of float) +0:67 any (global bool) +0:67 'inF0' (temp 2-component vector of float) +0:68 arc sine (global 2-component vector of float) +0:68 'inF0' (temp 2-component vector of float) +0:69 arc tangent (global 2-component vector of float) +0:69 'inF0' (temp 2-component vector of float) +0:70 arc tangent (global 2-component vector of float) +0:70 'inF0' (temp 2-component vector of float) +0:70 'inF1' (temp 2-component vector of float) +0:71 Ceiling (global 2-component vector of float) +0:71 'inF0' (temp 2-component vector of float) +0:72 clamp (global 2-component vector of float) +0:72 'inF0' (temp 2-component vector of float) +0:72 'inF1' (temp 2-component vector of float) +0:72 'inF2' (temp 2-component vector of float) +0:73 cosine (global 2-component vector of float) +0:73 'inF0' (temp 2-component vector of float) +0:74 hyp. cosine (global 2-component vector of float) +0:74 'inF0' (temp 2-component vector of float) +0:? bitCount (global 2-component vector of uint) +0:? Constant: +0:? 7 (const uint) +0:? 3 (const uint) +0:76 degrees (global 2-component vector of float) +0:76 'inF0' (temp 2-component vector of float) +0:77 distance (global float) +0:77 'inF0' (temp 2-component vector of float) +0:77 'inF1' (temp 2-component vector of float) +0:78 dot-product (global float) +0:78 'inF0' (temp 2-component vector of float) +0:78 'inF1' (temp 2-component vector of float) +0:82 exp (global 2-component vector of float) +0:82 'inF0' (temp 2-component vector of float) +0:83 exp2 (global 2-component vector of float) +0:83 'inF0' (temp 2-component vector of float) +0:84 face-forward (global 2-component vector of float) +0:84 'inF0' (temp 2-component vector of float) +0:84 'inF1' (temp 2-component vector of float) +0:84 'inF2' (temp 2-component vector of float) +0:85 findMSB (global int) +0:85 Constant: +0:85 7 (const int) +0:86 findLSB (global int) +0:86 Constant: +0:86 7 (const int) +0:87 Floor (global 2-component vector of float) +0:87 'inF0' (temp 2-component vector of float) +0:89 Function Call: fmod(vf2;vf2; (global 2-component vector of float) +0:89 'inF0' (temp 2-component vector of float) +0:89 'inF1' (temp 2-component vector of float) +0:90 Fraction (global 2-component vector of float) +0:90 'inF0' (temp 2-component vector of float) +0:91 frexp (global 2-component vector of float) +0:91 'inF0' (temp 2-component vector of float) +0:91 'inF1' (temp 2-component vector of float) +0:92 fwidth (global 2-component vector of float) +0:92 'inF0' (temp 2-component vector of float) +0:93 isinf (global 2-component vector of bool) +0:93 'inF0' (temp 2-component vector of float) +0:94 isnan (global 2-component vector of bool) +0:94 'inF0' (temp 2-component vector of float) +0:95 ldexp (global 2-component vector of float) +0:95 'inF0' (temp 2-component vector of float) +0:95 'inF1' (temp 2-component vector of float) +0:96 length (global float) +0:96 'inF0' (temp 2-component vector of float) +0:97 log (global 2-component vector of float) +0:97 'inF0' (temp 2-component vector of float) +0:98 log2 (global 2-component vector of float) +0:98 'inF0' (temp 2-component vector of float) +0:99 max (global 2-component vector of float) +0:99 'inF0' (temp 2-component vector of float) +0:99 'inF1' (temp 2-component vector of float) +0:100 min (global 2-component vector of float) +0:100 'inF0' (temp 2-component vector of float) +0:100 'inF1' (temp 2-component vector of float) +0:102 normalize (global 2-component vector of float) +0:102 'inF0' (temp 2-component vector of float) +0:103 pow (global 2-component vector of float) +0:103 'inF0' (temp 2-component vector of float) +0:103 'inF1' (temp 2-component vector of float) +0:104 radians (global 2-component vector of float) +0:104 'inF0' (temp 2-component vector of float) +0:105 reflect (global 2-component vector of float) +0:105 'inF0' (temp 2-component vector of float) +0:105 'inF1' (temp 2-component vector of float) +0:106 refract (global 2-component vector of float) +0:106 'inF0' (temp 2-component vector of float) +0:106 'inF1' (temp 2-component vector of float) +0:106 Constant: +0:106 2.000000 +0:? bitFieldReverse (global 2-component vector of uint) +0:? Constant: +0:? 1 (const uint) +0:? 2 (const uint) +0:108 roundEven (global 2-component vector of float) +0:108 'inF0' (temp 2-component vector of float) +0:109 inverse sqrt (global 2-component vector of float) +0:109 'inF0' (temp 2-component vector of float) +0:110 Sign (global 2-component vector of float) +0:110 'inF0' (temp 2-component vector of float) +0:111 sine (global 2-component vector of float) +0:111 'inF0' (temp 2-component vector of float) +0:112 hyp. sine (global 2-component vector of float) +0:112 'inF0' (temp 2-component vector of float) +0:113 smoothstep (global 2-component vector of float) +0:113 'inF0' (temp 2-component vector of float) +0:113 'inF1' (temp 2-component vector of float) +0:113 'inF2' (temp 2-component vector of float) +0:114 sqrt (global 2-component vector of float) +0:114 'inF0' (temp 2-component vector of float) +0:115 step (global 2-component vector of float) +0:115 'inF0' (temp 2-component vector of float) +0:115 'inF1' (temp 2-component vector of float) +0:116 tangent (global 2-component vector of float) +0:116 'inF0' (temp 2-component vector of float) +0:117 hyp. tangent (global 2-component vector of float) +0:117 'inF0' (temp 2-component vector of float) +0:119 trunc (global 2-component vector of float) +0:119 'inF0' (temp 2-component vector of float) +0:122 Branch: Return with expression +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:189 Function Definition: VertexShaderFunction(vf3;vf3;vf3; (temp 3-component vector of float) +0:126 Function Parameters: +0:126 'inF0' (temp 3-component vector of float) +0:126 'inF1' (temp 3-component vector of float) +0:126 'inF2' (temp 3-component vector of float) +0:? Sequence +0:127 all (global bool) +0:127 'inF0' (temp 3-component vector of float) +0:128 Absolute value (global 3-component vector of float) +0:128 'inF0' (temp 3-component vector of float) +0:129 arc cosine (global 3-component vector of float) +0:129 'inF0' (temp 3-component vector of float) +0:130 any (global bool) +0:130 'inF0' (temp 3-component vector of float) +0:131 arc sine (global 3-component vector of float) +0:131 'inF0' (temp 3-component vector of float) +0:132 arc tangent (global 3-component vector of float) +0:132 'inF0' (temp 3-component vector of float) +0:133 arc tangent (global 3-component vector of float) +0:133 'inF0' (temp 3-component vector of float) +0:133 'inF1' (temp 3-component vector of float) +0:134 Ceiling (global 3-component vector of float) +0:134 'inF0' (temp 3-component vector of float) +0:135 clamp (global 3-component vector of float) +0:135 'inF0' (temp 3-component vector of float) +0:135 'inF1' (temp 3-component vector of float) +0:135 'inF2' (temp 3-component vector of float) +0:136 cosine (global 3-component vector of float) +0:136 'inF0' (temp 3-component vector of float) +0:137 hyp. cosine (global 3-component vector of float) +0:137 'inF0' (temp 3-component vector of float) +0:? bitCount (global 3-component vector of uint) +0:? Constant: +0:? 7 (const uint) +0:? 3 (const uint) +0:? 5 (const uint) +0:139 cross-product (global 3-component vector of float) +0:139 'inF0' (temp 3-component vector of float) +0:139 'inF1' (temp 3-component vector of float) +0:140 degrees (global 3-component vector of float) +0:140 'inF0' (temp 3-component vector of float) +0:141 distance (global float) +0:141 'inF0' (temp 3-component vector of float) +0:141 'inF1' (temp 3-component vector of float) +0:142 dot-product (global float) +0:142 'inF0' (temp 3-component vector of float) +0:142 'inF1' (temp 3-component vector of float) +0:146 exp (global 3-component vector of float) +0:146 'inF0' (temp 3-component vector of float) +0:147 exp2 (global 3-component vector of float) +0:147 'inF0' (temp 3-component vector of float) +0:148 face-forward (global 3-component vector of float) +0:148 'inF0' (temp 3-component vector of float) +0:148 'inF1' (temp 3-component vector of float) +0:148 'inF2' (temp 3-component vector of float) +0:149 findMSB (global int) +0:149 Constant: +0:149 7 (const int) +0:150 findLSB (global int) +0:150 Constant: +0:150 7 (const int) +0:151 Floor (global 3-component vector of float) +0:151 'inF0' (temp 3-component vector of float) +0:153 Function Call: fmod(vf3;vf3; (global 3-component vector of float) +0:153 'inF0' (temp 3-component vector of float) +0:153 'inF1' (temp 3-component vector of float) +0:154 Fraction (global 3-component vector of float) +0:154 'inF0' (temp 3-component vector of float) +0:155 frexp (global 3-component vector of float) +0:155 'inF0' (temp 3-component vector of float) +0:155 'inF1' (temp 3-component vector of float) +0:156 fwidth (global 3-component vector of float) +0:156 'inF0' (temp 3-component vector of float) +0:157 isinf (global 3-component vector of bool) +0:157 'inF0' (temp 3-component vector of float) +0:158 isnan (global 3-component vector of bool) +0:158 'inF0' (temp 3-component vector of float) +0:159 ldexp (global 3-component vector of float) +0:159 'inF0' (temp 3-component vector of float) +0:159 'inF1' (temp 3-component vector of float) +0:160 length (global float) +0:160 'inF0' (temp 3-component vector of float) +0:161 log (global 3-component vector of float) +0:161 'inF0' (temp 3-component vector of float) +0:162 log2 (global 3-component vector of float) +0:162 'inF0' (temp 3-component vector of float) +0:163 max (global 3-component vector of float) +0:163 'inF0' (temp 3-component vector of float) +0:163 'inF1' (temp 3-component vector of float) +0:164 min (global 3-component vector of float) +0:164 'inF0' (temp 3-component vector of float) +0:164 'inF1' (temp 3-component vector of float) +0:166 normalize (global 3-component vector of float) +0:166 'inF0' (temp 3-component vector of float) +0:167 pow (global 3-component vector of float) +0:167 'inF0' (temp 3-component vector of float) +0:167 'inF1' (temp 3-component vector of float) +0:168 radians (global 3-component vector of float) +0:168 'inF0' (temp 3-component vector of float) +0:169 reflect (global 3-component vector of float) +0:169 'inF0' (temp 3-component vector of float) +0:169 'inF1' (temp 3-component vector of float) +0:170 refract (global 3-component vector of float) +0:170 'inF0' (temp 3-component vector of float) +0:170 'inF1' (temp 3-component vector of float) +0:170 Constant: +0:170 2.000000 +0:? bitFieldReverse (global 3-component vector of uint) +0:? Constant: +0:? 1 (const uint) +0:? 2 (const uint) +0:? 3 (const uint) +0:172 roundEven (global 3-component vector of float) +0:172 'inF0' (temp 3-component vector of float) +0:173 inverse sqrt (global 3-component vector of float) +0:173 'inF0' (temp 3-component vector of float) +0:174 Sign (global 3-component vector of float) +0:174 'inF0' (temp 3-component vector of float) +0:175 sine (global 3-component vector of float) +0:175 'inF0' (temp 3-component vector of float) +0:176 hyp. sine (global 3-component vector of float) +0:176 'inF0' (temp 3-component vector of float) +0:177 smoothstep (global 3-component vector of float) +0:177 'inF0' (temp 3-component vector of float) +0:177 'inF1' (temp 3-component vector of float) +0:177 'inF2' (temp 3-component vector of float) +0:178 sqrt (global 3-component vector of float) +0:178 'inF0' (temp 3-component vector of float) +0:179 step (global 3-component vector of float) +0:179 'inF0' (temp 3-component vector of float) +0:179 'inF1' (temp 3-component vector of float) +0:180 tangent (global 3-component vector of float) +0:180 'inF0' (temp 3-component vector of float) +0:181 hyp. tangent (global 3-component vector of float) +0:181 'inF0' (temp 3-component vector of float) +0:183 trunc (global 3-component vector of float) +0:183 'inF0' (temp 3-component vector of float) +0:186 Branch: Return with expression +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:298 Function Definition: VertexShaderFunction(vf4;vf4;vf4; (temp 4-component vector of float) +0:190 Function Parameters: +0:190 'inF0' (temp 4-component vector of float) +0:190 'inF1' (temp 4-component vector of float) +0:190 'inF2' (temp 4-component vector of float) +0:? Sequence +0:191 all (global bool) +0:191 'inF0' (temp 4-component vector of float) +0:192 Absolute value (global 4-component vector of float) +0:192 'inF0' (temp 4-component vector of float) +0:193 arc cosine (global 4-component vector of float) +0:193 'inF0' (temp 4-component vector of float) +0:194 any (global bool) +0:194 'inF0' (temp 4-component vector of float) +0:195 arc sine (global 4-component vector of float) +0:195 'inF0' (temp 4-component vector of float) +0:196 arc tangent (global 4-component vector of float) +0:196 'inF0' (temp 4-component vector of float) +0:197 arc tangent (global 4-component vector of float) +0:197 'inF0' (temp 4-component vector of float) +0:197 'inF1' (temp 4-component vector of float) +0:198 Ceiling (global 4-component vector of float) +0:198 'inF0' (temp 4-component vector of float) +0:199 clamp (global 4-component vector of float) +0:199 'inF0' (temp 4-component vector of float) +0:199 'inF1' (temp 4-component vector of float) +0:199 'inF2' (temp 4-component vector of float) +0:200 cosine (global 4-component vector of float) +0:200 'inF0' (temp 4-component vector of float) +0:201 hyp. cosine (global 4-component vector of float) +0:201 'inF0' (temp 4-component vector of float) +0:? bitCount (global 4-component vector of uint) +0:? Constant: +0:? 7 (const uint) +0:? 3 (const uint) +0:? 5 (const uint) +0:? 2 (const uint) +0:203 degrees (global 4-component vector of float) +0:203 'inF0' (temp 4-component vector of float) +0:204 distance (global float) +0:204 'inF0' (temp 4-component vector of float) +0:204 'inF1' (temp 4-component vector of float) +0:205 dot-product (global float) +0:205 'inF0' (temp 4-component vector of float) +0:205 'inF1' (temp 4-component vector of float) +0:209 exp (global 4-component vector of float) +0:209 'inF0' (temp 4-component vector of float) +0:210 exp2 (global 4-component vector of float) +0:210 'inF0' (temp 4-component vector of float) +0:211 face-forward (global 4-component vector of float) +0:211 'inF0' (temp 4-component vector of float) +0:211 'inF1' (temp 4-component vector of float) +0:211 'inF2' (temp 4-component vector of float) +0:212 findMSB (global int) +0:212 Constant: +0:212 7 (const int) +0:213 findLSB (global int) +0:213 Constant: +0:213 7 (const int) +0:214 Floor (global 4-component vector of float) +0:214 'inF0' (temp 4-component vector of float) +0:216 Function Call: fmod(vf4;vf4; (global 4-component vector of float) +0:216 'inF0' (temp 4-component vector of float) +0:216 'inF1' (temp 4-component vector of float) +0:217 Fraction (global 4-component vector of float) +0:217 'inF0' (temp 4-component vector of float) +0:218 frexp (global 4-component vector of float) +0:218 'inF0' (temp 4-component vector of float) +0:218 'inF1' (temp 4-component vector of float) +0:219 fwidth (global 4-component vector of float) +0:219 'inF0' (temp 4-component vector of float) +0:220 isinf (global 4-component vector of bool) +0:220 'inF0' (temp 4-component vector of float) +0:221 isnan (global 4-component vector of bool) +0:221 'inF0' (temp 4-component vector of float) +0:222 ldexp (global 4-component vector of float) +0:222 'inF0' (temp 4-component vector of float) +0:222 'inF1' (temp 4-component vector of float) +0:223 length (global float) +0:223 'inF0' (temp 4-component vector of float) +0:224 log (global 4-component vector of float) +0:224 'inF0' (temp 4-component vector of float) +0:225 log2 (global 4-component vector of float) +0:225 'inF0' (temp 4-component vector of float) +0:226 max (global 4-component vector of float) +0:226 'inF0' (temp 4-component vector of float) +0:226 'inF1' (temp 4-component vector of float) +0:227 min (global 4-component vector of float) +0:227 'inF0' (temp 4-component vector of float) +0:227 'inF1' (temp 4-component vector of float) +0:229 normalize (global 4-component vector of float) +0:229 'inF0' (temp 4-component vector of float) +0:230 pow (global 4-component vector of float) +0:230 'inF0' (temp 4-component vector of float) +0:230 'inF1' (temp 4-component vector of float) +0:231 radians (global 4-component vector of float) +0:231 'inF0' (temp 4-component vector of float) +0:232 reflect (global 4-component vector of float) +0:232 'inF0' (temp 4-component vector of float) +0:232 'inF1' (temp 4-component vector of float) +0:233 refract (global 4-component vector of float) +0:233 'inF0' (temp 4-component vector of float) +0:233 'inF1' (temp 4-component vector of float) +0:233 Constant: +0:233 2.000000 +0:? bitFieldReverse (global 4-component vector of uint) +0:? Constant: +0:? 1 (const uint) +0:? 2 (const uint) +0:? 3 (const uint) +0:? 4 (const uint) +0:235 roundEven (global 4-component vector of float) +0:235 'inF0' (temp 4-component vector of float) +0:236 inverse sqrt (global 4-component vector of float) +0:236 'inF0' (temp 4-component vector of float) +0:237 Sign (global 4-component vector of float) +0:237 'inF0' (temp 4-component vector of float) +0:238 sine (global 4-component vector of float) +0:238 'inF0' (temp 4-component vector of float) +0:239 hyp. sine (global 4-component vector of float) +0:239 'inF0' (temp 4-component vector of float) +0:240 smoothstep (global 4-component vector of float) +0:240 'inF0' (temp 4-component vector of float) +0:240 'inF1' (temp 4-component vector of float) +0:240 'inF2' (temp 4-component vector of float) +0:241 sqrt (global 4-component vector of float) +0:241 'inF0' (temp 4-component vector of float) +0:242 step (global 4-component vector of float) +0:242 'inF0' (temp 4-component vector of float) +0:242 'inF1' (temp 4-component vector of float) +0:243 tangent (global 4-component vector of float) +0:243 'inF0' (temp 4-component vector of float) +0:244 hyp. tangent (global 4-component vector of float) +0:244 'inF0' (temp 4-component vector of float) +0:246 trunc (global 4-component vector of float) +0:246 'inF0' (temp 4-component vector of float) +0:249 Branch: Return with expression +0:? Constant: +0:? 1.000000 +0:? 2.000000 +0:? 3.000000 +0:? 4.000000 +0:307 Function Definition: VertexShaderFunction(mf22;mf22;mf22; (temp 2X2 matrix of float) +0:299 Function Parameters: +0:299 'inF0' (temp 2X2 matrix of float) +0:299 'inF1' (temp 2X2 matrix of float) +0:299 'inF2' (temp 2X2 matrix of float) +0:? Sequence +0:301 all (global bool) +0:301 'inF0' (temp 2X2 matrix of float) +0:301 Absolute value (global 2X2 matrix of float) +0:301 'inF0' (temp 2X2 matrix of float) +0:301 arc cosine (global 2X2 matrix of float) +0:301 'inF0' (temp 2X2 matrix of float) +0:301 any (global bool) +0:301 'inF0' (temp 2X2 matrix of float) +0:301 arc sine (global 2X2 matrix of float) +0:301 'inF0' (temp 2X2 matrix of float) +0:301 arc tangent (global 2X2 matrix of float) +0:301 'inF0' (temp 2X2 matrix of float) +0:301 arc tangent (global 2X2 matrix of float) +0:301 'inF0' (temp 2X2 matrix of float) +0:301 'inF1' (temp 2X2 matrix of float) +0:301 Ceiling (global 2X2 matrix of float) +0:301 'inF0' (temp 2X2 matrix of float) +0:301 clamp (global 2X2 matrix of float) +0:301 'inF0' (temp 2X2 matrix of float) +0:301 'inF1' (temp 2X2 matrix of float) +0:301 'inF2' (temp 2X2 matrix of float) +0:301 cosine (global 2X2 matrix of float) +0:301 'inF0' (temp 2X2 matrix of float) +0:301 hyp. cosine (global 2X2 matrix of float) +0:301 'inF0' (temp 2X2 matrix of float) +0:301 degrees (global 2X2 matrix of float) +0:301 'inF0' (temp 2X2 matrix of float) +0:301 determinant (global float) +0:301 'inF0' (temp 2X2 matrix of float) +0:301 exp (global 2X2 matrix of float) +0:301 'inF0' (temp 2X2 matrix of float) +0:301 exp2 (global 2X2 matrix of float) +0:301 'inF0' (temp 2X2 matrix of float) +0:301 findMSB (global int) +0:301 Constant: +0:301 7 (const int) +0:301 findLSB (global int) +0:301 Constant: +0:301 7 (const int) +0:301 Floor (global 2X2 matrix of float) +0:301 'inF0' (temp 2X2 matrix of float) +0:301 Function Call: fmod(mf22;mf22; (global 2X2 matrix of float) +0:301 'inF0' (temp 2X2 matrix of float) +0:301 'inF1' (temp 2X2 matrix of float) +0:301 Fraction (global 2X2 matrix of float) +0:301 'inF0' (temp 2X2 matrix of float) +0:301 frexp (global 2X2 matrix of float) +0:301 'inF0' (temp 2X2 matrix of float) +0:301 'inF1' (temp 2X2 matrix of float) +0:301 fwidth (global 2X2 matrix of float) +0:301 'inF0' (temp 2X2 matrix of float) +0:301 ldexp (global 2X2 matrix of float) +0:301 'inF0' (temp 2X2 matrix of float) +0:301 'inF1' (temp 2X2 matrix of float) +0:301 log (global 2X2 matrix of float) +0:301 'inF0' (temp 2X2 matrix of float) +0:301 log2 (global 2X2 matrix of float) +0:301 'inF0' (temp 2X2 matrix of float) +0:301 max (global 2X2 matrix of float) +0:301 'inF0' (temp 2X2 matrix of float) +0:301 'inF1' (temp 2X2 matrix of float) +0:301 min (global 2X2 matrix of float) +0:301 'inF0' (temp 2X2 matrix of float) +0:301 'inF1' (temp 2X2 matrix of float) +0:301 pow (global 2X2 matrix of float) +0:301 'inF0' (temp 2X2 matrix of float) +0:301 'inF1' (temp 2X2 matrix of float) +0:301 radians (global 2X2 matrix of float) +0:301 'inF0' (temp 2X2 matrix of float) +0:301 roundEven (global 2X2 matrix of float) +0:301 'inF0' (temp 2X2 matrix of float) +0:301 inverse sqrt (global 2X2 matrix of float) +0:301 'inF0' (temp 2X2 matrix of float) +0:301 Sign (global 2X2 matrix of float) +0:301 'inF0' (temp 2X2 matrix of float) +0:301 sine (global 2X2 matrix of float) +0:301 'inF0' (temp 2X2 matrix of float) +0:301 hyp. sine (global 2X2 matrix of float) +0:301 'inF0' (temp 2X2 matrix of float) +0:301 smoothstep (global 2X2 matrix of float) +0:301 'inF0' (temp 2X2 matrix of float) +0:301 'inF1' (temp 2X2 matrix of float) +0:301 'inF2' (temp 2X2 matrix of float) +0:301 sqrt (global 2X2 matrix of float) +0:301 'inF0' (temp 2X2 matrix of float) +0:301 step (global 2X2 matrix of float) +0:301 'inF0' (temp 2X2 matrix of float) +0:301 'inF1' (temp 2X2 matrix of float) +0:301 tangent (global 2X2 matrix of float) +0:301 'inF0' (temp 2X2 matrix of float) +0:301 hyp. tangent (global 2X2 matrix of float) +0:301 'inF0' (temp 2X2 matrix of float) +0:301 transpose (global 2X2 matrix of float) +0:301 'inF0' (temp 2X2 matrix of float) +0:301 trunc (global 2X2 matrix of float) +0:301 'inF0' (temp 2X2 matrix of float) +0:304 Branch: Return with expression +0:? Constant: +0:? 2.000000 +0:? 2.000000 +0:? 2.000000 +0:? 2.000000 +0:316 Function Definition: VertexShaderFunction(mf33;mf33;mf33; (temp 3X3 matrix of float) +0:308 Function Parameters: +0:308 'inF0' (temp 3X3 matrix of float) +0:308 'inF1' (temp 3X3 matrix of float) +0:308 'inF2' (temp 3X3 matrix of float) +0:? Sequence +0:310 all (global bool) +0:310 'inF0' (temp 3X3 matrix of float) +0:310 Absolute value (global 3X3 matrix of float) +0:310 'inF0' (temp 3X3 matrix of float) +0:310 arc cosine (global 3X3 matrix of float) +0:310 'inF0' (temp 3X3 matrix of float) +0:310 any (global bool) +0:310 'inF0' (temp 3X3 matrix of float) +0:310 arc sine (global 3X3 matrix of float) +0:310 'inF0' (temp 3X3 matrix of float) +0:310 arc tangent (global 3X3 matrix of float) +0:310 'inF0' (temp 3X3 matrix of float) +0:310 arc tangent (global 3X3 matrix of float) +0:310 'inF0' (temp 3X3 matrix of float) +0:310 'inF1' (temp 3X3 matrix of float) +0:310 Ceiling (global 3X3 matrix of float) +0:310 'inF0' (temp 3X3 matrix of float) +0:310 clamp (global 3X3 matrix of float) +0:310 'inF0' (temp 3X3 matrix of float) +0:310 'inF1' (temp 3X3 matrix of float) +0:310 'inF2' (temp 3X3 matrix of float) +0:310 cosine (global 3X3 matrix of float) +0:310 'inF0' (temp 3X3 matrix of float) +0:310 hyp. cosine (global 3X3 matrix of float) +0:310 'inF0' (temp 3X3 matrix of float) +0:310 degrees (global 3X3 matrix of float) +0:310 'inF0' (temp 3X3 matrix of float) +0:310 determinant (global float) +0:310 'inF0' (temp 3X3 matrix of float) +0:310 exp (global 3X3 matrix of float) +0:310 'inF0' (temp 3X3 matrix of float) +0:310 exp2 (global 3X3 matrix of float) +0:310 'inF0' (temp 3X3 matrix of float) +0:310 findMSB (global int) +0:310 Constant: +0:310 7 (const int) +0:310 findLSB (global int) +0:310 Constant: +0:310 7 (const int) +0:310 Floor (global 3X3 matrix of float) +0:310 'inF0' (temp 3X3 matrix of float) +0:310 Function Call: fmod(mf33;mf33; (global 3X3 matrix of float) +0:310 'inF0' (temp 3X3 matrix of float) +0:310 'inF1' (temp 3X3 matrix of float) +0:310 Fraction (global 3X3 matrix of float) +0:310 'inF0' (temp 3X3 matrix of float) +0:310 frexp (global 3X3 matrix of float) +0:310 'inF0' (temp 3X3 matrix of float) +0:310 'inF1' (temp 3X3 matrix of float) +0:310 fwidth (global 3X3 matrix of float) +0:310 'inF0' (temp 3X3 matrix of float) +0:310 ldexp (global 3X3 matrix of float) +0:310 'inF0' (temp 3X3 matrix of float) +0:310 'inF1' (temp 3X3 matrix of float) +0:310 log (global 3X3 matrix of float) +0:310 'inF0' (temp 3X3 matrix of float) +0:310 log2 (global 3X3 matrix of float) +0:310 'inF0' (temp 3X3 matrix of float) +0:310 max (global 3X3 matrix of float) +0:310 'inF0' (temp 3X3 matrix of float) +0:310 'inF1' (temp 3X3 matrix of float) +0:310 min (global 3X3 matrix of float) +0:310 'inF0' (temp 3X3 matrix of float) +0:310 'inF1' (temp 3X3 matrix of float) +0:310 pow (global 3X3 matrix of float) +0:310 'inF0' (temp 3X3 matrix of float) +0:310 'inF1' (temp 3X3 matrix of float) +0:310 radians (global 3X3 matrix of float) +0:310 'inF0' (temp 3X3 matrix of float) +0:310 roundEven (global 3X3 matrix of float) +0:310 'inF0' (temp 3X3 matrix of float) +0:310 inverse sqrt (global 3X3 matrix of float) +0:310 'inF0' (temp 3X3 matrix of float) +0:310 Sign (global 3X3 matrix of float) +0:310 'inF0' (temp 3X3 matrix of float) +0:310 sine (global 3X3 matrix of float) +0:310 'inF0' (temp 3X3 matrix of float) +0:310 hyp. sine (global 3X3 matrix of float) +0:310 'inF0' (temp 3X3 matrix of float) +0:310 smoothstep (global 3X3 matrix of float) +0:310 'inF0' (temp 3X3 matrix of float) +0:310 'inF1' (temp 3X3 matrix of float) +0:310 'inF2' (temp 3X3 matrix of float) +0:310 sqrt (global 3X3 matrix of float) +0:310 'inF0' (temp 3X3 matrix of float) +0:310 step (global 3X3 matrix of float) +0:310 'inF0' (temp 3X3 matrix of float) +0:310 'inF1' (temp 3X3 matrix of float) +0:310 tangent (global 3X3 matrix of float) +0:310 'inF0' (temp 3X3 matrix of float) +0:310 hyp. tangent (global 3X3 matrix of float) +0:310 'inF0' (temp 3X3 matrix of float) +0:310 transpose (global 3X3 matrix of float) +0:310 'inF0' (temp 3X3 matrix of float) +0:310 trunc (global 3X3 matrix of float) +0:310 'inF0' (temp 3X3 matrix of float) +0:313 Branch: Return with expression +0:? Constant: +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:? 3.000000 +0:324 Function Definition: VertexShaderFunction(mf44;mf44;mf44; (temp 4X4 matrix of float) +0:317 Function Parameters: +0:317 'inF0' (temp 4X4 matrix of float) +0:317 'inF1' (temp 4X4 matrix of float) +0:317 'inF2' (temp 4X4 matrix of float) +0:? Sequence +0:319 all (global bool) +0:319 'inF0' (temp 4X4 matrix of float) +0:319 Absolute value (global 4X4 matrix of float) +0:319 'inF0' (temp 4X4 matrix of float) +0:319 arc cosine (global 4X4 matrix of float) +0:319 'inF0' (temp 4X4 matrix of float) +0:319 any (global bool) +0:319 'inF0' (temp 4X4 matrix of float) +0:319 arc sine (global 4X4 matrix of float) +0:319 'inF0' (temp 4X4 matrix of float) +0:319 arc tangent (global 4X4 matrix of float) +0:319 'inF0' (temp 4X4 matrix of float) +0:319 arc tangent (global 4X4 matrix of float) +0:319 'inF0' (temp 4X4 matrix of float) +0:319 'inF1' (temp 4X4 matrix of float) +0:319 Ceiling (global 4X4 matrix of float) +0:319 'inF0' (temp 4X4 matrix of float) +0:319 clamp (global 4X4 matrix of float) +0:319 'inF0' (temp 4X4 matrix of float) +0:319 'inF1' (temp 4X4 matrix of float) +0:319 'inF2' (temp 4X4 matrix of float) +0:319 cosine (global 4X4 matrix of float) +0:319 'inF0' (temp 4X4 matrix of float) +0:319 hyp. cosine (global 4X4 matrix of float) +0:319 'inF0' (temp 4X4 matrix of float) +0:319 degrees (global 4X4 matrix of float) +0:319 'inF0' (temp 4X4 matrix of float) +0:319 determinant (global float) +0:319 'inF0' (temp 4X4 matrix of float) +0:319 exp (global 4X4 matrix of float) +0:319 'inF0' (temp 4X4 matrix of float) +0:319 exp2 (global 4X4 matrix of float) +0:319 'inF0' (temp 4X4 matrix of float) +0:319 findMSB (global int) +0:319 Constant: +0:319 7 (const int) +0:319 findLSB (global int) +0:319 Constant: +0:319 7 (const int) +0:319 Floor (global 4X4 matrix of float) +0:319 'inF0' (temp 4X4 matrix of float) +0:319 Function Call: fmod(mf44;mf44; (global 4X4 matrix of float) +0:319 'inF0' (temp 4X4 matrix of float) +0:319 'inF1' (temp 4X4 matrix of float) +0:319 Fraction (global 4X4 matrix of float) +0:319 'inF0' (temp 4X4 matrix of float) +0:319 frexp (global 4X4 matrix of float) +0:319 'inF0' (temp 4X4 matrix of float) +0:319 'inF1' (temp 4X4 matrix of float) +0:319 fwidth (global 4X4 matrix of float) +0:319 'inF0' (temp 4X4 matrix of float) +0:319 ldexp (global 4X4 matrix of float) +0:319 'inF0' (temp 4X4 matrix of float) +0:319 'inF1' (temp 4X4 matrix of float) +0:319 log (global 4X4 matrix of float) +0:319 'inF0' (temp 4X4 matrix of float) +0:319 log2 (global 4X4 matrix of float) +0:319 'inF0' (temp 4X4 matrix of float) +0:319 max (global 4X4 matrix of float) +0:319 'inF0' (temp 4X4 matrix of float) +0:319 'inF1' (temp 4X4 matrix of float) +0:319 min (global 4X4 matrix of float) +0:319 'inF0' (temp 4X4 matrix of float) +0:319 'inF1' (temp 4X4 matrix of float) +0:319 pow (global 4X4 matrix of float) +0:319 'inF0' (temp 4X4 matrix of float) +0:319 'inF1' (temp 4X4 matrix of float) +0:319 radians (global 4X4 matrix of float) +0:319 'inF0' (temp 4X4 matrix of float) +0:319 roundEven (global 4X4 matrix of float) +0:319 'inF0' (temp 4X4 matrix of float) +0:319 inverse sqrt (global 4X4 matrix of float) +0:319 'inF0' (temp 4X4 matrix of float) +0:319 Sign (global 4X4 matrix of float) +0:319 'inF0' (temp 4X4 matrix of float) +0:319 sine (global 4X4 matrix of float) +0:319 'inF0' (temp 4X4 matrix of float) +0:319 hyp. sine (global 4X4 matrix of float) +0:319 'inF0' (temp 4X4 matrix of float) +0:319 smoothstep (global 4X4 matrix of float) +0:319 'inF0' (temp 4X4 matrix of float) +0:319 'inF1' (temp 4X4 matrix of float) +0:319 'inF2' (temp 4X4 matrix of float) +0:319 sqrt (global 4X4 matrix of float) +0:319 'inF0' (temp 4X4 matrix of float) +0:319 step (global 4X4 matrix of float) +0:319 'inF0' (temp 4X4 matrix of float) +0:319 'inF1' (temp 4X4 matrix of float) +0:319 tangent (global 4X4 matrix of float) +0:319 'inF0' (temp 4X4 matrix of float) +0:319 hyp. tangent (global 4X4 matrix of float) +0:319 'inF0' (temp 4X4 matrix of float) +0:319 transpose (global 4X4 matrix of float) +0:319 'inF0' (temp 4X4 matrix of float) +0:319 trunc (global 4X4 matrix of float) +0:319 'inF0' (temp 4X4 matrix of float) +0:322 Branch: Return with expression +0:? Constant: +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? 4.000000 +0:? Linker Objects + +Missing functionality: missing user function; linker needs to catch that +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 796 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "VertexShaderFunction" + Source HLSL 450 + Name 4 "VertexShaderFunction" + Name 8 "inF0" + Name 23 "inF1" + Name 30 "inF2" + Name 55 "ResType" + Name 115 "inF0" + Name 129 "inF1" + Name 136 "inF2" + Name 171 "ResType" + Name 244 "inF0" + Name 258 "inF1" + Name 265 "inF2" + Name 303 "ResType" + Name 374 "inF0" + Name 388 "inF1" + Name 395 "inF2" + Name 429 "ResType" + Name 501 "inF0" + Name 515 "inF1" + Name 522 "inF2" + Name 544 "ResType" + Name 600 "inF0" + Name 614 "inF1" + Name 621 "inF2" + Name 643 "ResType" + Name 699 "inF0" + Name 713 "inF1" + Name 720 "inF2" + Name 742 "ResType" + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypePointer Function 6(float) + 10: TypeBool + 37: TypeInt 32 0 + 38: 37(int) Constant 7 + 46: TypeInt 32 1 + 47: 46(int) Constant 7 + 55(ResType): TypeStruct 6(float) 46(int) + 83: 37(int) Constant 2 + 110: 6(float) Constant 0 + 113: TypeVector 6(float) 2 + 114: TypePointer Function 113(fvec2) + 143: TypeVector 37(int) 2 + 144: 37(int) Constant 3 + 145: 143(ivec2) ConstantComposite 38 144 + 170: TypeVector 46(int) 2 + 171(ResType): TypeStruct 113(fvec2) 170(ivec2) + 178: TypeVector 10(bool) 2 + 209: 6(float) Constant 1073741824 + 211: 37(int) Constant 1 + 212: 143(ivec2) ConstantComposite 211 83 + 239: 6(float) Constant 1065353216 + 240: 113(fvec2) ConstantComposite 239 209 + 242: TypeVector 6(float) 3 + 243: TypePointer Function 242(fvec3) + 272: TypeVector 37(int) 3 + 273: 37(int) Constant 5 + 274: 272(ivec3) ConstantComposite 38 144 273 + 302: TypeVector 46(int) 3 + 303(ResType): TypeStruct 242(fvec3) 302(ivec3) + 310: TypeVector 10(bool) 3 + 342: 272(ivec3) ConstantComposite 211 83 144 + 369: 6(float) Constant 1077936128 + 370: 242(fvec3) ConstantComposite 239 209 369 + 372: TypeVector 6(float) 4 + 373: TypePointer Function 372(fvec4) + 402: TypeVector 37(int) 4 + 403: 402(ivec4) ConstantComposite 38 144 273 83 + 428: TypeVector 46(int) 4 + 429(ResType): TypeStruct 372(fvec4) 428(ivec4) + 436: TypeVector 10(bool) 4 + 468: 37(int) Constant 4 + 469: 402(ivec4) ConstantComposite 211 83 144 468 + 496: 6(float) Constant 1082130432 + 497: 372(fvec4) ConstantComposite 239 209 369 496 + 499: TypeMatrix 113(fvec2) 2 + 500: TypePointer Function 499 + 544(ResType): TypeStruct 499 170(ivec2) + 595: 113(fvec2) ConstantComposite 209 209 + 596: 499 ConstantComposite 595 595 + 598: TypeMatrix 242(fvec3) 3 + 599: TypePointer Function 598 + 643(ResType): TypeStruct 598 302(ivec3) + 694: 242(fvec3) ConstantComposite 369 369 369 + 695: 598 ConstantComposite 694 694 694 + 697: TypeMatrix 372(fvec4) 4 + 698: TypePointer Function 697 + 742(ResType): TypeStruct 697 428(ivec4) + 793: 372(fvec4) ConstantComposite 496 496 496 496 + 794: 697 ConstantComposite 793 793 793 793 +4(VertexShaderFunction): 2 Function None 3 + 5: Label + 8(inF0): 7(ptr) Variable Function + 23(inF1): 7(ptr) Variable Function + 30(inF2): 7(ptr) Variable Function + 115(inF0): 114(ptr) Variable Function + 129(inF1): 114(ptr) Variable Function + 136(inF2): 114(ptr) Variable Function + 244(inF0): 243(ptr) Variable Function + 258(inF1): 243(ptr) Variable Function + 265(inF2): 243(ptr) Variable Function + 374(inF0): 373(ptr) Variable Function + 388(inF1): 373(ptr) Variable Function + 395(inF2): 373(ptr) Variable Function + 501(inF0): 500(ptr) Variable Function + 515(inF1): 500(ptr) Variable Function + 522(inF2): 500(ptr) Variable Function + 600(inF0): 599(ptr) Variable Function + 614(inF1): 599(ptr) Variable Function + 621(inF2): 599(ptr) Variable Function + 699(inF0): 698(ptr) Variable Function + 713(inF1): 698(ptr) Variable Function + 720(inF2): 698(ptr) Variable Function + 9: 6(float) Load 8(inF0) + 11: 10(bool) All 9 + 12: 6(float) Load 8(inF0) + 13: 6(float) ExtInst 1(GLSL.std.450) 4(FAbs) 12 + 14: 6(float) Load 8(inF0) + 15: 6(float) ExtInst 1(GLSL.std.450) 17(Acos) 14 + 16: 6(float) Load 8(inF0) + 17: 10(bool) Any 16 + 18: 6(float) Load 8(inF0) + 19: 6(float) ExtInst 1(GLSL.std.450) 16(Asin) 18 + 20: 6(float) Load 8(inF0) + 21: 6(float) ExtInst 1(GLSL.std.450) 18(Atan) 20 + 22: 6(float) Load 8(inF0) + 24: 6(float) Load 23(inF1) + 25: 6(float) ExtInst 1(GLSL.std.450) 25(Atan2) 22 24 + 26: 6(float) Load 8(inF0) + 27: 6(float) ExtInst 1(GLSL.std.450) 9(Ceil) 26 + 28: 6(float) Load 8(inF0) + 29: 6(float) Load 23(inF1) + 31: 6(float) Load 30(inF2) + 32: 6(float) ExtInst 1(GLSL.std.450) 43(FClamp) 28 29 31 + 33: 6(float) Load 8(inF0) + 34: 6(float) ExtInst 1(GLSL.std.450) 14(Cos) 33 + 35: 6(float) Load 8(inF0) + 36: 6(float) ExtInst 1(GLSL.std.450) 20(Cosh) 35 + 39: 37(int) BitCount 38 + 40: 6(float) Load 8(inF0) + 41: 6(float) ExtInst 1(GLSL.std.450) 12(Degrees) 40 + 42: 6(float) Load 8(inF0) + 43: 6(float) ExtInst 1(GLSL.std.450) 27(Exp) 42 + 44: 6(float) Load 8(inF0) + 45: 6(float) ExtInst 1(GLSL.std.450) 29(Exp2) 44 + 48: 46(int) ExtInst 1(GLSL.std.450) 74(FindSMsb) 47 + 49: 46(int) ExtInst 1(GLSL.std.450) 73(FindILsb) 47 + 50: 6(float) Load 8(inF0) + 51: 6(float) ExtInst 1(GLSL.std.450) 8(Floor) 50 + 52: 6(float) Load 8(inF0) + 53: 6(float) ExtInst 1(GLSL.std.450) 10(Fract) 52 + 54: 6(float) Load 8(inF0) + 56: 55(ResType) ExtInst 1(GLSL.std.450) 52(FrexpStruct) 54 + 57: 46(int) CompositeExtract 56 1 + Store 23(inF1) 57 + 58: 6(float) CompositeExtract 56 0 + 59: 6(float) Load 8(inF0) + 60: 6(float) Fwidth 59 + 61: 6(float) Load 8(inF0) + 62: 10(bool) IsInf 61 + 63: 6(float) Load 8(inF0) + 64: 10(bool) IsNan 63 + 65: 6(float) Load 8(inF0) + 66: 6(float) Load 23(inF1) + 67: 6(float) ExtInst 1(GLSL.std.450) 53(Ldexp) 65 66 + 68: 6(float) Load 8(inF0) + 69: 6(float) ExtInst 1(GLSL.std.450) 28(Log) 68 + 70: 6(float) Load 8(inF0) + 71: 6(float) ExtInst 1(GLSL.std.450) 30(Log2) 70 + 72: 6(float) Load 8(inF0) + 73: 6(float) Load 23(inF1) + 74: 6(float) ExtInst 1(GLSL.std.450) 40(FMax) 72 73 + 75: 6(float) Load 8(inF0) + 76: 6(float) Load 23(inF1) + 77: 6(float) ExtInst 1(GLSL.std.450) 37(FMin) 75 76 + 78: 6(float) Load 8(inF0) + 79: 6(float) Load 23(inF1) + 80: 6(float) ExtInst 1(GLSL.std.450) 26(Pow) 78 79 + 81: 6(float) Load 8(inF0) + 82: 6(float) ExtInst 1(GLSL.std.450) 11(Radians) 81 + 84: 37(int) BitReverse 83 + 85: 6(float) Load 8(inF0) + 86: 6(float) ExtInst 1(GLSL.std.450) 2(RoundEven) 85 + 87: 6(float) Load 8(inF0) + 88: 6(float) ExtInst 1(GLSL.std.450) 32(InverseSqrt) 87 + 89: 6(float) Load 8(inF0) + 90: 6(float) ExtInst 1(GLSL.std.450) 6(FSign) 89 + 91: 6(float) Load 8(inF0) + 92: 6(float) ExtInst 1(GLSL.std.450) 13(Sin) 91 + 93: 6(float) Load 8(inF0) + 94: 6(float) ExtInst 1(GLSL.std.450) 19(Sinh) 93 + 95: 6(float) Load 8(inF0) + 96: 6(float) Load 23(inF1) + 97: 6(float) Load 30(inF2) + 98: 6(float) ExtInst 1(GLSL.std.450) 49(SmoothStep) 95 96 97 + 99: 6(float) Load 8(inF0) + 100: 6(float) ExtInst 1(GLSL.std.450) 31(Sqrt) 99 + 101: 6(float) Load 8(inF0) + 102: 6(float) Load 23(inF1) + 103: 6(float) ExtInst 1(GLSL.std.450) 48(Step) 101 102 + 104: 6(float) Load 8(inF0) + 105: 6(float) ExtInst 1(GLSL.std.450) 15(Tan) 104 + 106: 6(float) Load 8(inF0) + 107: 6(float) ExtInst 1(GLSL.std.450) 21(Tanh) 106 + 108: 6(float) Load 8(inF0) + 109: 6(float) ExtInst 1(GLSL.std.450) 3(Trunc) 108 + ReturnValue 110 + FunctionEnd diff --git a/Test/baseResults/hlsl.matType.frag.out b/Test/baseResults/hlsl.matType.frag.out new file mode 100755 index 00000000..298211df --- /dev/null +++ b/Test/baseResults/hlsl.matType.frag.out @@ -0,0 +1,101 @@ +hlsl.matType.frag +Shader version: 450 +gl_FragCoord origin is upper left +0:? Sequence +0:1 move second child to first child (temp 1-component vector of float) +0:1 'f1' (temp 1-component vector of float) +0:1 Constant: +0:1 1.000000 +0:11 Function Definition: ShaderFunction(vf1;f1; (temp 1-component vector of float) +0:9 Function Parameters: +0:9 'inFloat1' (temp 1-component vector of float) +0:9 'inScalar' (temp float) +0:? Linker Objects +0:? 'f1' (temp 1-component vector of float) +0:? 'fmat11' (temp 1X1 matrix of float) +0:? 'fmat41' (temp 1X4 matrix of float) +0:? 'fmat12' (temp 2X1 matrix of float) +0:? 'dmat23' (temp 3X2 matrix of double) +0:? 'int44' (temp 4X4 matrix of int) + + +Linked fragment stage: + + +Shader version: 450 +gl_FragCoord origin is upper left +0:? Sequence +0:1 move second child to first child (temp 1-component vector of float) +0:1 'f1' (temp 1-component vector of float) +0:1 Constant: +0:1 1.000000 +0:11 Function Definition: ShaderFunction(vf1;f1; (temp 1-component vector of float) +0:9 Function Parameters: +0:9 'inFloat1' (temp 1-component vector of float) +0:9 'inScalar' (temp float) +0:? Linker Objects +0:? 'f1' (temp 1-component vector of float) +0:? 'fmat11' (temp 1X1 matrix of float) +0:? 'fmat41' (temp 1X4 matrix of float) +0:? 'fmat12' (temp 2X1 matrix of float) +0:? 'dmat23' (temp 3X2 matrix of double) +0:? 'int44' (temp 4X4 matrix of int) + +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 36 + + Capability Shader + Capability Float64 + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "PixelShaderFunction" + ExecutionMode 4 OriginUpperLeft + Source HLSL 450 + Name 4 "PixelShaderFunction" + Name 11 "ShaderFunction(vf1;f1;" + Name 9 "inFloat1" + Name 10 "inScalar" + Name 14 "f1" + Name 18 "fmat11" + Name 22 "fmat41" + Name 25 "fmat12" + Name 30 "dmat23" + Name 35 "int44" + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypePointer Function 6(float) + 8: TypeFunction 6(float) 7(ptr) 7(ptr) + 15: TypeVector 6(float) 1 + 16: TypeMatrix 15(fvec) 1 + 17: TypePointer Function 16 + 19: TypeVector 6(float) 4 + 20: TypeMatrix 19(fvec4) 1 + 21: TypePointer Function 20 + 23: TypeMatrix 15(fvec) 2 + 24: TypePointer Function 23 + 26: TypeFloat 64 + 27: TypeVector 26(float) 2 + 28: TypeMatrix 27(fvec2) 3 + 29: TypePointer Function 28 + 31: TypeInt 32 1 + 32: TypeVector 31(int) 4 + 33: TypeMatrix 32(ivec4) 4 + 34: TypePointer Function 33 +4(PixelShaderFunction): 2 Function None 3 + 5: Label + FunctionEnd +11(ShaderFunction(vf1;f1;): 6(float) Function None 8 + 9(inFloat1): 7(ptr) FunctionParameter + 10(inScalar): 7(ptr) FunctionParameter + 12: Label + 14(f1): 7(ptr) Variable Function + 18(fmat11): 17(ptr) Variable Function + 22(fmat41): 21(ptr) Variable Function + 25(fmat12): 24(ptr) Variable Function + 30(dmat23): 29(ptr) Variable Function + 35(int44): 34(ptr) Variable Function + 13: 6(float) Undef + ReturnValue 13 + FunctionEnd diff --git a/Test/baseResults/hlsl.max.frag.out b/Test/baseResults/hlsl.max.frag.out new file mode 100755 index 00000000..7c3c7e69 --- /dev/null +++ b/Test/baseResults/hlsl.max.frag.out @@ -0,0 +1,60 @@ +hlsl.max.frag +Shader version: 450 +gl_FragCoord origin is upper left +0:? Sequence +0:5 Function Definition: PixelShaderFunction(vf4;vf4; (temp 4-component vector of float) +0:2 Function Parameters: +0:2 'input1' (temp 4-component vector of float) +0:2 'input2' (temp 4-component vector of float) +0:? Sequence +0:3 Branch: Return with expression +0:3 max (global 4-component vector of float) +0:3 'input1' (temp 4-component vector of float) +0:3 'input2' (temp 4-component vector of float) +0:? Linker Objects + + +Linked fragment stage: + + +Shader version: 450 +gl_FragCoord origin is upper left +0:? Sequence +0:5 Function Definition: PixelShaderFunction(vf4;vf4; (temp 4-component vector of float) +0:2 Function Parameters: +0:2 'input1' (temp 4-component vector of float) +0:2 'input2' (temp 4-component vector of float) +0:? Sequence +0:3 Branch: Return with expression +0:3 max (global 4-component vector of float) +0:3 'input1' (temp 4-component vector of float) +0:3 'input2' (temp 4-component vector of float) +0:? Linker Objects + +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 15 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "PixelShaderFunction" + ExecutionMode 4 OriginUpperLeft + Source HLSL 450 + Name 4 "PixelShaderFunction" + Name 9 "input1" + Name 11 "input2" + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Function 7(fvec4) +4(PixelShaderFunction): 2 Function None 3 + 5: Label + 9(input1): 8(ptr) Variable Function + 11(input2): 8(ptr) Variable Function + 10: 7(fvec4) Load 9(input1) + 12: 7(fvec4) Load 11(input2) + 13: 7(fvec4) ExtInst 1(GLSL.std.450) 40(FMax) 10 12 + ReturnValue 13 + FunctionEnd diff --git a/Test/baseResults/hlsl.precedence.frag.out b/Test/baseResults/hlsl.precedence.frag.out new file mode 100755 index 00000000..dc0b0e93 --- /dev/null +++ b/Test/baseResults/hlsl.precedence.frag.out @@ -0,0 +1,80 @@ +hlsl.precedence.frag +Shader version: 450 +gl_FragCoord origin is upper left +0:? Sequence +0:10 Function Definition: PixelShaderFunction(vf4;vf4;vf4;vf4; (temp 4-component vector of float) +0:7 Function Parameters: +0:7 'a1' (temp 4-component vector of float) +0:7 'a2' (temp 4-component vector of float) +0:7 'a3' (temp 4-component vector of float) +0:7 'a4' (temp 4-component vector of float) +0:? Sequence +0:8 Branch: Return with expression +0:8 add (temp 4-component vector of float) +0:8 add (temp 4-component vector of float) +0:8 'a1' (temp 4-component vector of float) +0:8 component-wise multiply (temp 4-component vector of float) +0:8 'a2' (temp 4-component vector of float) +0:8 'a3' (temp 4-component vector of float) +0:8 'a4' (temp 4-component vector of float) +0:? Linker Objects + + +Linked fragment stage: + + +Shader version: 450 +gl_FragCoord origin is upper left +0:? Sequence +0:10 Function Definition: PixelShaderFunction(vf4;vf4;vf4;vf4; (temp 4-component vector of float) +0:7 Function Parameters: +0:7 'a1' (temp 4-component vector of float) +0:7 'a2' (temp 4-component vector of float) +0:7 'a3' (temp 4-component vector of float) +0:7 'a4' (temp 4-component vector of float) +0:? Sequence +0:8 Branch: Return with expression +0:8 add (temp 4-component vector of float) +0:8 add (temp 4-component vector of float) +0:8 'a1' (temp 4-component vector of float) +0:8 component-wise multiply (temp 4-component vector of float) +0:8 'a2' (temp 4-component vector of float) +0:8 'a3' (temp 4-component vector of float) +0:8 'a4' (temp 4-component vector of float) +0:? Linker Objects + +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 21 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "PixelShaderFunction" + ExecutionMode 4 OriginUpperLeft + Source HLSL 450 + Name 4 "PixelShaderFunction" + Name 9 "a1" + Name 11 "a2" + Name 13 "a3" + Name 17 "a4" + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Function 7(fvec4) +4(PixelShaderFunction): 2 Function None 3 + 5: Label + 9(a1): 8(ptr) Variable Function + 11(a2): 8(ptr) Variable Function + 13(a3): 8(ptr) Variable Function + 17(a4): 8(ptr) Variable Function + 10: 7(fvec4) Load 9(a1) + 12: 7(fvec4) Load 11(a2) + 14: 7(fvec4) Load 13(a3) + 15: 7(fvec4) FMul 12 14 + 16: 7(fvec4) FAdd 10 15 + 18: 7(fvec4) Load 17(a4) + 19: 7(fvec4) FAdd 16 18 + ReturnValue 19 + FunctionEnd diff --git a/Test/baseResults/hlsl.precedence2.frag.out b/Test/baseResults/hlsl.precedence2.frag.out new file mode 100755 index 00000000..73d500d3 --- /dev/null +++ b/Test/baseResults/hlsl.precedence2.frag.out @@ -0,0 +1,103 @@ +hlsl.precedence2.frag +Shader version: 450 +gl_FragCoord origin is upper left +0:? Sequence +0:10 Function Definition: PixelShaderFunction(i1;i1;i1;i1; (temp int) +0:7 Function Parameters: +0:7 'a1' (temp int) +0:7 'a2' (temp int) +0:7 'a3' (temp int) +0:7 'a4' (temp int) +0:? Sequence +0:8 Branch: Return with expression +0:8 add (temp int) +0:8 left-shift (temp int) +0:8 add (temp int) +0:8 component-wise multiply (temp int) +0:8 'a1' (temp int) +0:8 'a2' (temp int) +0:8 'a3' (temp int) +0:8 'a4' (temp int) +0:8 left-shift (temp int) +0:8 'a1' (temp int) +0:8 add (temp int) +0:8 'a2' (temp int) +0:8 component-wise multiply (temp int) +0:8 'a3' (temp int) +0:8 'a4' (temp int) +0:? Linker Objects + + +Linked fragment stage: + + +Shader version: 450 +gl_FragCoord origin is upper left +0:? Sequence +0:10 Function Definition: PixelShaderFunction(i1;i1;i1;i1; (temp int) +0:7 Function Parameters: +0:7 'a1' (temp int) +0:7 'a2' (temp int) +0:7 'a3' (temp int) +0:7 'a4' (temp int) +0:? Sequence +0:8 Branch: Return with expression +0:8 add (temp int) +0:8 left-shift (temp int) +0:8 add (temp int) +0:8 component-wise multiply (temp int) +0:8 'a1' (temp int) +0:8 'a2' (temp int) +0:8 'a3' (temp int) +0:8 'a4' (temp int) +0:8 left-shift (temp int) +0:8 'a1' (temp int) +0:8 add (temp int) +0:8 'a2' (temp int) +0:8 component-wise multiply (temp int) +0:8 'a3' (temp int) +0:8 'a4' (temp int) +0:? Linker Objects + +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 28 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "PixelShaderFunction" + ExecutionMode 4 OriginUpperLeft + Source HLSL 450 + Name 4 "PixelShaderFunction" + Name 8 "a1" + Name 10 "a2" + Name 13 "a3" + Name 16 "a4" + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 1 + 7: TypePointer Function 6(int) +4(PixelShaderFunction): 2 Function None 3 + 5: Label + 8(a1): 7(ptr) Variable Function + 10(a2): 7(ptr) Variable Function + 13(a3): 7(ptr) Variable Function + 16(a4): 7(ptr) Variable Function + 9: 6(int) Load 8(a1) + 11: 6(int) Load 10(a2) + 12: 6(int) IMul 9 11 + 14: 6(int) Load 13(a3) + 15: 6(int) IAdd 12 14 + 17: 6(int) Load 16(a4) + 18: 6(int) ShiftLeftLogical 15 17 + 19: 6(int) Load 8(a1) + 20: 6(int) Load 10(a2) + 21: 6(int) Load 13(a3) + 22: 6(int) Load 16(a4) + 23: 6(int) IMul 21 22 + 24: 6(int) IAdd 20 23 + 25: 6(int) ShiftLeftLogical 19 24 + 26: 6(int) IAdd 18 25 + ReturnValue 26 + FunctionEnd diff --git a/Test/baseResults/hlsl.sin.frag.out b/Test/baseResults/hlsl.sin.frag.out new file mode 100755 index 00000000..331945ac --- /dev/null +++ b/Test/baseResults/hlsl.sin.frag.out @@ -0,0 +1,53 @@ +hlsl.sin.frag +Shader version: 450 +gl_FragCoord origin is upper left +0:? Sequence +0:5 Function Definition: PixelShaderFunction(vf4; (temp 4-component vector of float) +0:2 Function Parameters: +0:2 'input' (temp 4-component vector of float) +0:? Sequence +0:3 Branch: Return with expression +0:3 sine (global 4-component vector of float) +0:3 'input' (temp 4-component vector of float) +0:? Linker Objects + + +Linked fragment stage: + + +Shader version: 450 +gl_FragCoord origin is upper left +0:? Sequence +0:5 Function Definition: PixelShaderFunction(vf4; (temp 4-component vector of float) +0:2 Function Parameters: +0:2 'input' (temp 4-component vector of float) +0:? Sequence +0:3 Branch: Return with expression +0:3 sine (global 4-component vector of float) +0:3 'input' (temp 4-component vector of float) +0:? Linker Objects + +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 13 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "PixelShaderFunction" + ExecutionMode 4 OriginUpperLeft + Source HLSL 450 + Name 4 "PixelShaderFunction" + Name 9 "input" + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 4 + 8: TypePointer Function 7(fvec4) +4(PixelShaderFunction): 2 Function None 3 + 5: Label + 9(input): 8(ptr) Variable Function + 10: 7(fvec4) Load 9(input) + 11: 7(fvec4) ExtInst 1(GLSL.std.450) 13(Sin) 10 + ReturnValue 11 + FunctionEnd diff --git a/Test/baseResults/hlsl.whileLoop.frag.out b/Test/baseResults/hlsl.whileLoop.frag.out new file mode 100755 index 00000000..686407bd --- /dev/null +++ b/Test/baseResults/hlsl.whileLoop.frag.out @@ -0,0 +1,145 @@ +hlsl.whileLoop.frag +Shader version: 450 +gl_FragCoord origin is upper left +0:? Sequence +0:8 Function Definition: PixelShaderFunction(vf4; (temp 4-component vector of float) +0:2 Function Parameters: +0:2 'input' (temp 4-component vector of float) +0:? Sequence +0:3 Loop with condition tested first +0:3 Loop Condition +0:3 Compare Not Equal (temp bool) +0:3 'input' (temp 4-component vector of float) +0:3 'input' (temp 4-component vector of float) +0:3 Loop Body +0:? Sequence +0:3 Branch: Return with expression +0:3 'input' (temp 4-component vector of float) +0:4 Loop with condition tested first +0:4 Loop Condition +0:4 Constant: +0:4 false (const bool) +0:4 No loop body +0:5 Loop with condition tested first +0:5 Loop Condition +0:5 Constant: +0:5 false (const bool) +0:5 No loop body +0:6 Loop with condition tested first +0:6 Loop Condition +0:6 Constant: +0:6 false (const bool) +0:6 No loop body +0:? Linker Objects + + +Linked fragment stage: + + +Shader version: 450 +gl_FragCoord origin is upper left +0:? Sequence +0:8 Function Definition: PixelShaderFunction(vf4; (temp 4-component vector of float) +0:2 Function Parameters: +0:2 'input' (temp 4-component vector of float) +0:? Sequence +0:3 Loop with condition tested first +0:3 Loop Condition +0:3 Compare Not Equal (temp bool) +0:3 'input' (temp 4-component vector of float) +0:3 'input' (temp 4-component vector of float) +0:3 Loop Body +0:? Sequence +0:3 Branch: Return with expression +0:3 'input' (temp 4-component vector of float) +0:4 Loop with condition tested first +0:4 Loop Condition +0:4 Constant: +0:4 false (const bool) +0:4 No loop body +0:5 Loop with condition tested first +0:5 Loop Condition +0:5 Constant: +0:5 false (const bool) +0:5 No loop body +0:6 Loop with condition tested first +0:6 Loop Condition +0:6 Constant: +0:6 false (const bool) +0:6 No loop body +0:? Linker Objects + +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 39 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "PixelShaderFunction" + ExecutionMode 4 OriginUpperLeft + Source HLSL 450 + Name 4 "PixelShaderFunction" + Name 14 "input" + 2: TypeVoid + 3: TypeFunction 2 + 11: TypeFloat 32 + 12: TypeVector 11(float) 4 + 13: TypePointer Function 12(fvec4) + 17: TypeBool + 18: TypeVector 17(bool) 4 + 28: 17(bool) ConstantFalse +4(PixelShaderFunction): 2 Function None 3 + 5: Label + 14(input): 13(ptr) Variable Function + Branch 6 + 6: Label + LoopMerge 8 9 None + Branch 10 + 10: Label + 15: 12(fvec4) Load 14(input) + 16: 12(fvec4) Load 14(input) + 19: 18(bvec4) FOrdNotEqual 15 16 + 20: 17(bool) Any 19 + BranchConditional 20 7 8 + 7: Label + 21: 12(fvec4) Load 14(input) + ReturnValue 21 + 9: Label + Branch 6 + 8: Label + Branch 23 + 23: Label + LoopMerge 25 26 None + Branch 27 + 27: Label + BranchConditional 28 24 25 + 24: Label + Branch 26 + 26: Label + Branch 23 + 25: Label + Branch 29 + 29: Label + LoopMerge 31 32 None + Branch 33 + 33: Label + BranchConditional 28 30 31 + 30: Label + Branch 32 + 32: Label + Branch 29 + 31: Label + Branch 34 + 34: Label + LoopMerge 36 37 None + Branch 38 + 38: Label + BranchConditional 28 35 36 + 35: Label + Branch 37 + 37: Label + Branch 34 + 36: Label + Return + FunctionEnd diff --git a/Test/baseResults/link1.frag.out b/Test/baseResults/link1.frag.out index bc6cf5c8..51d7475a 100644 --- a/Test/baseResults/link1.frag.out +++ b/Test/baseResults/link1.frag.out @@ -158,136 +158,5 @@ Requested GL_OES_texture_3D 0:? Linker Objects 0:? 'iv3' (smooth in highp 2-component vector of float) - -Linked fragment stage: - -ERROR: Linking fragment stage: Types must match: - glass: "uniform 3-component vector of float" versus "uniform 2-component vector of float" -ERROR: Linking fragment stage: Interpolation and auxiliary storage qualifiers must match: - cup: "smooth in 4-component vector of float" versus "flat in 4-component vector of float" -ERROR: Linking fragment stage: Initializers must match: - cv3e -ERROR: Linking fragment stage: Initializers must match: - um2e -ERROR: Linking fragment stage: Initializers must match: - se -ERROR: Linking fragment stage: Cannot mix ES profile with non-ES profile shaders - -ERROR: Linking fragment stage: Types must match: -ERROR: Linking fragment stage: Precision qualifiers must match: - iv3: "smooth in 3-component vector of float" versus "smooth in highp 2-component vector of float" - -Shader version: 300 -Requested GL_OES_EGL_image_external -Requested GL_OES_standard_derivatives -Requested GL_OES_texture_3D -0:? Sequence -0:8 Sequence -0:8 move second child to first child (temp 4-component vector of float) -0:8 'a' (global 4-component vector of float) -0:8 vector-scale (temp 4-component vector of float) -0:8 Constant: -0:8 8.000000 -0:8 'uv4' (uniform 4-component vector of float) -0:13 Function Definition: main( (global void) -0:13 Function Parameters: -0:17 Sequence -0:17 move second child to first child (temp 4-component vector of float) -0:17 'b' (global 4-component vector of float) -0:17 vector-scale (temp 4-component vector of float) -0:17 Constant: -0:17 8.000000 -0:17 'a' (global 4-component vector of float) -0:19 Function Definition: foo(mf22; (global 2-component vector of int) -0:19 Function Parameters: -0:19 'm' (in 2X2 matrix of float) -0:21 Sequence -0:21 Branch: Return with expression -0:21 Convert float to int (temp 2-component vector of int) -0:21 direct index (temp 2-component vector of float) -0:21 'm' (in 2X2 matrix of float) -0:21 Constant: -0:21 0 (const int) -0:24 Sequence -0:24 move second child to first child (temp 4-component vector of float) -0:24 'c' (global 4-component vector of float) -0:24 component-wise multiply (temp 4-component vector of float) -0:24 'b' (global 4-component vector of float) -0:24 'b' (global 4-component vector of float) -0:8 Sequence -0:8 move second child to first child (temp 4-component vector of float) -0:8 'd' (global 4-component vector of float) -0:8 vector-scale (temp 4-component vector of float) -0:8 Constant: -0:8 8.000000 -0:8 'uv4' (uniform 4-component vector of float) -0:13 Sequence -0:13 move second child to first child (temp 4-component vector of float) -0:13 'e' (global 4-component vector of float) -0:13 vector-scale (temp 4-component vector of float) -0:13 Constant: -0:13 8.000000 -0:13 'd' (global 4-component vector of float) -0:15 Function Definition: foo( (global 2-component vector of int) -0:15 Function Parameters: -0:17 Sequence -0:17 Branch: Return with expression -0:17 Constant: -0:17 2 (const int) -0:17 2 (const int) -0:20 Sequence -0:20 move second child to first child (temp 4-component vector of float) -0:20 'f' (global 4-component vector of float) -0:20 component-wise multiply (temp 4-component vector of float) -0:20 'e' (global 4-component vector of float) -0:20 'e' (global 4-component vector of float) -0:? Linker Objects -0:? 'uv4' (uniform 4-component vector of float) -0:? 'glass' (uniform 3-component vector of float) -0:? 'ci' (const int) -0:? 8 (const int) -0:? 'a' (global 4-component vector of float) -0:? 'iv3' (smooth in 3-component vector of float) -0:? 'cup' (smooth in 4-component vector of float) -0:? 'b' (global 4-component vector of float) -0:? 'c' (global 4-component vector of float) -0:? 'cv3' (const 3-component vector of float) -0:? 43.000000 -0:? 0.340000 -0:? 9.900000 -0:? 'cv3n' (const 3-component vector of float) -0:? 43.000000 -0:? 0.340000 -0:? 9.900000 -0:? 'cv3e' (const 3-component vector of float) -0:? 43.000000 -0:? 0.340000 -0:? 9.900000 -0:? 'um2' (uniform 2X2 matrix of float) -0:? 4.000000 -0:? 0.000000 -0:? 0.000000 -0:? 4.000000 -0:? 'um2n' (uniform 2X2 matrix of float) -0:? 4.000000 -0:? 0.000000 -0:? 0.000000 -0:? 4.000000 -0:? 'um2e' (uniform 2X2 matrix of float) -0:? 4.000000 -0:? 0.000000 -0:? 0.000000 -0:? 4.000000 -0:? 's' (uniform structure{global int a, global float b}) -0:? 82 (const int) -0:? 3.900000 -0:? 'sn' (uniform structure{global int a, global float b}) -0:? 82 (const int) -0:? 3.900000 -0:? 'se' (uniform structure{global int a, global float b}) -0:? 82 (const int) -0:? 3.900000 -0:? 'd' (global 4-component vector of float) -0:? 'e' (global 4-component vector of float) -0:? 'f' (global 4-component vector of float) +ERROR: Cannot mix ES profile with non-ES profile shaders diff --git a/Test/baseResults/negativeArraySize.comp.out b/Test/baseResults/negativeArraySize.comp.out new file mode 100644 index 00000000..ccbabf5f --- /dev/null +++ b/Test/baseResults/negativeArraySize.comp.out @@ -0,0 +1,24 @@ +negativeArraySize.comp +Warning, version 310 is not yet complete; most version-specific features are present, but some are missing. +ERROR: 0:9: '' : array size must be a positive integer +ERROR: 1 compilation errors. No code generated. + + +Shader version: 310 +local_size = (1, 1, 1) +ERROR: node is still EOpNull! +0:7 Function Definition: main( (global void) +0:7 Function Parameters: +0:? Linker Objects + + +Linked compute stage: + + +Shader version: 310 +local_size = (1, 1, 1) +ERROR: node is still EOpNull! +0:7 Function Definition: main( (global void) +0:7 Function Parameters: +0:? Linker Objects + diff --git a/Test/baseResults/precise.tesc.out b/Test/baseResults/precise.tesc.out new file mode 100644 index 00000000..962a3c98 --- /dev/null +++ b/Test/baseResults/precise.tesc.out @@ -0,0 +1,768 @@ +precise.tesc +Warning, version 450 is not yet complete; most version-specific features are present, but some are missing. + +Shader version: 450 +Requested GL_EXT_gpu_shader5 +Requested GL_EXT_shader_io_blocks +Requested GL_EXT_tessellation_shader +vertices = -1 +0:? Sequence +0:5 Function Definition: minimal( (global float) +0:5 Function Parameters: +0:6 Sequence +0:6 Sequence +0:6 move second child to first child (temp float) +0:6 'result' (noContraction temp float) +0:6 Constant: +0:6 5.000000 +0:7 Sequence +0:7 move second child to first child (temp float) +0:7 'a' (noContraction temp float) +0:7 Constant: +0:7 10.000000 +0:8 Sequence +0:8 move second child to first child (temp float) +0:8 'b' (noContraction temp float) +0:8 Constant: +0:8 20.000000 +0:9 Sequence +0:9 move second child to first child (temp float) +0:9 'c' (noContraction temp float) +0:9 Constant: +0:9 30.000000 +0:10 Sequence +0:10 move second child to first child (temp float) +0:10 'd' (noContraction temp float) +0:10 Constant: +0:10 40.000000 +0:11 move second child to first child (temp float) +0:11 'result' (noContraction temp float) +0:11 add (noContraction temp float) +0:11 component-wise multiply (noContraction temp float) +0:11 'a' (noContraction temp float) +0:11 'b' (noContraction temp float) +0:11 component-wise multiply (noContraction temp float) +0:11 'c' (noContraction temp float) +0:11 'd' (noContraction temp float) +0:12 Branch: Return with expression +0:12 'result' (noContraction temp float) +0:15 Function Definition: continuous_assignment( (global void) +0:15 Function Parameters: +0:16 Sequence +0:16 Sequence +0:16 move second child to first child (temp float) +0:16 'result' (noContraction temp float) +0:16 Constant: +0:16 5.000000 +0:17 Sequence +0:17 move second child to first child (temp float) +0:17 'a' (noContraction temp float) +0:17 Constant: +0:17 10.000000 +0:18 Sequence +0:18 move second child to first child (temp float) +0:18 'b' (noContraction temp float) +0:18 Constant: +0:18 20.000000 +0:19 move second child to first child (temp float) +0:19 'result' (noContraction temp float) +0:19 move second child to first child (temp float) +0:19 'a' (noContraction temp float) +0:19 add (noContraction temp float) +0:19 'b' (noContraction temp float) +0:19 Constant: +0:19 4.000000 +0:22 Function Definition: convert( (global void) +0:22 Function Parameters: +0:? Sequence +0:24 Sequence +0:24 move second child to first child (temp float) +0:24 'a' (noContraction temp float) +0:24 Constant: +0:24 10.000000 +0:25 Sequence +0:25 move second child to first child (temp float) +0:25 'b' (noContraction temp float) +0:25 Constant: +0:25 20.000000 +0:26 move second child to first child (temp float) +0:26 'b' (noContraction temp float) +0:26 add (noContraction temp float) +0:26 'a' (noContraction temp float) +0:26 'b' (noContraction temp float) +0:27 move second child to first child (temp double) +0:27 'result' (noContraction temp double) +0:27 Convert float to double (temp double) +0:27 'b' (noContraction temp float) +0:30 Function Definition: loop_for( (global float) +0:30 Function Parameters: +0:31 Sequence +0:31 Sequence +0:31 move second child to first child (temp float) +0:31 'r1' (noContraction temp float) +0:31 Constant: +0:31 5.000000 +0:32 Sequence +0:32 move second child to first child (temp float) +0:32 'r2' (noContraction temp float) +0:32 Constant: +0:32 10.000000 +0:33 Sequence +0:33 move second child to first child (temp int) +0:33 'a' (temp int) +0:33 Constant: +0:33 10 (const int) +0:34 Sequence +0:34 move second child to first child (temp int) +0:34 'b' (noContraction temp int) +0:34 Constant: +0:34 20 (const int) +0:35 Sequence +0:35 move second child to first child (temp int) +0:35 'c' (noContraction temp int) +0:35 Constant: +0:35 30 (const int) +0:36 Sequence +0:36 Sequence +0:36 move second child to first child (temp int) +0:36 'i' (noContraction temp int) +0:36 Constant: +0:36 0 (const int) +0:36 Loop with condition tested first +0:36 Loop Condition +0:36 Compare Less Than (temp bool) +0:36 'i' (temp int) +0:36 'a' (temp int) +0:36 Loop Body +0:37 Sequence +0:37 add second child into first child (noContraction temp float) +0:37 'r1' (noContraction temp float) +0:37 add (noContraction temp float) +0:37 add (noContraction temp float) +0:37 Constant: +0:37 3.120000 +0:37 Convert int to float (temp float) +0:37 'b' (noContraction temp int) +0:37 Convert int to float (temp float) +0:37 'i' (noContraction temp int) +0:38 add second child into first child (noContraction temp int) +0:38 'c' (noContraction temp int) +0:38 Constant: +0:38 1 (const int) +0:36 Loop Terminal Expression +0:36 Post-Increment (noContraction temp int) +0:36 'i' (noContraction temp int) +0:40 add second child into first child (temp int) +0:40 'a' (temp int) +0:40 Constant: +0:40 1 (const int) +0:41 move second child to first child (temp float) +0:41 'r2' (noContraction temp float) +0:41 Convert int to float (temp float) +0:41 'c' (noContraction temp int) +0:42 Branch: Return with expression +0:42 Construct float (temp float) +0:42 add (temp float) +0:42 'r1' (noContraction temp float) +0:42 'r2' (noContraction temp float) +0:45 Function Definition: loop_array( (global void) +0:45 Function Parameters: +0:? Sequence +0:48 Sequence +0:48 move second child to first child (temp int) +0:48 'x' (noContraction temp int) +0:48 Constant: +0:48 22 (const int) +0:49 Sequence +0:49 move second child to first child (temp int) +0:49 'y' (noContraction temp int) +0:49 Constant: +0:49 33 (const int) +0:52 add second child into first child (noContraction temp float) +0:52 'result' (noContraction temp float) +0:52 add (noContraction temp float) +0:52 Convert int to float (temp float) +0:52 'x' (noContraction temp int) +0:52 Convert int to float (temp float) +0:52 'y' (noContraction temp int) +0:54 Sequence +0:54 Sequence +0:54 move second child to first child (temp int) +0:54 'i' (temp int) +0:54 Constant: +0:54 0 (const int) +0:54 Loop with condition tested first +0:54 Loop Condition +0:54 Compare Less Than (temp bool) +0:54 'i' (temp int) +0:54 Constant: +0:54 3 (const int) +0:54 Loop Body +0:56 Sequence +0:56 add second child into first child (noContraction temp float) +0:56 'result' (noContraction temp float) +0:56 add (noContraction temp float) +0:56 indirect index (noContraction temp float) +0:56 'a0' (temp 3-element array of float) +0:56 'i' (temp int) +0:56 Constant: +0:56 2.000000 +0:58 move second child to first child (temp float) +0:58 indirect index (noContraction temp float) +0:58 'a0' (noContraction temp 3-element array of float) +0:58 'i' (temp int) +0:58 subtract (noContraction temp float) +0:58 Constant: +0:58 3.000000 +0:58 Post-Increment (noContraction temp float) +0:58 'result' (noContraction temp float) +0:54 Loop Terminal Expression +0:54 Pre-Increment (temp int) +0:54 'i' (temp int) +0:62 Function Definition: loop_while( (global void) +0:62 Function Parameters: +0:63 Sequence +0:63 Sequence +0:63 move second child to first child (temp float) +0:63 'result' (noContraction temp float) +0:63 Constant: +0:63 5.000000 +0:64 Sequence +0:64 move second child to first child (temp int) +0:64 'a' (noContraction temp int) +0:64 Constant: +0:64 10 (const int) +0:65 Sequence +0:65 move second child to first child (temp int) +0:65 'b' (noContraction temp int) +0:65 Constant: +0:65 20 (const int) +0:66 Loop with condition tested first +0:66 Loop Condition +0:66 Compare Less Than (temp bool) +0:66 'result' (noContraction temp float) +0:66 Constant: +0:66 10.000000 +0:66 Loop Body +0:67 Sequence +0:67 add second child into first child (noContraction temp float) +0:67 'result' (noContraction temp float) +0:67 add (noContraction temp float) +0:67 Constant: +0:67 3.120000 +0:67 Convert int to float (temp float) +0:67 'b' (noContraction temp int) +0:69 move second child to first child (temp float) +0:69 'result' (noContraction temp float) +0:69 Convert int to float (temp float) +0:69 add (temp int) +0:69 add (temp int) +0:69 'a' (noContraction temp int) +0:69 'b' (noContraction temp int) +0:69 Constant: +0:69 5 (const int) +0:70 move second child to first child (temp float) +0:70 'result' (noContraction temp float) +0:70 Constant: +0:70 11.100000 +0:73 Function Definition: fma_not_decorated( (global float) +0:73 Function Parameters: +0:? Sequence +0:75 Sequence +0:75 move second child to first child (temp float) +0:75 'a' (noContraction temp float) +0:75 Constant: +0:75 1.000000 +0:76 Sequence +0:76 move second child to first child (temp float) +0:76 'b' (noContraction temp float) +0:76 Constant: +0:76 2.000000 +0:77 Sequence +0:77 move second child to first child (temp float) +0:77 'c' (noContraction temp float) +0:77 Constant: +0:77 3.000000 +0:78 move second child to first child (temp float) +0:78 'b' (noContraction temp float) +0:78 add (noContraction temp float) +0:78 'b' (noContraction temp float) +0:78 'c' (noContraction temp float) +0:79 move second child to first child (temp float) +0:79 'result' (noContraction temp float) +0:79 fma (global float) +0:79 'a' (noContraction temp float) +0:79 'b' (noContraction temp float) +0:79 'c' (noContraction temp float) +0:80 Branch: Return with expression +0:80 'result' (noContraction temp float) +0:83 Function Definition: precise_return_exp_func( (noContraction temp float) +0:83 Function Parameters: +0:84 Sequence +0:84 Sequence +0:84 move second child to first child (temp float) +0:84 'a' (noContraction temp float) +0:84 Constant: +0:84 1.000000 +0:85 Sequence +0:85 move second child to first child (temp float) +0:85 'b' (noContraction temp float) +0:85 Constant: +0:85 2.000000 +0:86 Branch: Return with expression +0:86 add (noContraction temp float) +0:86 'a' (noContraction temp float) +0:86 'b' (noContraction temp float) +0:89 Function Definition: precise_return_val_func( (noContraction temp float) +0:89 Function Parameters: +0:90 Sequence +0:90 Sequence +0:90 move second child to first child (temp float) +0:90 'a' (noContraction temp float) +0:90 Constant: +0:90 1.000000 +0:91 Sequence +0:91 move second child to first child (temp float) +0:91 'b' (noContraction temp float) +0:91 Constant: +0:91 2.000000 +0:92 Sequence +0:92 move second child to first child (temp float) +0:92 'result' (noContraction temp float) +0:92 add (noContraction temp float) +0:92 'a' (noContraction temp float) +0:92 'b' (noContraction temp float) +0:93 Branch: Return with expression +0:93 'result' (noContraction temp float) +0:96 Function Definition: precise_func_parameter(f1;f1; (global float) +0:96 Function Parameters: +0:96 'b' (in float) +0:96 'c' (noContraction out float) +0:97 Sequence +0:97 Sequence +0:97 move second child to first child (temp float) +0:97 'a' (noContraction temp float) +0:97 Constant: +0:97 0.500000 +0:98 move second child to first child (temp float) +0:98 'c' (noContraction out float) +0:98 add (noContraction temp float) +0:98 'a' (noContraction temp float) +0:98 'b' (noContraction in float) +0:99 Branch: Return with expression +0:99 subtract (temp float) +0:99 'a' (temp float) +0:99 'b' (in float) +0:102 Function Definition: matrix(mf23;mf32; (global 3X3 matrix of float) +0:102 Function Parameters: +0:102 'a' (in 2X3 matrix of float) +0:102 'b' (in 3X2 matrix of float) +0:103 Sequence +0:103 Sequence +0:103 move second child to first child (temp 2X3 matrix of float) +0:103 'c' (noContraction temp 2X3 matrix of float) +0:103 Constant: +0:103 1.000000 +0:103 2.000000 +0:103 3.000000 +0:103 4.000000 +0:103 5.000000 +0:103 6.000000 +0:105 move second child to first child (temp 3X3 matrix of float) +0:105 'result' (noContraction temp 3X3 matrix of float) +0:105 matrix-multiply (noContraction temp 3X3 matrix of float) +0:105 add (noContraction temp 2X3 matrix of float) +0:105 'a' (noContraction in 2X3 matrix of float) +0:105 'c' (noContraction temp 2X3 matrix of float) +0:105 'b' (noContraction in 3X2 matrix of float) +0:106 Branch: Return with expression +0:106 'result' (noContraction temp 3X3 matrix of float) +0:109 Function Definition: main( (global void) +0:109 Function Parameters: +0:? Linker Objects + + +Linked tessellation control stage: + +ERROR: Linking tessellation control stage: At least one shader must specify an output layout(vertices=...) + +Shader version: 450 +Requested GL_EXT_gpu_shader5 +Requested GL_EXT_shader_io_blocks +Requested GL_EXT_tessellation_shader +vertices = -1 +0:? Sequence +0:5 Function Definition: minimal( (global float) +0:5 Function Parameters: +0:6 Sequence +0:6 Sequence +0:6 move second child to first child (temp float) +0:6 'result' (noContraction temp float) +0:6 Constant: +0:6 5.000000 +0:7 Sequence +0:7 move second child to first child (temp float) +0:7 'a' (noContraction temp float) +0:7 Constant: +0:7 10.000000 +0:8 Sequence +0:8 move second child to first child (temp float) +0:8 'b' (noContraction temp float) +0:8 Constant: +0:8 20.000000 +0:9 Sequence +0:9 move second child to first child (temp float) +0:9 'c' (noContraction temp float) +0:9 Constant: +0:9 30.000000 +0:10 Sequence +0:10 move second child to first child (temp float) +0:10 'd' (noContraction temp float) +0:10 Constant: +0:10 40.000000 +0:11 move second child to first child (temp float) +0:11 'result' (noContraction temp float) +0:11 add (noContraction temp float) +0:11 component-wise multiply (noContraction temp float) +0:11 'a' (noContraction temp float) +0:11 'b' (noContraction temp float) +0:11 component-wise multiply (noContraction temp float) +0:11 'c' (noContraction temp float) +0:11 'd' (noContraction temp float) +0:12 Branch: Return with expression +0:12 'result' (noContraction temp float) +0:15 Function Definition: continuous_assignment( (global void) +0:15 Function Parameters: +0:16 Sequence +0:16 Sequence +0:16 move second child to first child (temp float) +0:16 'result' (noContraction temp float) +0:16 Constant: +0:16 5.000000 +0:17 Sequence +0:17 move second child to first child (temp float) +0:17 'a' (noContraction temp float) +0:17 Constant: +0:17 10.000000 +0:18 Sequence +0:18 move second child to first child (temp float) +0:18 'b' (noContraction temp float) +0:18 Constant: +0:18 20.000000 +0:19 move second child to first child (temp float) +0:19 'result' (noContraction temp float) +0:19 move second child to first child (temp float) +0:19 'a' (noContraction temp float) +0:19 add (noContraction temp float) +0:19 'b' (noContraction temp float) +0:19 Constant: +0:19 4.000000 +0:22 Function Definition: convert( (global void) +0:22 Function Parameters: +0:? Sequence +0:24 Sequence +0:24 move second child to first child (temp float) +0:24 'a' (noContraction temp float) +0:24 Constant: +0:24 10.000000 +0:25 Sequence +0:25 move second child to first child (temp float) +0:25 'b' (noContraction temp float) +0:25 Constant: +0:25 20.000000 +0:26 move second child to first child (temp float) +0:26 'b' (noContraction temp float) +0:26 add (noContraction temp float) +0:26 'a' (noContraction temp float) +0:26 'b' (noContraction temp float) +0:27 move second child to first child (temp double) +0:27 'result' (noContraction temp double) +0:27 Convert float to double (temp double) +0:27 'b' (noContraction temp float) +0:30 Function Definition: loop_for( (global float) +0:30 Function Parameters: +0:31 Sequence +0:31 Sequence +0:31 move second child to first child (temp float) +0:31 'r1' (noContraction temp float) +0:31 Constant: +0:31 5.000000 +0:32 Sequence +0:32 move second child to first child (temp float) +0:32 'r2' (noContraction temp float) +0:32 Constant: +0:32 10.000000 +0:33 Sequence +0:33 move second child to first child (temp int) +0:33 'a' (temp int) +0:33 Constant: +0:33 10 (const int) +0:34 Sequence +0:34 move second child to first child (temp int) +0:34 'b' (noContraction temp int) +0:34 Constant: +0:34 20 (const int) +0:35 Sequence +0:35 move second child to first child (temp int) +0:35 'c' (noContraction temp int) +0:35 Constant: +0:35 30 (const int) +0:36 Sequence +0:36 Sequence +0:36 move second child to first child (temp int) +0:36 'i' (noContraction temp int) +0:36 Constant: +0:36 0 (const int) +0:36 Loop with condition tested first +0:36 Loop Condition +0:36 Compare Less Than (temp bool) +0:36 'i' (temp int) +0:36 'a' (temp int) +0:36 Loop Body +0:37 Sequence +0:37 add second child into first child (noContraction temp float) +0:37 'r1' (noContraction temp float) +0:37 add (noContraction temp float) +0:37 add (noContraction temp float) +0:37 Constant: +0:37 3.120000 +0:37 Convert int to float (temp float) +0:37 'b' (noContraction temp int) +0:37 Convert int to float (temp float) +0:37 'i' (noContraction temp int) +0:38 add second child into first child (noContraction temp int) +0:38 'c' (noContraction temp int) +0:38 Constant: +0:38 1 (const int) +0:36 Loop Terminal Expression +0:36 Post-Increment (noContraction temp int) +0:36 'i' (noContraction temp int) +0:40 add second child into first child (temp int) +0:40 'a' (temp int) +0:40 Constant: +0:40 1 (const int) +0:41 move second child to first child (temp float) +0:41 'r2' (noContraction temp float) +0:41 Convert int to float (temp float) +0:41 'c' (noContraction temp int) +0:42 Branch: Return with expression +0:42 Construct float (temp float) +0:42 add (temp float) +0:42 'r1' (noContraction temp float) +0:42 'r2' (noContraction temp float) +0:45 Function Definition: loop_array( (global void) +0:45 Function Parameters: +0:? Sequence +0:48 Sequence +0:48 move second child to first child (temp int) +0:48 'x' (noContraction temp int) +0:48 Constant: +0:48 22 (const int) +0:49 Sequence +0:49 move second child to first child (temp int) +0:49 'y' (noContraction temp int) +0:49 Constant: +0:49 33 (const int) +0:52 add second child into first child (noContraction temp float) +0:52 'result' (noContraction temp float) +0:52 add (noContraction temp float) +0:52 Convert int to float (temp float) +0:52 'x' (noContraction temp int) +0:52 Convert int to float (temp float) +0:52 'y' (noContraction temp int) +0:54 Sequence +0:54 Sequence +0:54 move second child to first child (temp int) +0:54 'i' (temp int) +0:54 Constant: +0:54 0 (const int) +0:54 Loop with condition tested first +0:54 Loop Condition +0:54 Compare Less Than (temp bool) +0:54 'i' (temp int) +0:54 Constant: +0:54 3 (const int) +0:54 Loop Body +0:56 Sequence +0:56 add second child into first child (noContraction temp float) +0:56 'result' (noContraction temp float) +0:56 add (noContraction temp float) +0:56 indirect index (noContraction temp float) +0:56 'a0' (temp 3-element array of float) +0:56 'i' (temp int) +0:56 Constant: +0:56 2.000000 +0:58 move second child to first child (temp float) +0:58 indirect index (noContraction temp float) +0:58 'a0' (noContraction temp 3-element array of float) +0:58 'i' (temp int) +0:58 subtract (noContraction temp float) +0:58 Constant: +0:58 3.000000 +0:58 Post-Increment (noContraction temp float) +0:58 'result' (noContraction temp float) +0:54 Loop Terminal Expression +0:54 Pre-Increment (temp int) +0:54 'i' (temp int) +0:62 Function Definition: loop_while( (global void) +0:62 Function Parameters: +0:63 Sequence +0:63 Sequence +0:63 move second child to first child (temp float) +0:63 'result' (noContraction temp float) +0:63 Constant: +0:63 5.000000 +0:64 Sequence +0:64 move second child to first child (temp int) +0:64 'a' (noContraction temp int) +0:64 Constant: +0:64 10 (const int) +0:65 Sequence +0:65 move second child to first child (temp int) +0:65 'b' (noContraction temp int) +0:65 Constant: +0:65 20 (const int) +0:66 Loop with condition tested first +0:66 Loop Condition +0:66 Compare Less Than (temp bool) +0:66 'result' (noContraction temp float) +0:66 Constant: +0:66 10.000000 +0:66 Loop Body +0:67 Sequence +0:67 add second child into first child (noContraction temp float) +0:67 'result' (noContraction temp float) +0:67 add (noContraction temp float) +0:67 Constant: +0:67 3.120000 +0:67 Convert int to float (temp float) +0:67 'b' (noContraction temp int) +0:69 move second child to first child (temp float) +0:69 'result' (noContraction temp float) +0:69 Convert int to float (temp float) +0:69 add (temp int) +0:69 add (temp int) +0:69 'a' (noContraction temp int) +0:69 'b' (noContraction temp int) +0:69 Constant: +0:69 5 (const int) +0:70 move second child to first child (temp float) +0:70 'result' (noContraction temp float) +0:70 Constant: +0:70 11.100000 +0:73 Function Definition: fma_not_decorated( (global float) +0:73 Function Parameters: +0:? Sequence +0:75 Sequence +0:75 move second child to first child (temp float) +0:75 'a' (noContraction temp float) +0:75 Constant: +0:75 1.000000 +0:76 Sequence +0:76 move second child to first child (temp float) +0:76 'b' (noContraction temp float) +0:76 Constant: +0:76 2.000000 +0:77 Sequence +0:77 move second child to first child (temp float) +0:77 'c' (noContraction temp float) +0:77 Constant: +0:77 3.000000 +0:78 move second child to first child (temp float) +0:78 'b' (noContraction temp float) +0:78 add (noContraction temp float) +0:78 'b' (noContraction temp float) +0:78 'c' (noContraction temp float) +0:79 move second child to first child (temp float) +0:79 'result' (noContraction temp float) +0:79 fma (global float) +0:79 'a' (noContraction temp float) +0:79 'b' (noContraction temp float) +0:79 'c' (noContraction temp float) +0:80 Branch: Return with expression +0:80 'result' (noContraction temp float) +0:83 Function Definition: precise_return_exp_func( (noContraction temp float) +0:83 Function Parameters: +0:84 Sequence +0:84 Sequence +0:84 move second child to first child (temp float) +0:84 'a' (noContraction temp float) +0:84 Constant: +0:84 1.000000 +0:85 Sequence +0:85 move second child to first child (temp float) +0:85 'b' (noContraction temp float) +0:85 Constant: +0:85 2.000000 +0:86 Branch: Return with expression +0:86 add (noContraction temp float) +0:86 'a' (noContraction temp float) +0:86 'b' (noContraction temp float) +0:89 Function Definition: precise_return_val_func( (noContraction temp float) +0:89 Function Parameters: +0:90 Sequence +0:90 Sequence +0:90 move second child to first child (temp float) +0:90 'a' (noContraction temp float) +0:90 Constant: +0:90 1.000000 +0:91 Sequence +0:91 move second child to first child (temp float) +0:91 'b' (noContraction temp float) +0:91 Constant: +0:91 2.000000 +0:92 Sequence +0:92 move second child to first child (temp float) +0:92 'result' (noContraction temp float) +0:92 add (noContraction temp float) +0:92 'a' (noContraction temp float) +0:92 'b' (noContraction temp float) +0:93 Branch: Return with expression +0:93 'result' (noContraction temp float) +0:96 Function Definition: precise_func_parameter(f1;f1; (global float) +0:96 Function Parameters: +0:96 'b' (in float) +0:96 'c' (noContraction out float) +0:97 Sequence +0:97 Sequence +0:97 move second child to first child (temp float) +0:97 'a' (noContraction temp float) +0:97 Constant: +0:97 0.500000 +0:98 move second child to first child (temp float) +0:98 'c' (noContraction out float) +0:98 add (noContraction temp float) +0:98 'a' (noContraction temp float) +0:98 'b' (noContraction in float) +0:99 Branch: Return with expression +0:99 subtract (temp float) +0:99 'a' (temp float) +0:99 'b' (in float) +0:102 Function Definition: matrix(mf23;mf32; (global 3X3 matrix of float) +0:102 Function Parameters: +0:102 'a' (in 2X3 matrix of float) +0:102 'b' (in 3X2 matrix of float) +0:103 Sequence +0:103 Sequence +0:103 move second child to first child (temp 2X3 matrix of float) +0:103 'c' (noContraction temp 2X3 matrix of float) +0:103 Constant: +0:103 1.000000 +0:103 2.000000 +0:103 3.000000 +0:103 4.000000 +0:103 5.000000 +0:103 6.000000 +0:105 move second child to first child (temp 3X3 matrix of float) +0:105 'result' (noContraction temp 3X3 matrix of float) +0:105 matrix-multiply (noContraction temp 3X3 matrix of float) +0:105 add (noContraction temp 2X3 matrix of float) +0:105 'a' (noContraction in 2X3 matrix of float) +0:105 'c' (noContraction temp 2X3 matrix of float) +0:105 'b' (noContraction in 3X2 matrix of float) +0:106 Branch: Return with expression +0:106 'result' (noContraction temp 3X3 matrix of float) +0:109 Function Definition: main( (global void) +0:109 Function Parameters: +0:? Linker Objects + diff --git a/Test/baseResults/precise_struct_block.vert.out b/Test/baseResults/precise_struct_block.vert.out new file mode 100644 index 00000000..9d726d65 --- /dev/null +++ b/Test/baseResults/precise_struct_block.vert.out @@ -0,0 +1,1045 @@ +precise_struct_block.vert +Warning, version 450 is not yet complete; most version-specific features are present, but some are missing. + +Shader version: 450 +0:? Sequence +0:11 Function Definition: struct_member( (global float) +0:11 Function Parameters: +0:12 Sequence +0:12 Sequence +0:12 move second child to first child (temp float) +0:12 'a' (noContraction temp float) +0:12 Constant: +0:12 1.000000 +0:13 Sequence +0:13 move second child to first child (temp float) +0:13 'b' (temp float) +0:13 Constant: +0:13 2.000000 +0:14 Sequence +0:14 move second child to first child (temp float) +0:14 'c' (temp float) +0:14 Constant: +0:14 3.000000 +0:15 Sequence +0:15 move second child to first child (temp float) +0:15 'd' (temp float) +0:15 Constant: +0:15 4.000000 +0:21 move second child to first child (temp float) +0:21 f1: direct index for structure (noContraction global float) +0:21 'S2' (temp structure{global float f1, global float f2}) +0:21 Constant: +0:21 0 (const int) +0:21 add (noContraction temp float) +0:21 'a' (noContraction temp float) +0:21 Constant: +0:21 0.200000 +0:22 move second child to first child (temp float) +0:22 f2: direct index for structure (global float) +0:22 'S2' (temp structure{global float f1, global float f2}) +0:22 Constant: +0:22 1 (const int) +0:22 add (temp float) +0:22 'b' (temp float) +0:22 Constant: +0:22 0.200000 +0:23 move second child to first child (temp float) +0:23 f1: direct index for structure (global float) +0:23 'S3' (temp structure{global float f1, global float f2}) +0:23 Constant: +0:23 0 (const int) +0:23 add (temp float) +0:23 'a' (temp float) +0:23 'b' (temp float) +0:24 move second child to first child (temp structure{global float f1, global float f2}) +0:24 'S' (temp structure{global float f1, global float f2}) +0:24 'S2' (temp structure{global float f1, global float f2}) +0:25 move second child to first child (temp float) +0:25 'result' (noContraction temp float) +0:25 add (noContraction temp float) +0:25 f1: direct index for structure (noContraction global float) +0:25 'S' (temp structure{global float f1, global float f2}) +0:25 Constant: +0:25 0 (const int) +0:25 Constant: +0:25 0.100000 +0:27 Branch: Return with expression +0:27 'result' (noContraction temp float) +0:30 Function Definition: complex_array_struct( (global float) +0:30 Function Parameters: +0:? Sequence +0:43 Sequence +0:43 Sequence +0:43 move second child to first child (temp int) +0:43 'i' (noContraction temp int) +0:43 Constant: +0:43 0 (const int) +0:43 Loop with condition tested first +0:43 Loop Condition +0:43 Compare Less Than (temp bool) +0:43 'i' (temp int) +0:43 Constant: +0:43 10 (const int) +0:43 Loop Body +0:44 Sequence +0:44 move second child to first child (temp float) +0:44 f: direct index for structure (temp float) +0:44 indirect index (temp structure{temp float f, temp structure{temp 5-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1a, temp 6-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1b, temp 7-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1c} t2, temp 4-component vector of float v, temp int p}) +0:44 't3' (temp 10-element array of structure{temp float f, temp structure{temp 5-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1a, temp 6-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1b, temp 7-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1c} t2, temp 4-component vector of float v, temp int p}) +0:44 'i' (temp int) +0:44 Constant: +0:44 0 (const int) +0:44 divide (temp float) +0:44 Convert int to float (temp float) +0:44 'i' (temp int) +0:44 Constant: +0:44 3.000000 +0:45 move second child to first child (temp 4-component vector of float) +0:45 v: direct index for structure (noContraction temp 4-component vector of float) +0:45 indirect index (temp structure{temp float f, temp structure{temp 5-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1a, temp 6-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1b, temp 7-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1c} t2, temp 4-component vector of float v, temp int p}) +0:45 't3' (temp 10-element array of structure{temp float f, temp structure{temp 5-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1a, temp 6-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1b, temp 7-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1c} t2, temp 4-component vector of float v, temp int p}) +0:45 'i' (temp int) +0:45 Constant: +0:45 2 (const int) +0:45 Construct vec4 (temp 4-component vector of float) +0:45 component-wise multiply (noContraction temp float) +0:45 Convert int to float (temp float) +0:45 'i' (noContraction temp int) +0:45 Constant: +0:45 1.500000 +0:46 move second child to first child (temp int) +0:46 p: direct index for structure (temp int) +0:46 indirect index (temp structure{temp float f, temp structure{temp 5-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1a, temp 6-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1b, temp 7-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1c} t2, temp 4-component vector of float v, temp int p}) +0:46 't3' (temp 10-element array of structure{temp float f, temp structure{temp 5-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1a, temp 6-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1b, temp 7-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1c} t2, temp 4-component vector of float v, temp int p}) +0:46 'i' (temp int) +0:46 Constant: +0:46 3 (const int) +0:46 add (temp int) +0:46 'i' (temp int) +0:46 Constant: +0:46 1 (const int) +0:47 Sequence +0:47 Sequence +0:47 move second child to first child (temp int) +0:47 'j' (temp int) +0:47 Constant: +0:47 0 (const int) +0:47 Loop with condition tested first +0:47 Loop Condition +0:47 Compare Less Than (temp bool) +0:47 'j' (temp int) +0:47 Constant: +0:47 5 (const int) +0:47 Loop Body +0:48 Sequence +0:48 Sequence +0:48 Sequence +0:48 move second child to first child (temp int) +0:48 'k' (temp int) +0:48 Constant: +0:48 0 (const int) +0:48 Loop with condition tested first +0:48 Loop Condition +0:48 Compare Less Than (temp bool) +0:48 'k' (temp int) +0:48 Constant: +0:48 3 (const int) +0:48 Loop Body +0:49 Sequence +0:49 move second child to first child (temp float) +0:49 indirect index (temp float) +0:49 t1_array: direct index for structure (temp 3-element array of float) +0:49 indirect index (temp structure{temp 3-element array of float t1_array, temp float t1_scalar}) +0:49 t1a: direct index for structure (temp 5-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar}) +0:49 t2: direct index for structure (temp structure{temp 5-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1a, temp 6-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1b, temp 7-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1c}) +0:49 indirect index (temp structure{temp float f, temp structure{temp 5-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1a, temp 6-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1b, temp 7-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1c} t2, temp 4-component vector of float v, temp int p}) +0:49 't3' (temp 10-element array of structure{temp float f, temp structure{temp 5-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1a, temp 6-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1b, temp 7-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1c} t2, temp 4-component vector of float v, temp int p}) +0:49 'i' (temp int) +0:49 Constant: +0:49 1 (const int) +0:49 Constant: +0:49 0 (const int) +0:49 'j' (temp int) +0:49 Constant: +0:49 0 (const int) +0:49 'k' (temp int) +0:49 Convert int to float (temp float) +0:49 add (temp int) +0:49 component-wise multiply (temp int) +0:49 'i' (temp int) +0:49 'j' (temp int) +0:49 'k' (temp int) +0:48 Loop Terminal Expression +0:48 Post-Increment (temp int) +0:48 'k' (temp int) +0:51 move second child to first child (temp float) +0:51 t1_scalar: direct index for structure (temp float) +0:51 indirect index (temp structure{temp 3-element array of float t1_array, temp float t1_scalar}) +0:51 t1a: direct index for structure (temp 5-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar}) +0:51 t2: direct index for structure (temp structure{temp 5-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1a, temp 6-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1b, temp 7-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1c}) +0:51 indirect index (temp structure{temp float f, temp structure{temp 5-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1a, temp 6-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1b, temp 7-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1c} t2, temp 4-component vector of float v, temp int p}) +0:51 't3' (temp 10-element array of structure{temp float f, temp structure{temp 5-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1a, temp 6-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1b, temp 7-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1c} t2, temp 4-component vector of float v, temp int p}) +0:51 'i' (temp int) +0:51 Constant: +0:51 1 (const int) +0:51 Constant: +0:51 0 (const int) +0:51 'j' (temp int) +0:51 Constant: +0:51 1 (const int) +0:51 divide (temp float) +0:51 component-wise multiply (temp float) +0:51 Convert int to float (temp float) +0:51 'j' (temp int) +0:51 Constant: +0:51 2.000000 +0:51 Convert int to float (temp float) +0:51 'i' (temp int) +0:47 Loop Terminal Expression +0:47 Post-Increment (temp int) +0:47 'j' (temp int) +0:54 Sequence +0:54 Sequence +0:54 move second child to first child (temp int) +0:54 'j' (noContraction temp int) +0:54 Constant: +0:54 0 (const int) +0:54 Loop with condition tested first +0:54 Loop Condition +0:54 Compare Less Than (temp bool) +0:54 'j' (temp int) +0:54 Constant: +0:54 6 (const int) +0:54 Loop Body +0:55 Sequence +0:55 Sequence +0:55 Sequence +0:55 move second child to first child (temp int) +0:55 'k' (temp int) +0:55 Constant: +0:55 0 (const int) +0:55 Loop with condition tested first +0:55 Loop Condition +0:55 Compare Less Than (temp bool) +0:55 'k' (temp int) +0:55 Constant: +0:55 3 (const int) +0:55 Loop Body +0:56 Sequence +0:56 move second child to first child (temp float) +0:56 indirect index (temp float) +0:56 t1_array: direct index for structure (temp 3-element array of float) +0:56 indirect index (temp structure{temp 3-element array of float t1_array, temp float t1_scalar}) +0:56 t1b: direct index for structure (temp 6-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar}) +0:56 t2: direct index for structure (temp structure{temp 5-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1a, temp 6-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1b, temp 7-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1c}) +0:56 indirect index (temp structure{temp float f, temp structure{temp 5-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1a, temp 6-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1b, temp 7-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1c} t2, temp 4-component vector of float v, temp int p}) +0:56 't3' (temp 10-element array of structure{temp float f, temp structure{temp 5-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1a, temp 6-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1b, temp 7-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1c} t2, temp 4-component vector of float v, temp int p}) +0:56 'i' (temp int) +0:56 Constant: +0:56 1 (const int) +0:56 Constant: +0:56 1 (const int) +0:56 'j' (temp int) +0:56 Constant: +0:56 0 (const int) +0:56 'k' (temp int) +0:56 Convert int to float (temp float) +0:56 add (temp int) +0:56 component-wise multiply (temp int) +0:56 'i' (temp int) +0:56 'j' (temp int) +0:56 'k' (temp int) +0:55 Loop Terminal Expression +0:55 Post-Increment (temp int) +0:55 'k' (temp int) +0:58 move second child to first child (temp float) +0:58 t1_scalar: direct index for structure (noContraction temp float) +0:58 indirect index (temp structure{temp 3-element array of float t1_array, temp float t1_scalar}) +0:58 t1b: direct index for structure (temp 6-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar}) +0:58 t2: direct index for structure (temp structure{temp 5-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1a, temp 6-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1b, temp 7-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1c}) +0:58 indirect index (temp structure{temp float f, temp structure{temp 5-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1a, temp 6-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1b, temp 7-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1c} t2, temp 4-component vector of float v, temp int p}) +0:58 't3' (temp 10-element array of structure{temp float f, temp structure{temp 5-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1a, temp 6-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1b, temp 7-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1c} t2, temp 4-component vector of float v, temp int p}) +0:58 'i' (temp int) +0:58 Constant: +0:58 1 (const int) +0:58 Constant: +0:58 1 (const int) +0:58 'j' (temp int) +0:58 Constant: +0:58 1 (const int) +0:58 divide (noContraction temp float) +0:58 component-wise multiply (noContraction temp float) +0:58 Convert int to float (temp float) +0:58 'j' (noContraction temp int) +0:58 Constant: +0:58 2.000000 +0:58 Convert int to float (temp float) +0:58 'i' (noContraction temp int) +0:54 Loop Terminal Expression +0:54 Post-Increment (noContraction temp int) +0:54 'j' (noContraction temp int) +0:61 Sequence +0:61 Sequence +0:61 move second child to first child (temp int) +0:61 'j' (noContraction temp int) +0:61 Constant: +0:61 0 (const int) +0:61 Loop with condition tested first +0:61 Loop Condition +0:61 Compare Less Than (temp bool) +0:61 'j' (temp int) +0:61 Constant: +0:61 6 (const int) +0:61 Loop Body +0:62 Sequence +0:62 Sequence +0:62 Sequence +0:62 move second child to first child (temp int) +0:62 'k' (noContraction temp int) +0:62 Constant: +0:62 0 (const int) +0:62 Loop with condition tested first +0:62 Loop Condition +0:62 Compare Less Than (temp bool) +0:62 'k' (temp int) +0:62 Constant: +0:62 3 (const int) +0:62 Loop Body +0:63 Sequence +0:63 move second child to first child (temp float) +0:63 indirect index (noContraction temp float) +0:63 t1_array: direct index for structure (noContraction temp 3-element array of float) +0:63 indirect index (temp structure{temp 3-element array of float t1_array, temp float t1_scalar}) +0:63 t1c: direct index for structure (temp 7-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar}) +0:63 t2: direct index for structure (temp structure{temp 5-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1a, temp 6-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1b, temp 7-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1c}) +0:63 indirect index (temp structure{temp float f, temp structure{temp 5-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1a, temp 6-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1b, temp 7-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1c} t2, temp 4-component vector of float v, temp int p}) +0:63 't3' (temp 10-element array of structure{temp float f, temp structure{temp 5-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1a, temp 6-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1b, temp 7-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1c} t2, temp 4-component vector of float v, temp int p}) +0:63 'i' (temp int) +0:63 Constant: +0:63 1 (const int) +0:63 Constant: +0:63 2 (const int) +0:63 'j' (temp int) +0:63 Constant: +0:63 0 (const int) +0:63 'k' (temp int) +0:63 Convert int to float (temp float) +0:63 add (temp int) +0:63 component-wise multiply (temp int) +0:63 'i' (noContraction temp int) +0:63 'j' (noContraction temp int) +0:63 'k' (noContraction temp int) +0:62 Loop Terminal Expression +0:62 Post-Increment (noContraction temp int) +0:62 'k' (noContraction temp int) +0:65 move second child to first child (temp float) +0:65 t1_scalar: direct index for structure (temp float) +0:65 indirect index (temp structure{temp 3-element array of float t1_array, temp float t1_scalar}) +0:65 t1c: direct index for structure (temp 7-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar}) +0:65 t2: direct index for structure (temp structure{temp 5-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1a, temp 6-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1b, temp 7-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1c}) +0:65 indirect index (temp structure{temp float f, temp structure{temp 5-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1a, temp 6-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1b, temp 7-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1c} t2, temp 4-component vector of float v, temp int p}) +0:65 't3' (temp 10-element array of structure{temp float f, temp structure{temp 5-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1a, temp 6-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1b, temp 7-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1c} t2, temp 4-component vector of float v, temp int p}) +0:65 'i' (temp int) +0:65 Constant: +0:65 1 (const int) +0:65 Constant: +0:65 2 (const int) +0:65 'j' (temp int) +0:65 Constant: +0:65 1 (const int) +0:65 divide (temp float) +0:65 component-wise multiply (temp float) +0:65 Convert int to float (temp float) +0:65 'j' (temp int) +0:65 Constant: +0:65 2.000000 +0:65 Convert int to float (temp float) +0:65 'i' (temp int) +0:61 Loop Terminal Expression +0:61 Post-Increment (noContraction temp int) +0:61 'j' (noContraction temp int) +0:43 Loop Terminal Expression +0:43 Post-Increment (noContraction temp int) +0:43 'i' (noContraction temp int) +0:68 Sequence +0:68 move second child to first child (temp int) +0:68 'i' (temp int) +0:68 Constant: +0:68 2 (const int) +0:69 move second child to first child (temp float) +0:69 'result' (noContraction temp float) +0:71 add (noContraction temp float) +0:70 add (noContraction temp float) +0:69 direct index (noContraction temp float) +0:69 t1_array: direct index for structure (temp 3-element array of float) +0:69 direct index (temp structure{temp 3-element array of float t1_array, temp float t1_scalar}) +0:69 t1c: direct index for structure (temp 7-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar}) +0:69 t2: direct index for structure (temp structure{temp 5-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1a, temp 6-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1b, temp 7-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1c}) +0:69 direct index (temp structure{temp float f, temp structure{temp 5-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1a, temp 6-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1b, temp 7-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1c} t2, temp 4-component vector of float v, temp int p}) +0:69 't3' (temp 10-element array of structure{temp float f, temp structure{temp 5-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1a, temp 6-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1b, temp 7-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1c} t2, temp 4-component vector of float v, temp int p}) +0:69 Constant: +0:69 5 (const int) +0:69 Constant: +0:69 1 (const int) +0:69 Constant: +0:69 2 (const int) +0:69 Constant: +0:69 6 (const int) +0:69 Constant: +0:69 0 (const int) +0:69 Constant: +0:69 1 (const int) +0:70 t1_scalar: direct index for structure (noContraction temp float) +0:70 direct index (temp structure{temp 3-element array of float t1_array, temp float t1_scalar}) +0:70 t1b: direct index for structure (temp 6-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar}) +0:70 t2: direct index for structure (temp structure{temp 5-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1a, temp 6-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1b, temp 7-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1c}) +0:70 direct index (temp structure{temp float f, temp structure{temp 5-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1a, temp 6-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1b, temp 7-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1c} t2, temp 4-component vector of float v, temp int p}) +0:70 't3' (temp 10-element array of structure{temp float f, temp structure{temp 5-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1a, temp 6-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1b, temp 7-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1c} t2, temp 4-component vector of float v, temp int p}) +0:70 Constant: +0:70 2 (const int) +0:70 Constant: +0:70 1 (const int) +0:70 Constant: +0:70 1 (const int) +0:70 Constant: +0:70 1 (const int) +0:70 Constant: +0:70 1 (const int) +0:71 direct index (noContraction temp float) +0:71 vector swizzle (temp 2-component vector of float) +0:71 v: direct index for structure (temp 4-component vector of float) +0:71 indirect index (temp structure{temp float f, temp structure{temp 5-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1a, temp 6-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1b, temp 7-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1c} t2, temp 4-component vector of float v, temp int p}) +0:71 't3' (temp 10-element array of structure{temp float f, temp structure{temp 5-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1a, temp 6-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1b, temp 7-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1c} t2, temp 4-component vector of float v, temp int p}) +0:71 subtract (temp int) +0:71 'i' (temp int) +0:71 Constant: +0:71 1 (const int) +0:71 Constant: +0:71 2 (const int) +0:71 Sequence +0:71 Constant: +0:71 0 (const int) +0:71 Constant: +0:71 1 (const int) +0:71 Constant: +0:71 0 (const int) +0:72 Branch: Return with expression +0:72 'result' (noContraction temp float) +0:75 Function Definition: out_block( (global float) +0:75 Function Parameters: +0:76 Sequence +0:76 Sequence +0:76 move second child to first child (temp float) +0:76 'a' (noContraction temp float) +0:76 Constant: +0:76 0.100000 +0:77 Sequence +0:77 move second child to first child (temp float) +0:77 'b' (noContraction temp float) +0:77 Constant: +0:77 0.200000 +0:78 move second child to first child (temp float) +0:78 f1: direct index for structure (noContraction global float) +0:78 s: direct index for structure (noContraction out structure{global float f1, global float f2}) +0:78 'partial_precise_block' (out block{noContraction out structure{global float f1, global float f2} s, out float x}) +0:78 Constant: +0:78 0 (const int) +0:78 Constant: +0:78 0 (const int) +0:78 add (noContraction temp float) +0:78 'a' (noContraction temp float) +0:78 'b' (noContraction temp float) +0:79 move second child to first child (temp float) +0:79 f2: direct index for structure (noContraction global float) +0:79 s: direct index for structure (noContraction out structure{global float f1, global float f2}) +0:79 'partial_precise_block' (out block{noContraction out structure{global float f1, global float f2} s, out float x}) +0:79 Constant: +0:79 0 (const int) +0:79 Constant: +0:79 1 (const int) +0:79 subtract (noContraction temp float) +0:79 'a' (noContraction temp float) +0:79 'b' (noContraction temp float) +0:80 move second child to first child (temp float) +0:80 x: direct index for structure (out float) +0:80 'partial_precise_block' (out block{noContraction out structure{global float f1, global float f2} s, out float x}) +0:80 Constant: +0:80 1 (const int) +0:80 component-wise multiply (temp float) +0:80 'a' (temp float) +0:80 'b' (temp float) +0:82 move second child to first child (temp float) +0:82 f1: direct index for structure (noContraction global float) +0:82 s: direct index for structure (noContraction out structure{global float f1, global float f2}) +0:82 'all_precise_block' (noContraction out block{out structure{global float f1, global float f2} s, out float x}) +0:82 Constant: +0:82 0 (const int) +0:82 Constant: +0:82 0 (const int) +0:82 add (noContraction temp float) +0:82 add (noContraction temp float) +0:82 'a' (noContraction temp float) +0:82 'b' (noContraction temp float) +0:82 Constant: +0:82 1.000000 +0:83 move second child to first child (temp float) +0:83 f2: direct index for structure (noContraction global float) +0:83 s: direct index for structure (noContraction out structure{global float f1, global float f2}) +0:83 'all_precise_block' (noContraction out block{out structure{global float f1, global float f2} s, out float x}) +0:83 Constant: +0:83 0 (const int) +0:83 Constant: +0:83 1 (const int) +0:83 subtract (noContraction temp float) +0:83 subtract (noContraction temp float) +0:83 'a' (noContraction temp float) +0:83 'b' (noContraction temp float) +0:83 Constant: +0:83 1.000000 +0:84 move second child to first child (temp float) +0:84 x: direct index for structure (noContraction out float) +0:84 'all_precise_block' (noContraction out block{out structure{global float f1, global float f2} s, out float x}) +0:84 Constant: +0:84 1 (const int) +0:84 component-wise multiply (noContraction temp float) +0:84 component-wise multiply (noContraction temp float) +0:84 'a' (noContraction temp float) +0:84 'b' (noContraction temp float) +0:84 Constant: +0:84 2.000000 +0:86 Branch: Return with expression +0:86 add (temp float) +0:86 'a' (temp float) +0:86 'b' (temp float) +0:89 Function Definition: main( (global void) +0:89 Function Parameters: +0:? Linker Objects +0:? 'partial_precise_block' (out block{noContraction out structure{global float f1, global float f2} s, out float x}) +0:? 'all_precise_block' (noContraction out block{out structure{global float f1, global float f2} s, out float x}) +0:? 'gl_VertexID' (gl_VertexId int VertexId) +0:? 'gl_InstanceID' (gl_InstanceId int InstanceId) + + +Linked vertex stage: + + +Shader version: 450 +0:? Sequence +0:11 Function Definition: struct_member( (global float) +0:11 Function Parameters: +0:12 Sequence +0:12 Sequence +0:12 move second child to first child (temp float) +0:12 'a' (noContraction temp float) +0:12 Constant: +0:12 1.000000 +0:13 Sequence +0:13 move second child to first child (temp float) +0:13 'b' (temp float) +0:13 Constant: +0:13 2.000000 +0:14 Sequence +0:14 move second child to first child (temp float) +0:14 'c' (temp float) +0:14 Constant: +0:14 3.000000 +0:15 Sequence +0:15 move second child to first child (temp float) +0:15 'd' (temp float) +0:15 Constant: +0:15 4.000000 +0:21 move second child to first child (temp float) +0:21 f1: direct index for structure (noContraction global float) +0:21 'S2' (temp structure{global float f1, global float f2}) +0:21 Constant: +0:21 0 (const int) +0:21 add (noContraction temp float) +0:21 'a' (noContraction temp float) +0:21 Constant: +0:21 0.200000 +0:22 move second child to first child (temp float) +0:22 f2: direct index for structure (global float) +0:22 'S2' (temp structure{global float f1, global float f2}) +0:22 Constant: +0:22 1 (const int) +0:22 add (temp float) +0:22 'b' (temp float) +0:22 Constant: +0:22 0.200000 +0:23 move second child to first child (temp float) +0:23 f1: direct index for structure (global float) +0:23 'S3' (temp structure{global float f1, global float f2}) +0:23 Constant: +0:23 0 (const int) +0:23 add (temp float) +0:23 'a' (temp float) +0:23 'b' (temp float) +0:24 move second child to first child (temp structure{global float f1, global float f2}) +0:24 'S' (temp structure{global float f1, global float f2}) +0:24 'S2' (temp structure{global float f1, global float f2}) +0:25 move second child to first child (temp float) +0:25 'result' (noContraction temp float) +0:25 add (noContraction temp float) +0:25 f1: direct index for structure (noContraction global float) +0:25 'S' (temp structure{global float f1, global float f2}) +0:25 Constant: +0:25 0 (const int) +0:25 Constant: +0:25 0.100000 +0:27 Branch: Return with expression +0:27 'result' (noContraction temp float) +0:30 Function Definition: complex_array_struct( (global float) +0:30 Function Parameters: +0:? Sequence +0:43 Sequence +0:43 Sequence +0:43 move second child to first child (temp int) +0:43 'i' (noContraction temp int) +0:43 Constant: +0:43 0 (const int) +0:43 Loop with condition tested first +0:43 Loop Condition +0:43 Compare Less Than (temp bool) +0:43 'i' (temp int) +0:43 Constant: +0:43 10 (const int) +0:43 Loop Body +0:44 Sequence +0:44 move second child to first child (temp float) +0:44 f: direct index for structure (temp float) +0:44 indirect index (temp structure{temp float f, temp structure{temp 5-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1a, temp 6-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1b, temp 7-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1c} t2, temp 4-component vector of float v, temp int p}) +0:44 't3' (temp 10-element array of structure{temp float f, temp structure{temp 5-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1a, temp 6-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1b, temp 7-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1c} t2, temp 4-component vector of float v, temp int p}) +0:44 'i' (temp int) +0:44 Constant: +0:44 0 (const int) +0:44 divide (temp float) +0:44 Convert int to float (temp float) +0:44 'i' (temp int) +0:44 Constant: +0:44 3.000000 +0:45 move second child to first child (temp 4-component vector of float) +0:45 v: direct index for structure (noContraction temp 4-component vector of float) +0:45 indirect index (temp structure{temp float f, temp structure{temp 5-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1a, temp 6-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1b, temp 7-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1c} t2, temp 4-component vector of float v, temp int p}) +0:45 't3' (temp 10-element array of structure{temp float f, temp structure{temp 5-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1a, temp 6-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1b, temp 7-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1c} t2, temp 4-component vector of float v, temp int p}) +0:45 'i' (temp int) +0:45 Constant: +0:45 2 (const int) +0:45 Construct vec4 (temp 4-component vector of float) +0:45 component-wise multiply (noContraction temp float) +0:45 Convert int to float (temp float) +0:45 'i' (noContraction temp int) +0:45 Constant: +0:45 1.500000 +0:46 move second child to first child (temp int) +0:46 p: direct index for structure (temp int) +0:46 indirect index (temp structure{temp float f, temp structure{temp 5-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1a, temp 6-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1b, temp 7-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1c} t2, temp 4-component vector of float v, temp int p}) +0:46 't3' (temp 10-element array of structure{temp float f, temp structure{temp 5-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1a, temp 6-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1b, temp 7-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1c} t2, temp 4-component vector of float v, temp int p}) +0:46 'i' (temp int) +0:46 Constant: +0:46 3 (const int) +0:46 add (temp int) +0:46 'i' (temp int) +0:46 Constant: +0:46 1 (const int) +0:47 Sequence +0:47 Sequence +0:47 move second child to first child (temp int) +0:47 'j' (temp int) +0:47 Constant: +0:47 0 (const int) +0:47 Loop with condition tested first +0:47 Loop Condition +0:47 Compare Less Than (temp bool) +0:47 'j' (temp int) +0:47 Constant: +0:47 5 (const int) +0:47 Loop Body +0:48 Sequence +0:48 Sequence +0:48 Sequence +0:48 move second child to first child (temp int) +0:48 'k' (temp int) +0:48 Constant: +0:48 0 (const int) +0:48 Loop with condition tested first +0:48 Loop Condition +0:48 Compare Less Than (temp bool) +0:48 'k' (temp int) +0:48 Constant: +0:48 3 (const int) +0:48 Loop Body +0:49 Sequence +0:49 move second child to first child (temp float) +0:49 indirect index (temp float) +0:49 t1_array: direct index for structure (temp 3-element array of float) +0:49 indirect index (temp structure{temp 3-element array of float t1_array, temp float t1_scalar}) +0:49 t1a: direct index for structure (temp 5-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar}) +0:49 t2: direct index for structure (temp structure{temp 5-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1a, temp 6-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1b, temp 7-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1c}) +0:49 indirect index (temp structure{temp float f, temp structure{temp 5-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1a, temp 6-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1b, temp 7-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1c} t2, temp 4-component vector of float v, temp int p}) +0:49 't3' (temp 10-element array of structure{temp float f, temp structure{temp 5-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1a, temp 6-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1b, temp 7-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1c} t2, temp 4-component vector of float v, temp int p}) +0:49 'i' (temp int) +0:49 Constant: +0:49 1 (const int) +0:49 Constant: +0:49 0 (const int) +0:49 'j' (temp int) +0:49 Constant: +0:49 0 (const int) +0:49 'k' (temp int) +0:49 Convert int to float (temp float) +0:49 add (temp int) +0:49 component-wise multiply (temp int) +0:49 'i' (temp int) +0:49 'j' (temp int) +0:49 'k' (temp int) +0:48 Loop Terminal Expression +0:48 Post-Increment (temp int) +0:48 'k' (temp int) +0:51 move second child to first child (temp float) +0:51 t1_scalar: direct index for structure (temp float) +0:51 indirect index (temp structure{temp 3-element array of float t1_array, temp float t1_scalar}) +0:51 t1a: direct index for structure (temp 5-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar}) +0:51 t2: direct index for structure (temp structure{temp 5-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1a, temp 6-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1b, temp 7-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1c}) +0:51 indirect index (temp structure{temp float f, temp structure{temp 5-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1a, temp 6-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1b, temp 7-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1c} t2, temp 4-component vector of float v, temp int p}) +0:51 't3' (temp 10-element array of structure{temp float f, temp structure{temp 5-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1a, temp 6-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1b, temp 7-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1c} t2, temp 4-component vector of float v, temp int p}) +0:51 'i' (temp int) +0:51 Constant: +0:51 1 (const int) +0:51 Constant: +0:51 0 (const int) +0:51 'j' (temp int) +0:51 Constant: +0:51 1 (const int) +0:51 divide (temp float) +0:51 component-wise multiply (temp float) +0:51 Convert int to float (temp float) +0:51 'j' (temp int) +0:51 Constant: +0:51 2.000000 +0:51 Convert int to float (temp float) +0:51 'i' (temp int) +0:47 Loop Terminal Expression +0:47 Post-Increment (temp int) +0:47 'j' (temp int) +0:54 Sequence +0:54 Sequence +0:54 move second child to first child (temp int) +0:54 'j' (noContraction temp int) +0:54 Constant: +0:54 0 (const int) +0:54 Loop with condition tested first +0:54 Loop Condition +0:54 Compare Less Than (temp bool) +0:54 'j' (temp int) +0:54 Constant: +0:54 6 (const int) +0:54 Loop Body +0:55 Sequence +0:55 Sequence +0:55 Sequence +0:55 move second child to first child (temp int) +0:55 'k' (temp int) +0:55 Constant: +0:55 0 (const int) +0:55 Loop with condition tested first +0:55 Loop Condition +0:55 Compare Less Than (temp bool) +0:55 'k' (temp int) +0:55 Constant: +0:55 3 (const int) +0:55 Loop Body +0:56 Sequence +0:56 move second child to first child (temp float) +0:56 indirect index (temp float) +0:56 t1_array: direct index for structure (temp 3-element array of float) +0:56 indirect index (temp structure{temp 3-element array of float t1_array, temp float t1_scalar}) +0:56 t1b: direct index for structure (temp 6-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar}) +0:56 t2: direct index for structure (temp structure{temp 5-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1a, temp 6-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1b, temp 7-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1c}) +0:56 indirect index (temp structure{temp float f, temp structure{temp 5-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1a, temp 6-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1b, temp 7-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1c} t2, temp 4-component vector of float v, temp int p}) +0:56 't3' (temp 10-element array of structure{temp float f, temp structure{temp 5-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1a, temp 6-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1b, temp 7-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1c} t2, temp 4-component vector of float v, temp int p}) +0:56 'i' (temp int) +0:56 Constant: +0:56 1 (const int) +0:56 Constant: +0:56 1 (const int) +0:56 'j' (temp int) +0:56 Constant: +0:56 0 (const int) +0:56 'k' (temp int) +0:56 Convert int to float (temp float) +0:56 add (temp int) +0:56 component-wise multiply (temp int) +0:56 'i' (temp int) +0:56 'j' (temp int) +0:56 'k' (temp int) +0:55 Loop Terminal Expression +0:55 Post-Increment (temp int) +0:55 'k' (temp int) +0:58 move second child to first child (temp float) +0:58 t1_scalar: direct index for structure (noContraction temp float) +0:58 indirect index (temp structure{temp 3-element array of float t1_array, temp float t1_scalar}) +0:58 t1b: direct index for structure (temp 6-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar}) +0:58 t2: direct index for structure (temp structure{temp 5-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1a, temp 6-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1b, temp 7-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1c}) +0:58 indirect index (temp structure{temp float f, temp structure{temp 5-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1a, temp 6-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1b, temp 7-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1c} t2, temp 4-component vector of float v, temp int p}) +0:58 't3' (temp 10-element array of structure{temp float f, temp structure{temp 5-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1a, temp 6-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1b, temp 7-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1c} t2, temp 4-component vector of float v, temp int p}) +0:58 'i' (temp int) +0:58 Constant: +0:58 1 (const int) +0:58 Constant: +0:58 1 (const int) +0:58 'j' (temp int) +0:58 Constant: +0:58 1 (const int) +0:58 divide (noContraction temp float) +0:58 component-wise multiply (noContraction temp float) +0:58 Convert int to float (temp float) +0:58 'j' (noContraction temp int) +0:58 Constant: +0:58 2.000000 +0:58 Convert int to float (temp float) +0:58 'i' (noContraction temp int) +0:54 Loop Terminal Expression +0:54 Post-Increment (noContraction temp int) +0:54 'j' (noContraction temp int) +0:61 Sequence +0:61 Sequence +0:61 move second child to first child (temp int) +0:61 'j' (noContraction temp int) +0:61 Constant: +0:61 0 (const int) +0:61 Loop with condition tested first +0:61 Loop Condition +0:61 Compare Less Than (temp bool) +0:61 'j' (temp int) +0:61 Constant: +0:61 6 (const int) +0:61 Loop Body +0:62 Sequence +0:62 Sequence +0:62 Sequence +0:62 move second child to first child (temp int) +0:62 'k' (noContraction temp int) +0:62 Constant: +0:62 0 (const int) +0:62 Loop with condition tested first +0:62 Loop Condition +0:62 Compare Less Than (temp bool) +0:62 'k' (temp int) +0:62 Constant: +0:62 3 (const int) +0:62 Loop Body +0:63 Sequence +0:63 move second child to first child (temp float) +0:63 indirect index (noContraction temp float) +0:63 t1_array: direct index for structure (noContraction temp 3-element array of float) +0:63 indirect index (temp structure{temp 3-element array of float t1_array, temp float t1_scalar}) +0:63 t1c: direct index for structure (temp 7-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar}) +0:63 t2: direct index for structure (temp structure{temp 5-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1a, temp 6-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1b, temp 7-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1c}) +0:63 indirect index (temp structure{temp float f, temp structure{temp 5-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1a, temp 6-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1b, temp 7-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1c} t2, temp 4-component vector of float v, temp int p}) +0:63 't3' (temp 10-element array of structure{temp float f, temp structure{temp 5-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1a, temp 6-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1b, temp 7-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1c} t2, temp 4-component vector of float v, temp int p}) +0:63 'i' (temp int) +0:63 Constant: +0:63 1 (const int) +0:63 Constant: +0:63 2 (const int) +0:63 'j' (temp int) +0:63 Constant: +0:63 0 (const int) +0:63 'k' (temp int) +0:63 Convert int to float (temp float) +0:63 add (temp int) +0:63 component-wise multiply (temp int) +0:63 'i' (noContraction temp int) +0:63 'j' (noContraction temp int) +0:63 'k' (noContraction temp int) +0:62 Loop Terminal Expression +0:62 Post-Increment (noContraction temp int) +0:62 'k' (noContraction temp int) +0:65 move second child to first child (temp float) +0:65 t1_scalar: direct index for structure (temp float) +0:65 indirect index (temp structure{temp 3-element array of float t1_array, temp float t1_scalar}) +0:65 t1c: direct index for structure (temp 7-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar}) +0:65 t2: direct index for structure (temp structure{temp 5-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1a, temp 6-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1b, temp 7-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1c}) +0:65 indirect index (temp structure{temp float f, temp structure{temp 5-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1a, temp 6-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1b, temp 7-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1c} t2, temp 4-component vector of float v, temp int p}) +0:65 't3' (temp 10-element array of structure{temp float f, temp structure{temp 5-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1a, temp 6-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1b, temp 7-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1c} t2, temp 4-component vector of float v, temp int p}) +0:65 'i' (temp int) +0:65 Constant: +0:65 1 (const int) +0:65 Constant: +0:65 2 (const int) +0:65 'j' (temp int) +0:65 Constant: +0:65 1 (const int) +0:65 divide (temp float) +0:65 component-wise multiply (temp float) +0:65 Convert int to float (temp float) +0:65 'j' (temp int) +0:65 Constant: +0:65 2.000000 +0:65 Convert int to float (temp float) +0:65 'i' (temp int) +0:61 Loop Terminal Expression +0:61 Post-Increment (noContraction temp int) +0:61 'j' (noContraction temp int) +0:43 Loop Terminal Expression +0:43 Post-Increment (noContraction temp int) +0:43 'i' (noContraction temp int) +0:68 Sequence +0:68 move second child to first child (temp int) +0:68 'i' (temp int) +0:68 Constant: +0:68 2 (const int) +0:69 move second child to first child (temp float) +0:69 'result' (noContraction temp float) +0:71 add (noContraction temp float) +0:70 add (noContraction temp float) +0:69 direct index (noContraction temp float) +0:69 t1_array: direct index for structure (temp 3-element array of float) +0:69 direct index (temp structure{temp 3-element array of float t1_array, temp float t1_scalar}) +0:69 t1c: direct index for structure (temp 7-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar}) +0:69 t2: direct index for structure (temp structure{temp 5-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1a, temp 6-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1b, temp 7-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1c}) +0:69 direct index (temp structure{temp float f, temp structure{temp 5-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1a, temp 6-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1b, temp 7-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1c} t2, temp 4-component vector of float v, temp int p}) +0:69 't3' (temp 10-element array of structure{temp float f, temp structure{temp 5-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1a, temp 6-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1b, temp 7-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1c} t2, temp 4-component vector of float v, temp int p}) +0:69 Constant: +0:69 5 (const int) +0:69 Constant: +0:69 1 (const int) +0:69 Constant: +0:69 2 (const int) +0:69 Constant: +0:69 6 (const int) +0:69 Constant: +0:69 0 (const int) +0:69 Constant: +0:69 1 (const int) +0:70 t1_scalar: direct index for structure (noContraction temp float) +0:70 direct index (temp structure{temp 3-element array of float t1_array, temp float t1_scalar}) +0:70 t1b: direct index for structure (temp 6-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar}) +0:70 t2: direct index for structure (temp structure{temp 5-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1a, temp 6-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1b, temp 7-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1c}) +0:70 direct index (temp structure{temp float f, temp structure{temp 5-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1a, temp 6-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1b, temp 7-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1c} t2, temp 4-component vector of float v, temp int p}) +0:70 't3' (temp 10-element array of structure{temp float f, temp structure{temp 5-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1a, temp 6-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1b, temp 7-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1c} t2, temp 4-component vector of float v, temp int p}) +0:70 Constant: +0:70 2 (const int) +0:70 Constant: +0:70 1 (const int) +0:70 Constant: +0:70 1 (const int) +0:70 Constant: +0:70 1 (const int) +0:70 Constant: +0:70 1 (const int) +0:71 direct index (noContraction temp float) +0:71 vector swizzle (temp 2-component vector of float) +0:71 v: direct index for structure (temp 4-component vector of float) +0:71 indirect index (temp structure{temp float f, temp structure{temp 5-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1a, temp 6-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1b, temp 7-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1c} t2, temp 4-component vector of float v, temp int p}) +0:71 't3' (temp 10-element array of structure{temp float f, temp structure{temp 5-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1a, temp 6-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1b, temp 7-element array of structure{temp 3-element array of float t1_array, temp float t1_scalar} t1c} t2, temp 4-component vector of float v, temp int p}) +0:71 subtract (temp int) +0:71 'i' (temp int) +0:71 Constant: +0:71 1 (const int) +0:71 Constant: +0:71 2 (const int) +0:71 Sequence +0:71 Constant: +0:71 0 (const int) +0:71 Constant: +0:71 1 (const int) +0:71 Constant: +0:71 0 (const int) +0:72 Branch: Return with expression +0:72 'result' (noContraction temp float) +0:75 Function Definition: out_block( (global float) +0:75 Function Parameters: +0:76 Sequence +0:76 Sequence +0:76 move second child to first child (temp float) +0:76 'a' (noContraction temp float) +0:76 Constant: +0:76 0.100000 +0:77 Sequence +0:77 move second child to first child (temp float) +0:77 'b' (noContraction temp float) +0:77 Constant: +0:77 0.200000 +0:78 move second child to first child (temp float) +0:78 f1: direct index for structure (noContraction global float) +0:78 s: direct index for structure (noContraction out structure{global float f1, global float f2}) +0:78 'partial_precise_block' (out block{noContraction out structure{global float f1, global float f2} s, out float x}) +0:78 Constant: +0:78 0 (const int) +0:78 Constant: +0:78 0 (const int) +0:78 add (noContraction temp float) +0:78 'a' (noContraction temp float) +0:78 'b' (noContraction temp float) +0:79 move second child to first child (temp float) +0:79 f2: direct index for structure (noContraction global float) +0:79 s: direct index for structure (noContraction out structure{global float f1, global float f2}) +0:79 'partial_precise_block' (out block{noContraction out structure{global float f1, global float f2} s, out float x}) +0:79 Constant: +0:79 0 (const int) +0:79 Constant: +0:79 1 (const int) +0:79 subtract (noContraction temp float) +0:79 'a' (noContraction temp float) +0:79 'b' (noContraction temp float) +0:80 move second child to first child (temp float) +0:80 x: direct index for structure (out float) +0:80 'partial_precise_block' (out block{noContraction out structure{global float f1, global float f2} s, out float x}) +0:80 Constant: +0:80 1 (const int) +0:80 component-wise multiply (temp float) +0:80 'a' (temp float) +0:80 'b' (temp float) +0:82 move second child to first child (temp float) +0:82 f1: direct index for structure (noContraction global float) +0:82 s: direct index for structure (noContraction out structure{global float f1, global float f2}) +0:82 'all_precise_block' (noContraction out block{out structure{global float f1, global float f2} s, out float x}) +0:82 Constant: +0:82 0 (const int) +0:82 Constant: +0:82 0 (const int) +0:82 add (noContraction temp float) +0:82 add (noContraction temp float) +0:82 'a' (noContraction temp float) +0:82 'b' (noContraction temp float) +0:82 Constant: +0:82 1.000000 +0:83 move second child to first child (temp float) +0:83 f2: direct index for structure (noContraction global float) +0:83 s: direct index for structure (noContraction out structure{global float f1, global float f2}) +0:83 'all_precise_block' (noContraction out block{out structure{global float f1, global float f2} s, out float x}) +0:83 Constant: +0:83 0 (const int) +0:83 Constant: +0:83 1 (const int) +0:83 subtract (noContraction temp float) +0:83 subtract (noContraction temp float) +0:83 'a' (noContraction temp float) +0:83 'b' (noContraction temp float) +0:83 Constant: +0:83 1.000000 +0:84 move second child to first child (temp float) +0:84 x: direct index for structure (noContraction out float) +0:84 'all_precise_block' (noContraction out block{out structure{global float f1, global float f2} s, out float x}) +0:84 Constant: +0:84 1 (const int) +0:84 component-wise multiply (noContraction temp float) +0:84 component-wise multiply (noContraction temp float) +0:84 'a' (noContraction temp float) +0:84 'b' (noContraction temp float) +0:84 Constant: +0:84 2.000000 +0:86 Branch: Return with expression +0:86 add (temp float) +0:86 'a' (temp float) +0:86 'b' (temp float) +0:89 Function Definition: main( (global void) +0:89 Function Parameters: +0:? Linker Objects +0:? 'partial_precise_block' (out block{noContraction out structure{global float f1, global float f2} s, out float x}) +0:? 'all_precise_block' (noContraction out block{out structure{global float f1, global float f2} s, out float x}) +0:? 'gl_VertexID' (gl_VertexId int VertexId) +0:? 'gl_InstanceID' (gl_InstanceId int InstanceId) + diff --git a/Test/baseResults/precision.vert.out b/Test/baseResults/precision.vert.out index 69b0e962..f433ba52 100644 --- a/Test/baseResults/precision.vert.out +++ b/Test/baseResults/precision.vert.out @@ -13,7 +13,7 @@ ERROR: node is still EOpNull! 0:20 Sequence 0:20 move second child to first child (temp highp 4-component vector of float) 0:20 't' (temp highp 4-component vector of float) -0:20 texture (global highp 4-component vector of float) +0:20 texture (global lowp 4-component vector of float) 0:20 's2D' (uniform lowp sampler2D) 0:20 Constant: 0:20 0.100000 @@ -27,7 +27,7 @@ ERROR: node is still EOpNull! 0:21 0.200000 0:22 add second child into first child (temp highp 4-component vector of float) 0:22 't' (temp highp 4-component vector of float) -0:22 texture (global highp float) +0:22 texture (global mediump float) 0:22 's2dAS' (uniform mediump sampler2DArrayShadow) 0:22 Constant: 0:22 0.500000 @@ -61,7 +61,7 @@ ERROR: node is still EOpNull! 0:20 Sequence 0:20 move second child to first child (temp highp 4-component vector of float) 0:20 't' (temp highp 4-component vector of float) -0:20 texture (global highp 4-component vector of float) +0:20 texture (global lowp 4-component vector of float) 0:20 's2D' (uniform lowp sampler2D) 0:20 Constant: 0:20 0.100000 @@ -75,7 +75,7 @@ ERROR: node is still EOpNull! 0:21 0.200000 0:22 add second child into first child (temp highp 4-component vector of float) 0:22 't' (temp highp 4-component vector of float) -0:22 texture (global highp float) +0:22 texture (global mediump float) 0:22 's2dAS' (uniform mediump sampler2DArrayShadow) 0:22 Constant: 0:22 0.500000 diff --git a/Test/baseResults/preprocessor.eof_missing.vert.err b/Test/baseResults/preprocessor.eof_missing.vert.err new file mode 100644 index 00000000..e69de29b diff --git a/Test/baseResults/preprocessor.eof_missing.vert.out b/Test/baseResults/preprocessor.eof_missing.vert.out new file mode 100644 index 00000000..bf09d53e --- /dev/null +++ b/Test/baseResults/preprocessor.eof_missing.vert.out @@ -0,0 +1,2 @@ +noEOF + diff --git a/Test/baseResults/reflection.vert.out b/Test/baseResults/reflection.vert.out index 43fb2340..24ee7809 100644 --- a/Test/baseResults/reflection.vert.out +++ b/Test/baseResults/reflection.vert.out @@ -95,3 +95,10 @@ abl2[1]: offset -1, type ffffffff, size 4, index -1 abl2[2]: offset -1, type ffffffff, size 4, index -1 abl2[3]: offset -1, type ffffffff, size 4, index -1 +Vertex attribute reflection: +attributeFloat: offset 0, type 1406, size 0, index 0 +attributeFloat2: offset 0, type 8b50, size 0, index 0 +attributeFloat3: offset 0, type 8b51, size 0, index 0 +attributeFloat4: offset 0, type 8b52, size 0, index 0 +attributeMat4: offset 0, type 8b5c, size 0, index 0 + diff --git a/Test/baseResults/specExamples.vert.out b/Test/baseResults/specExamples.vert.out index eb399e1b..7a880331 100644 --- a/Test/baseResults/specExamples.vert.out +++ b/Test/baseResults/specExamples.vert.out @@ -28,7 +28,6 @@ ERROR: 0:97: 'binding' : atomic_uint binding is too large; see gl_MaxAtomicCount ERROR: 0:106: '' : vertex input cannot be further qualified ERROR: 0:106: 'redeclaration' : cannot change storage, memory, or auxiliary qualification of gl_FrontColor ERROR: 0:112: 'ColorIvn' : identifier not previously declared -WARNING: 0:118: '' : unknown requalification ERROR: 0:132: 'shared' : not supported in this stage: vertex ERROR: 0:134: '' : function does not return a value: funcA ERROR: 0:136: '' : function does not return a value: funcB @@ -70,7 +69,7 @@ ERROR: node is still EOpNull! 0:148 Sequence 0:148 Sequence 0:148 move second child to first child (temp float) -0:148 'result' (temp float) +0:148 'result' (noContraction temp float) 0:148 add (temp float) 0:148 component-wise multiply (temp float) 0:148 'e' (in float) @@ -79,15 +78,15 @@ ERROR: node is still EOpNull! 0:148 'g' (in float) 0:148 'h' (in float) 0:150 Branch: Return with expression -0:150 'result' (temp float) +0:150 'result' (noContraction temp float) 0:153 Function Definition: func3(f1;f1;f1; (global float) 0:153 Function Parameters: 0:153 'i' (in float) 0:153 'j' (in float) -0:153 'k' (out float) +0:153 'k' (noContraction out float) 0:155 Sequence 0:155 move second child to first child (temp float) -0:155 'k' (out float) +0:155 'k' (noContraction out float) 0:155 add (temp float) 0:155 component-wise multiply (temp float) 0:155 'i' (in float) @@ -111,8 +110,8 @@ ERROR: node is still EOpNull! 0:161 'c' (in 4-component vector of float) 0:161 'd' (in 4-component vector of float) 0:162 move second child to first child (temp 3-component vector of float) -0:162 vector swizzle (temp 3-component vector of float) -0:162 'v' (smooth out 4-component vector of float) +0:162 vector swizzle (noContraction temp 3-component vector of float) +0:162 'v' (noContraction smooth out 4-component vector of float) 0:162 Sequence 0:162 Constant: 0:162 0 (const int) @@ -124,8 +123,8 @@ ERROR: node is still EOpNull! 0:162 'r' (temp 3-component vector of float) 0:162 's' (temp 3-component vector of float) 0:163 move second child to first child (temp float) -0:163 direct index (temp float) -0:163 'v' (smooth out 4-component vector of float) +0:163 direct index (noContraction temp float) +0:163 'v' (noContraction smooth out 4-component vector of float) 0:163 Constant: 0:163 3 (const int) 0:163 add (temp float) @@ -148,8 +147,8 @@ ERROR: node is still EOpNull! 0:163 Constant: 0:163 3 (const int) 0:164 move second child to first child (temp float) -0:164 direct index (temp float) -0:164 'v' (smooth out 4-component vector of float) +0:164 direct index (noContraction temp float) +0:164 'v' (noContraction smooth out 4-component vector of float) 0:164 Constant: 0:164 0 (const int) 0:164 Function Call: func(f1;f1;f1;f1; (global float) @@ -170,8 +169,8 @@ ERROR: node is still EOpNull! 0:164 Constant: 0:164 0 (const int) 0:166 move second child to first child (temp float) -0:166 direct index (temp float) -0:166 'v' (smooth out 4-component vector of float) +0:166 direct index (noContraction temp float) +0:166 'v' (noContraction smooth out 4-component vector of float) 0:166 Constant: 0:166 0 (const int) 0:166 Function Call: func2(f1;f1;f1;f1; (global float) @@ -210,8 +209,8 @@ ERROR: node is still EOpNull! 0:167 'd' (in 4-component vector of float) 0:167 Constant: 0:167 0 (const int) -0:167 direct index (temp float) -0:167 'v' (smooth out 4-component vector of float) +0:167 direct index (noContraction temp float) +0:167 'v' (noContraction smooth out 4-component vector of float) 0:167 Constant: 0:167 0 (const int) 0:169 Function Call: funcA(I21; (global 4-component vector of float) @@ -302,13 +301,13 @@ ERROR: node is still EOpNull! 0:? 'anon@5' (out block{invariant gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out implicitly-sized array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, flat out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out implicitly-sized array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord}) 0:? 'ColorInv' (smooth out 3-component vector of float) 0:? 'Color4' (invariant centroid smooth out 3-component vector of float) -0:? 'position' (smooth out 4-component vector of float) +0:? 'position' (noContraction smooth out 4-component vector of float) 0:? 'Color5' (smooth out 3-component vector of float) 0:? 'a' (in 4-component vector of float) 0:? 'b' (in 4-component vector of float) 0:? 'c' (in 4-component vector of float) 0:? 'd' (in 4-component vector of float) -0:? 'v' (smooth out 4-component vector of float) +0:? 'v' (noContraction smooth out 4-component vector of float) 0:? 'anon@6' (layout(column_major shared ) coherent buffer block{layout(column_major shared ) readonly buffer 4-component vector of float member1, layout(column_major shared ) buffer 4-component vector of float member2}) 0:? 'anon@7' (layout(column_major shared ) buffer block{layout(column_major shared ) coherent readonly buffer 4-component vector of float member1A, layout(column_major shared ) coherent buffer 4-component vector of float member2A}) 0:? 'shv' (shared 4-component vector of float) @@ -354,7 +353,7 @@ ERROR: node is still EOpNull! 0:148 Sequence 0:148 Sequence 0:148 move second child to first child (temp float) -0:148 'result' (temp float) +0:148 'result' (noContraction temp float) 0:148 add (temp float) 0:148 component-wise multiply (temp float) 0:148 'e' (in float) @@ -363,15 +362,15 @@ ERROR: node is still EOpNull! 0:148 'g' (in float) 0:148 'h' (in float) 0:150 Branch: Return with expression -0:150 'result' (temp float) +0:150 'result' (noContraction temp float) 0:153 Function Definition: func3(f1;f1;f1; (global float) 0:153 Function Parameters: 0:153 'i' (in float) 0:153 'j' (in float) -0:153 'k' (out float) +0:153 'k' (noContraction out float) 0:155 Sequence 0:155 move second child to first child (temp float) -0:155 'k' (out float) +0:155 'k' (noContraction out float) 0:155 add (temp float) 0:155 component-wise multiply (temp float) 0:155 'i' (in float) @@ -395,8 +394,8 @@ ERROR: node is still EOpNull! 0:161 'c' (in 4-component vector of float) 0:161 'd' (in 4-component vector of float) 0:162 move second child to first child (temp 3-component vector of float) -0:162 vector swizzle (temp 3-component vector of float) -0:162 'v' (smooth out 4-component vector of float) +0:162 vector swizzle (noContraction temp 3-component vector of float) +0:162 'v' (noContraction smooth out 4-component vector of float) 0:162 Sequence 0:162 Constant: 0:162 0 (const int) @@ -408,8 +407,8 @@ ERROR: node is still EOpNull! 0:162 'r' (temp 3-component vector of float) 0:162 's' (temp 3-component vector of float) 0:163 move second child to first child (temp float) -0:163 direct index (temp float) -0:163 'v' (smooth out 4-component vector of float) +0:163 direct index (noContraction temp float) +0:163 'v' (noContraction smooth out 4-component vector of float) 0:163 Constant: 0:163 3 (const int) 0:163 add (temp float) @@ -432,8 +431,8 @@ ERROR: node is still EOpNull! 0:163 Constant: 0:163 3 (const int) 0:164 move second child to first child (temp float) -0:164 direct index (temp float) -0:164 'v' (smooth out 4-component vector of float) +0:164 direct index (noContraction temp float) +0:164 'v' (noContraction smooth out 4-component vector of float) 0:164 Constant: 0:164 0 (const int) 0:164 Function Call: func(f1;f1;f1;f1; (global float) @@ -454,8 +453,8 @@ ERROR: node is still EOpNull! 0:164 Constant: 0:164 0 (const int) 0:166 move second child to first child (temp float) -0:166 direct index (temp float) -0:166 'v' (smooth out 4-component vector of float) +0:166 direct index (noContraction temp float) +0:166 'v' (noContraction smooth out 4-component vector of float) 0:166 Constant: 0:166 0 (const int) 0:166 Function Call: func2(f1;f1;f1;f1; (global float) @@ -494,8 +493,8 @@ ERROR: node is still EOpNull! 0:167 'd' (in 4-component vector of float) 0:167 Constant: 0:167 0 (const int) -0:167 direct index (temp float) -0:167 'v' (smooth out 4-component vector of float) +0:167 direct index (noContraction temp float) +0:167 'v' (noContraction smooth out 4-component vector of float) 0:167 Constant: 0:167 0 (const int) 0:169 Function Call: funcA(I21; (global 4-component vector of float) @@ -586,13 +585,13 @@ ERROR: node is still EOpNull! 0:? 'anon@5' (out block{invariant gl_Position 4-component vector of float Position gl_Position, gl_PointSize float PointSize gl_PointSize, out 1-element array of float ClipDistance gl_ClipDistance, gl_ClipVertex 4-component vector of float ClipVertex gl_ClipVertex, flat out 4-component vector of float FrontColor gl_FrontColor, out 4-component vector of float BackColor gl_BackColor, out 4-component vector of float FrontSecondaryColor gl_FrontSecondaryColor, out 4-component vector of float BackSecondaryColor gl_BackSecondaryColor, out 1-element array of 4-component vector of float TexCoord gl_TexCoord, out float FogFragCoord gl_FogFragCoord}) 0:? 'ColorInv' (smooth out 3-component vector of float) 0:? 'Color4' (invariant centroid smooth out 3-component vector of float) -0:? 'position' (smooth out 4-component vector of float) +0:? 'position' (noContraction smooth out 4-component vector of float) 0:? 'Color5' (smooth out 3-component vector of float) 0:? 'a' (in 4-component vector of float) 0:? 'b' (in 4-component vector of float) 0:? 'c' (in 4-component vector of float) 0:? 'd' (in 4-component vector of float) -0:? 'v' (smooth out 4-component vector of float) +0:? 'v' (noContraction smooth out 4-component vector of float) 0:? 'anon@6' (layout(column_major shared ) coherent buffer block{layout(column_major shared ) readonly buffer 4-component vector of float member1, layout(column_major shared ) buffer 4-component vector of float member2}) 0:? 'anon@7' (layout(column_major shared ) buffer block{layout(column_major shared ) coherent readonly buffer 4-component vector of float member1A, layout(column_major shared ) coherent buffer 4-component vector of float member2A}) 0:? 'shv' (shared 4-component vector of float) diff --git a/Test/baseResults/spv.150.geom.out b/Test/baseResults/spv.150.geom.out index b09f0c04..8b021ff9 100755 --- a/Test/baseResults/spv.150.geom.out +++ b/Test/baseResults/spv.150.geom.out @@ -9,7 +9,6 @@ Linked geometry stage: Capability Geometry Capability GeometryPointSize - Capability ClipDistance Capability GeometryStreams 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 diff --git a/Test/baseResults/spv.310.comp.out b/Test/baseResults/spv.310.comp.out index fa23af92..3eafc2b5 100755 --- a/Test/baseResults/spv.310.comp.out +++ b/Test/baseResults/spv.310.comp.out @@ -7,123 +7,121 @@ Linked compute stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 67 +// Id's are bound by 66 Capability Shader 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint GLCompute 4 "main" 53 + EntryPoint GLCompute 4 "main" 52 ExecutionMode 4 LocalSize 16 32 4 Source ESSL 310 Name 4 "main" - Name 13 "outb" - MemberName 13(outb) 0 "f" - MemberName 13(outb) 1 "g" - MemberName 13(outb) 2 "h" - MemberName 13(outb) 3 "uns" - Name 15 "outbname" - Name 19 "s" - Name 24 "outbna" - MemberName 24(outbna) 0 "k" - MemberName 24(outbna) 1 "na" - Name 26 "outbnamena" - Name 42 "i" - Name 48 "outs" - MemberName 48(outs) 0 "s" - MemberName 48(outs) 1 "va" - Name 50 "outnames" - Name 53 "gl_LocalInvocationID" - Decorate 12 ArrayStride 16 - MemberDecorate 13(outb) 0 Offset 0 - MemberDecorate 13(outb) 1 Offset 4 - MemberDecorate 13(outb) 2 Offset 8 - MemberDecorate 13(outb) 3 Offset 16 - Decorate 13(outb) BufferBlock - Decorate 15(outbname) DescriptorSet 0 - MemberDecorate 24(outbna) 0 Offset 0 - MemberDecorate 24(outbna) 1 Offset 16 - Decorate 24(outbna) BufferBlock - Decorate 26(outbnamena) DescriptorSet 0 - Decorate 47 ArrayStride 16 - MemberDecorate 48(outs) 0 Offset 0 - MemberDecorate 48(outs) 1 Offset 16 - Decorate 48(outs) BufferBlock - Decorate 50(outnames) DescriptorSet 0 - Decorate 53(gl_LocalInvocationID) BuiltIn LocalInvocationId - Decorate 66 BuiltIn WorkgroupSize + Name 12 "outb" + MemberName 12(outb) 0 "f" + MemberName 12(outb) 1 "g" + MemberName 12(outb) 2 "h" + MemberName 12(outb) 3 "uns" + Name 14 "outbname" + Name 18 "s" + Name 23 "outbna" + MemberName 23(outbna) 0 "k" + MemberName 23(outbna) 1 "na" + Name 25 "outbnamena" + Name 41 "i" + Name 47 "outs" + MemberName 47(outs) 0 "s" + MemberName 47(outs) 1 "va" + Name 49 "outnames" + Name 52 "gl_LocalInvocationID" + Decorate 11 ArrayStride 16 + MemberDecorate 12(outb) 0 Offset 0 + MemberDecorate 12(outb) 1 Offset 4 + MemberDecorate 12(outb) 2 Offset 8 + MemberDecorate 12(outb) 3 Offset 16 + Decorate 12(outb) BufferBlock + Decorate 14(outbname) DescriptorSet 0 + MemberDecorate 23(outbna) 0 Offset 0 + MemberDecorate 23(outbna) 1 Offset 16 + Decorate 23(outbna) BufferBlock + Decorate 25(outbnamena) DescriptorSet 0 + Decorate 46 ArrayStride 16 + MemberDecorate 47(outs) 0 Offset 0 + MemberDecorate 47(outs) 1 Offset 16 + Decorate 47(outs) BufferBlock + Decorate 49(outnames) DescriptorSet 0 + Decorate 52(gl_LocalInvocationID) BuiltIn LocalInvocationId + Decorate 65 BuiltIn WorkgroupSize 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 0 7: 6(int) Constant 1 - 8: 6(int) Constant 4062 - 9: 6(int) Constant 0 - 10: TypeFloat 32 - 11: TypeVector 10(float) 3 - 12: TypeRuntimeArray 11(fvec3) - 13(outb): TypeStruct 10(float) 10(float) 10(float) 12 - 14: TypePointer Uniform 13(outb) - 15(outbname): 14(ptr) Variable Uniform - 16: TypeInt 32 1 - 17: 16(int) Constant 0 - 18: TypePointer Workgroup 10(float) - 19(s): 18(ptr) Variable Workgroup - 21: TypePointer Uniform 10(float) - 23: TypeVector 10(float) 4 - 24(outbna): TypeStruct 16(int) 23(fvec4) - 25: TypePointer Uniform 24(outbna) - 26(outbnamena): 25(ptr) Variable Uniform - 27: 16(int) Constant 1 - 30: TypePointer Uniform 23(fvec4) - 32: 16(int) Constant 3 - 33: 16(int) Constant 18 - 36: 16(int) Constant 17 - 37: 10(float) Constant 1077936128 - 38: 11(fvec3) ConstantComposite 37 37 37 - 39: TypePointer Uniform 11(fvec3) - 41: TypePointer Workgroup 16(int) - 42(i): 41(ptr) Variable Workgroup - 47: TypeRuntimeArray 23(fvec4) - 48(outs): TypeStruct 16(int) 47 - 49: TypePointer Uniform 48(outs) - 50(outnames): 49(ptr) Variable Uniform - 51: TypeVector 6(int) 3 - 52: TypePointer Input 51(ivec3) -53(gl_LocalInvocationID): 52(ptr) Variable Input - 54: TypePointer Input 6(int) - 61: TypePointer Uniform 16(int) - 63: 6(int) Constant 16 - 64: 6(int) Constant 32 - 65: 6(int) Constant 4 - 66: 51(ivec3) ConstantComposite 63 64 65 + 8: 6(int) Constant 0 + 9: TypeFloat 32 + 10: TypeVector 9(float) 3 + 11: TypeRuntimeArray 10(fvec3) + 12(outb): TypeStruct 9(float) 9(float) 9(float) 11 + 13: TypePointer Uniform 12(outb) + 14(outbname): 13(ptr) Variable Uniform + 15: TypeInt 32 1 + 16: 15(int) Constant 0 + 17: TypePointer Workgroup 9(float) + 18(s): 17(ptr) Variable Workgroup + 20: TypePointer Uniform 9(float) + 22: TypeVector 9(float) 4 + 23(outbna): TypeStruct 15(int) 22(fvec4) + 24: TypePointer Uniform 23(outbna) + 25(outbnamena): 24(ptr) Variable Uniform + 26: 15(int) Constant 1 + 29: TypePointer Uniform 22(fvec4) + 31: 15(int) Constant 3 + 32: 15(int) Constant 18 + 35: 15(int) Constant 17 + 36: 9(float) Constant 1077936128 + 37: 10(fvec3) ConstantComposite 36 36 36 + 38: TypePointer Uniform 10(fvec3) + 40: TypePointer Workgroup 15(int) + 41(i): 40(ptr) Variable Workgroup + 46: TypeRuntimeArray 22(fvec4) + 47(outs): TypeStruct 15(int) 46 + 48: TypePointer Uniform 47(outs) + 49(outnames): 48(ptr) Variable Uniform + 50: TypeVector 6(int) 3 + 51: TypePointer Input 50(ivec3) +52(gl_LocalInvocationID): 51(ptr) Variable Input + 53: TypePointer Input 6(int) + 60: TypePointer Uniform 15(int) + 62: 6(int) Constant 16 + 63: 6(int) Constant 32 + 64: 6(int) Constant 4 + 65: 50(ivec3) ConstantComposite 62 63 64 4(main): 2 Function None 3 5: Label - MemoryBarrier 7 8 - ControlBarrier 7 7 9 - 20: 10(float) Load 19(s) - 22: 21(ptr) AccessChain 15(outbname) 17 - Store 22 20 - 28: 10(float) Load 19(s) - 29: 23(fvec4) CompositeConstruct 28 28 28 28 - 31: 30(ptr) AccessChain 26(outbnamena) 27 - Store 31 29 - 34: 21(ptr) AccessChain 15(outbname) 32 33 9 - 35: 10(float) Load 34 - Store 19(s) 35 - 40: 39(ptr) AccessChain 15(outbname) 32 36 - Store 40 38 - 43: 16(int) Load 42(i) - 44: 10(float) Load 19(s) - 45: 11(fvec3) CompositeConstruct 44 44 44 - 46: 39(ptr) AccessChain 15(outbname) 32 43 - Store 46 45 - 55: 54(ptr) AccessChain 53(gl_LocalInvocationID) 9 - 56: 6(int) Load 55 - 57: 10(float) Load 19(s) - 58: 23(fvec4) CompositeConstruct 57 57 57 57 - 59: 30(ptr) AccessChain 50(outnames) 27 56 - Store 59 58 - 60: 16(int) ArrayLength 15(outbname) 3 - 62: 61(ptr) AccessChain 50(outnames) 17 - Store 62 60 + ControlBarrier 7 7 8 + 19: 9(float) Load 18(s) + 21: 20(ptr) AccessChain 14(outbname) 16 + Store 21 19 + 27: 9(float) Load 18(s) + 28: 22(fvec4) CompositeConstruct 27 27 27 27 + 30: 29(ptr) AccessChain 25(outbnamena) 26 + Store 30 28 + 33: 20(ptr) AccessChain 14(outbname) 31 32 8 + 34: 9(float) Load 33 + Store 18(s) 34 + 39: 38(ptr) AccessChain 14(outbname) 31 35 + Store 39 37 + 42: 15(int) Load 41(i) + 43: 9(float) Load 18(s) + 44: 10(fvec3) CompositeConstruct 43 43 43 + 45: 38(ptr) AccessChain 14(outbname) 31 42 + Store 45 44 + 54: 53(ptr) AccessChain 52(gl_LocalInvocationID) 8 + 55: 6(int) Load 54 + 56: 9(float) Load 18(s) + 57: 22(fvec4) CompositeConstruct 56 56 56 56 + 58: 29(ptr) AccessChain 49(outnames) 26 55 + Store 58 57 + 59: 15(int) ArrayLength 14(outbname) 3 + 61: 60(ptr) AccessChain 49(outnames) 16 + Store 61 59 Return FunctionEnd diff --git a/Test/baseResults/spv.330.geom.out b/Test/baseResults/spv.330.geom.out old mode 100755 new mode 100644 diff --git a/Test/baseResults/spv.400.frag.out b/Test/baseResults/spv.400.frag.out index 651d67de..4af713c4 100644 --- a/Test/baseResults/spv.400.frag.out +++ b/Test/baseResults/spv.400.frag.out @@ -11,6 +11,7 @@ Linked fragment stage: Capability Shader Capability Float64 + Capability ImageGatherExtended Capability ClipDistance Capability SampledRect 1: ExtInstImport "GLSL.std.450" diff --git a/Test/baseResults/spv.400.tesc.out b/Test/baseResults/spv.400.tesc.out index eea07ce7..290a19cd 100755 --- a/Test/baseResults/spv.400.tesc.out +++ b/Test/baseResults/spv.400.tesc.out @@ -7,68 +7,68 @@ Linked tessellation control stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 93 +// Id's are bound by 94 Capability Tessellation Capability TessellationPointSize Capability ClipDistance 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint TessellationControl 4 "main" 23 40 43 46 52 66 73 79 83 84 87 88 91 92 + EntryPoint TessellationControl 4 "main" 24 41 44 47 55 69 74 80 84 85 88 89 92 93 ExecutionMode 4 OutputVertices 4 Source GLSL 400 SourceExtension "GL_ARB_separate_shader_objects" Name 4 "main" Name 12 "a" Name 17 "p" - Name 19 "gl_PerVertex" - MemberName 19(gl_PerVertex) 0 "gl_Position" - MemberName 19(gl_PerVertex) 1 "gl_PointSize" - MemberName 19(gl_PerVertex) 2 "gl_ClipDistance" - Name 23 "gl_in" - Name 30 "ps" - Name 34 "cd" - Name 38 "pvi" - Name 40 "gl_PatchVerticesIn" - Name 42 "pid" - Name 43 "gl_PrimitiveID" - Name 45 "iid" - Name 46 "gl_InvocationID" - Name 48 "gl_PerVertex" - MemberName 48(gl_PerVertex) 0 "gl_Position" - MemberName 48(gl_PerVertex) 1 "gl_PointSize" - MemberName 48(gl_PerVertex) 2 "gl_ClipDistance" - Name 52 "gl_out" - Name 66 "gl_TessLevelOuter" - Name 73 "gl_TessLevelInner" - Name 78 "outa" - Name 79 "patchOut" - Name 83 "inb" - Name 84 "ind" - Name 87 "ivla" - Name 88 "ivlb" - Name 91 "ovla" - Name 92 "ovlb" - MemberDecorate 19(gl_PerVertex) 0 BuiltIn Position - MemberDecorate 19(gl_PerVertex) 1 BuiltIn PointSize - MemberDecorate 19(gl_PerVertex) 2 BuiltIn ClipDistance - Decorate 19(gl_PerVertex) Block - Decorate 40(gl_PatchVerticesIn) BuiltIn PatchVertices - Decorate 43(gl_PrimitiveID) BuiltIn PrimitiveId - Decorate 46(gl_InvocationID) BuiltIn InvocationId - MemberDecorate 48(gl_PerVertex) 0 BuiltIn Position - MemberDecorate 48(gl_PerVertex) 1 BuiltIn PointSize - MemberDecorate 48(gl_PerVertex) 2 BuiltIn ClipDistance - Decorate 48(gl_PerVertex) Block - Decorate 66(gl_TessLevelOuter) Patch - Decorate 66(gl_TessLevelOuter) BuiltIn TessLevelOuter - Decorate 73(gl_TessLevelInner) Patch - Decorate 73(gl_TessLevelInner) BuiltIn TessLevelInner - Decorate 79(patchOut) Patch - Decorate 87(ivla) Location 3 - Decorate 88(ivlb) Location 4 - Decorate 91(ovla) Location 3 - Decorate 92(ovlb) Location 4 + Name 20 "gl_PerVertex" + MemberName 20(gl_PerVertex) 0 "gl_Position" + MemberName 20(gl_PerVertex) 1 "gl_PointSize" + MemberName 20(gl_PerVertex) 2 "gl_ClipDistance" + Name 24 "gl_in" + Name 31 "ps" + Name 35 "cd" + Name 39 "pvi" + Name 41 "gl_PatchVerticesIn" + Name 43 "pid" + Name 44 "gl_PrimitiveID" + Name 46 "iid" + Name 47 "gl_InvocationID" + Name 51 "gl_PerVertex" + MemberName 51(gl_PerVertex) 0 "gl_Position" + MemberName 51(gl_PerVertex) 1 "gl_PointSize" + MemberName 51(gl_PerVertex) 2 "gl_ClipDistance" + Name 55 "gl_out" + Name 69 "gl_TessLevelOuter" + Name 74 "gl_TessLevelInner" + Name 79 "outa" + Name 80 "patchOut" + Name 84 "inb" + Name 85 "ind" + Name 88 "ivla" + Name 89 "ivlb" + Name 92 "ovla" + Name 93 "ovlb" + MemberDecorate 20(gl_PerVertex) 0 BuiltIn Position + MemberDecorate 20(gl_PerVertex) 1 BuiltIn PointSize + MemberDecorate 20(gl_PerVertex) 2 BuiltIn ClipDistance + Decorate 20(gl_PerVertex) Block + Decorate 41(gl_PatchVerticesIn) BuiltIn PatchVertices + Decorate 44(gl_PrimitiveID) BuiltIn PrimitiveId + Decorate 47(gl_InvocationID) BuiltIn InvocationId + MemberDecorate 51(gl_PerVertex) 0 BuiltIn Position + MemberDecorate 51(gl_PerVertex) 1 BuiltIn PointSize + MemberDecorate 51(gl_PerVertex) 2 BuiltIn ClipDistance + Decorate 51(gl_PerVertex) Block + Decorate 69(gl_TessLevelOuter) Patch + Decorate 69(gl_TessLevelOuter) BuiltIn TessLevelOuter + Decorate 74(gl_TessLevelInner) Patch + Decorate 74(gl_TessLevelInner) BuiltIn TessLevelInner + Decorate 80(patchOut) Patch + Decorate 88(ivla) Location 3 + Decorate 89(ivlb) Location 4 + Decorate 92(ovla) Location 3 + Decorate 93(ovlb) Location 4 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 0 @@ -81,98 +81,99 @@ Linked tessellation control stage: 14: TypeFloat 32 15: TypeVector 14(float) 4 16: TypePointer Function 15(fvec4) - 18: TypeArray 14(float) 7 -19(gl_PerVertex): TypeStruct 15(fvec4) 14(float) 18 - 20: 6(int) Constant 32 - 21: TypeArray 19(gl_PerVertex) 20 - 22: TypePointer Input 21 - 23(gl_in): 22(ptr) Variable Input - 24: 10(int) Constant 1 - 25: 10(int) Constant 0 - 26: TypePointer Input 15(fvec4) - 29: TypePointer Function 14(float) - 31: TypePointer Input 14(float) - 35: 10(int) Constant 2 - 39: TypePointer Input 10(int) -40(gl_PatchVerticesIn): 39(ptr) Variable Input -43(gl_PrimitiveID): 39(ptr) Variable Input -46(gl_InvocationID): 39(ptr) Variable Input -48(gl_PerVertex): TypeStruct 15(fvec4) 14(float) 18 - 49: 6(int) Constant 4 - 50: TypeArray 48(gl_PerVertex) 49 - 51: TypePointer Output 50 - 52(gl_out): 51(ptr) Variable Output - 55: TypePointer Output 15(fvec4) - 59: TypePointer Output 14(float) - 64: TypeArray 14(float) 49 - 65: TypePointer Output 64 -66(gl_TessLevelOuter): 65(ptr) Variable Output - 67: 10(int) Constant 3 - 68: 14(float) Constant 1078774989 - 70: 6(int) Constant 2 - 71: TypeArray 14(float) 70 - 72: TypePointer Output 71 -73(gl_TessLevelInner): 72(ptr) Variable Output - 74: 14(float) Constant 1067869798 - 76: TypeArray 10(int) 49 - 77: TypePointer Private 76 - 78(outa): 77(ptr) Variable Private - 79(patchOut): 55(ptr) Variable Output - 80: TypeVector 14(float) 2 - 81: TypeArray 80(fvec2) 20 - 82: TypePointer Input 81 - 83(inb): 82(ptr) Variable Input - 84(ind): 82(ptr) Variable Input - 85: TypeArray 15(fvec4) 20 - 86: TypePointer Input 85 - 87(ivla): 86(ptr) Variable Input - 88(ivlb): 86(ptr) Variable Input - 89: TypeArray 15(fvec4) 49 - 90: TypePointer Output 89 - 91(ovla): 90(ptr) Variable Output - 92(ovlb): 90(ptr) Variable Output + 18: 6(int) Constant 3 + 19: TypeArray 14(float) 18 +20(gl_PerVertex): TypeStruct 15(fvec4) 14(float) 19 + 21: 6(int) Constant 32 + 22: TypeArray 20(gl_PerVertex) 21 + 23: TypePointer Input 22 + 24(gl_in): 23(ptr) Variable Input + 25: 10(int) Constant 1 + 26: 10(int) Constant 0 + 27: TypePointer Input 15(fvec4) + 30: TypePointer Function 14(float) + 32: TypePointer Input 14(float) + 36: 10(int) Constant 2 + 40: TypePointer Input 10(int) +41(gl_PatchVerticesIn): 40(ptr) Variable Input +44(gl_PrimitiveID): 40(ptr) Variable Input +47(gl_InvocationID): 40(ptr) Variable Input + 49: 6(int) Constant 2 + 50: TypeArray 14(float) 49 +51(gl_PerVertex): TypeStruct 15(fvec4) 14(float) 50 + 52: 6(int) Constant 4 + 53: TypeArray 51(gl_PerVertex) 52 + 54: TypePointer Output 53 + 55(gl_out): 54(ptr) Variable Output + 58: TypePointer Output 15(fvec4) + 62: TypePointer Output 14(float) + 67: TypeArray 14(float) 52 + 68: TypePointer Output 67 +69(gl_TessLevelOuter): 68(ptr) Variable Output + 70: 10(int) Constant 3 + 71: 14(float) Constant 1078774989 + 73: TypePointer Output 50 +74(gl_TessLevelInner): 73(ptr) Variable Output + 75: 14(float) Constant 1067869798 + 77: TypeArray 10(int) 52 + 78: TypePointer Private 77 + 79(outa): 78(ptr) Variable Private + 80(patchOut): 58(ptr) Variable Output + 81: TypeVector 14(float) 2 + 82: TypeArray 81(fvec2) 21 + 83: TypePointer Input 82 + 84(inb): 83(ptr) Variable Input + 85(ind): 83(ptr) Variable Input + 86: TypeArray 15(fvec4) 21 + 87: TypePointer Input 86 + 88(ivla): 87(ptr) Variable Input + 89(ivlb): 87(ptr) Variable Input + 90: TypeArray 15(fvec4) 52 + 91: TypePointer Output 90 + 92(ovla): 91(ptr) Variable Output + 93(ovlb): 91(ptr) Variable Output 4(main): 2 Function None 3 5: Label 12(a): 11(ptr) Variable Function 17(p): 16(ptr) Variable Function - 30(ps): 29(ptr) Variable Function - 34(cd): 29(ptr) Variable Function - 38(pvi): 11(ptr) Variable Function - 42(pid): 11(ptr) Variable Function - 45(iid): 11(ptr) Variable Function + 31(ps): 30(ptr) Variable Function + 35(cd): 30(ptr) Variable Function + 39(pvi): 11(ptr) Variable Function + 43(pid): 11(ptr) Variable Function + 46(iid): 11(ptr) Variable Function MemoryBarrier 7 8 ControlBarrier 7 7 9 Store 12(a) 13 - 27: 26(ptr) AccessChain 23(gl_in) 24 25 - 28: 15(fvec4) Load 27 - Store 17(p) 28 - 32: 31(ptr) AccessChain 23(gl_in) 24 24 - 33: 14(float) Load 32 - Store 30(ps) 33 - 36: 31(ptr) AccessChain 23(gl_in) 24 35 35 - 37: 14(float) Load 36 - Store 34(cd) 37 - 41: 10(int) Load 40(gl_PatchVerticesIn) - Store 38(pvi) 41 - 44: 10(int) Load 43(gl_PrimitiveID) - Store 42(pid) 44 - 47: 10(int) Load 46(gl_InvocationID) - Store 45(iid) 47 - 53: 10(int) Load 46(gl_InvocationID) - 54: 15(fvec4) Load 17(p) - 56: 55(ptr) AccessChain 52(gl_out) 53 25 - Store 56 54 - 57: 10(int) Load 46(gl_InvocationID) - 58: 14(float) Load 30(ps) - 60: 59(ptr) AccessChain 52(gl_out) 57 24 - Store 60 58 - 61: 10(int) Load 46(gl_InvocationID) - 62: 14(float) Load 34(cd) - 63: 59(ptr) AccessChain 52(gl_out) 61 35 24 - Store 63 62 - 69: 59(ptr) AccessChain 66(gl_TessLevelOuter) 67 - Store 69 68 - 75: 59(ptr) AccessChain 73(gl_TessLevelInner) 24 - Store 75 74 + 28: 27(ptr) AccessChain 24(gl_in) 25 26 + 29: 15(fvec4) Load 28 + Store 17(p) 29 + 33: 32(ptr) AccessChain 24(gl_in) 25 25 + 34: 14(float) Load 33 + Store 31(ps) 34 + 37: 32(ptr) AccessChain 24(gl_in) 25 36 36 + 38: 14(float) Load 37 + Store 35(cd) 38 + 42: 10(int) Load 41(gl_PatchVerticesIn) + Store 39(pvi) 42 + 45: 10(int) Load 44(gl_PrimitiveID) + Store 43(pid) 45 + 48: 10(int) Load 47(gl_InvocationID) + Store 46(iid) 48 + 56: 10(int) Load 47(gl_InvocationID) + 57: 15(fvec4) Load 17(p) + 59: 58(ptr) AccessChain 55(gl_out) 56 26 + Store 59 57 + 60: 10(int) Load 47(gl_InvocationID) + 61: 14(float) Load 31(ps) + 63: 62(ptr) AccessChain 55(gl_out) 60 25 + Store 63 61 + 64: 10(int) Load 47(gl_InvocationID) + 65: 14(float) Load 35(cd) + 66: 62(ptr) AccessChain 55(gl_out) 64 36 25 + Store 66 65 + 72: 62(ptr) AccessChain 69(gl_TessLevelOuter) 70 + Store 72 71 + 76: 62(ptr) AccessChain 74(gl_TessLevelInner) 25 + Store 76 75 Return FunctionEnd diff --git a/Test/baseResults/spv.400.tese.out b/Test/baseResults/spv.400.tese.out index 03e181ce..51534b12 100755 --- a/Test/baseResults/spv.400.tese.out +++ b/Test/baseResults/spv.400.tese.out @@ -7,14 +7,14 @@ Linked tessellation evaluation stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 98 +// Id's are bound by 96 Capability Tessellation Capability TessellationPointSize Capability ClipDistance 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint TessellationEvaluation 4 "main" 21 38 41 47 53 61 68 77 81 82 86 90 93 94 97 + EntryPoint TessellationEvaluation 4 "main" 21 38 41 47 53 61 66 75 79 80 84 88 91 92 95 ExecutionMode 4 Triangles ExecutionMode 4 SpacingFractionalOdd ExecutionMode 4 VertexOrderCcw @@ -41,23 +41,23 @@ Linked tessellation evaluation stage: Name 53 "gl_TessLevelOuter" Name 57 "tli" Name 61 "gl_TessLevelInner" - Name 66 "gl_PerVertex" - MemberName 66(gl_PerVertex) 0 "gl_Position" - MemberName 66(gl_PerVertex) 1 "gl_PointSize" - MemberName 66(gl_PerVertex) 2 "gl_ClipDistance" - Name 68 "" - Name 77 "patchIn" - Name 81 "inb" - Name 82 "ind" - Name 83 "testblb" - MemberName 83(testblb) 0 "f" - Name 86 "blb" - Name 87 "testbld" - MemberName 87(testbld) 0 "f" - Name 90 "bld" - Name 93 "ivla" - Name 94 "ivlb" - Name 97 "ovla" + Name 64 "gl_PerVertex" + MemberName 64(gl_PerVertex) 0 "gl_Position" + MemberName 64(gl_PerVertex) 1 "gl_PointSize" + MemberName 64(gl_PerVertex) 2 "gl_ClipDistance" + Name 66 "" + Name 75 "patchIn" + Name 79 "inb" + Name 80 "ind" + Name 81 "testblb" + MemberName 81(testblb) 0 "f" + Name 84 "blb" + Name 85 "testbld" + MemberName 85(testbld) 0 "f" + Name 88 "bld" + Name 91 "ivla" + Name 92 "ivlb" + Name 95 "ovla" MemberDecorate 17(gl_PerVertex) 0 BuiltIn Position MemberDecorate 17(gl_PerVertex) 1 BuiltIn PointSize MemberDecorate 17(gl_PerVertex) 2 BuiltIn ClipDistance @@ -69,16 +69,16 @@ Linked tessellation evaluation stage: Decorate 53(gl_TessLevelOuter) BuiltIn TessLevelOuter Decorate 61(gl_TessLevelInner) Patch Decorate 61(gl_TessLevelInner) BuiltIn TessLevelInner - MemberDecorate 66(gl_PerVertex) 0 BuiltIn Position - MemberDecorate 66(gl_PerVertex) 1 BuiltIn PointSize - MemberDecorate 66(gl_PerVertex) 2 BuiltIn ClipDistance - Decorate 66(gl_PerVertex) Block - Decorate 77(patchIn) Patch - Decorate 83(testblb) Block - Decorate 87(testbld) Block - Decorate 93(ivla) Location 23 - Decorate 94(ivlb) Location 24 - Decorate 97(ovla) Location 23 + MemberDecorate 64(gl_PerVertex) 0 BuiltIn Position + MemberDecorate 64(gl_PerVertex) 1 BuiltIn PointSize + MemberDecorate 64(gl_PerVertex) 2 BuiltIn ClipDistance + Decorate 64(gl_PerVertex) Block + Decorate 75(patchIn) Patch + Decorate 81(testblb) Block + Decorate 85(testbld) Block + Decorate 91(ivla) Location 23 + Decorate 92(ivlb) Location 24 + Decorate 95(ovla) Location 23 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 1 @@ -88,7 +88,7 @@ Linked tessellation evaluation stage: 11: TypeVector 10(float) 4 12: TypePointer Function 11(fvec4) 14: TypeInt 32 0 - 15: 14(int) Constant 1 + 15: 14(int) Constant 3 16: TypeArray 10(float) 15 17(gl_PerVertex): TypeStruct 11(fvec4) 10(float) 16 18: 14(int) Constant 32 @@ -117,34 +117,32 @@ Linked tessellation evaluation stage: 59: TypeArray 10(float) 58 60: TypePointer Input 59 61(gl_TessLevelInner): 60(ptr) Variable Input - 64: 14(int) Constant 3 - 65: TypeArray 10(float) 64 -66(gl_PerVertex): TypeStruct 11(fvec4) 10(float) 65 - 67: TypePointer Output 66(gl_PerVertex) - 68: 67(ptr) Variable Output - 70: TypePointer Output 11(fvec4) - 73: TypePointer Output 10(float) - 77(patchIn): 24(ptr) Variable Input - 78: TypeVector 10(float) 2 - 79: TypeArray 78(fvec2) 18 - 80: TypePointer Input 79 - 81(inb): 80(ptr) Variable Input - 82(ind): 80(ptr) Variable Input - 83(testblb): TypeStruct 6(int) - 84: TypeArray 83(testblb) 18 - 85: TypePointer Input 84 - 86(blb): 85(ptr) Variable Input - 87(testbld): TypeStruct 6(int) - 88: TypeArray 87(testbld) 18 - 89: TypePointer Input 88 - 90(bld): 89(ptr) Variable Input - 91: TypeArray 11(fvec4) 18 - 92: TypePointer Input 91 - 93(ivla): 92(ptr) Variable Input - 94(ivlb): 92(ptr) Variable Input - 95: TypeArray 11(fvec4) 58 - 96: TypePointer Output 95 - 97(ovla): 96(ptr) Variable Output +64(gl_PerVertex): TypeStruct 11(fvec4) 10(float) 16 + 65: TypePointer Output 64(gl_PerVertex) + 66: 65(ptr) Variable Output + 68: TypePointer Output 11(fvec4) + 71: TypePointer Output 10(float) + 75(patchIn): 24(ptr) Variable Input + 76: TypeVector 10(float) 2 + 77: TypeArray 76(fvec2) 18 + 78: TypePointer Input 77 + 79(inb): 78(ptr) Variable Input + 80(ind): 78(ptr) Variable Input + 81(testblb): TypeStruct 6(int) + 82: TypeArray 81(testblb) 18 + 83: TypePointer Input 82 + 84(blb): 83(ptr) Variable Input + 85(testbld): TypeStruct 6(int) + 86: TypeArray 85(testbld) 18 + 87: TypePointer Input 86 + 88(bld): 87(ptr) Variable Input + 89: TypeArray 11(fvec4) 18 + 90: TypePointer Input 89 + 91(ivla): 90(ptr) Variable Input + 92(ivlb): 90(ptr) Variable Input + 93: TypeArray 11(fvec4) 58 + 94: TypePointer Output 93 + 95(ovla): 94(ptr) Variable Output 4(main): 2 Function None 3 5: Label 8(a): 7(ptr) Variable Function @@ -178,14 +176,14 @@ Linked tessellation evaluation stage: 62: 29(ptr) AccessChain 61(gl_TessLevelInner) 22 63: 10(float) Load 62 Store 57(tli) 63 - 69: 11(fvec4) Load 13(p) - 71: 70(ptr) AccessChain 68 23 - Store 71 69 - 72: 10(float) Load 28(ps) - 74: 73(ptr) AccessChain 68 22 - Store 74 72 - 75: 10(float) Load 32(cd) - 76: 73(ptr) AccessChain 68 33 33 - Store 76 75 + 67: 11(fvec4) Load 13(p) + 69: 68(ptr) AccessChain 66 23 + Store 69 67 + 70: 10(float) Load 28(ps) + 72: 71(ptr) AccessChain 66 22 + Store 72 70 + 73: 10(float) Load 32(cd) + 74: 71(ptr) AccessChain 66 33 33 + Store 74 73 Return FunctionEnd diff --git a/Test/baseResults/spv.420.geom.out b/Test/baseResults/spv.420.geom.out index cb535599..78e3aaa2 100644 --- a/Test/baseResults/spv.420.geom.out +++ b/Test/baseResults/spv.420.geom.out @@ -11,6 +11,7 @@ Linked geometry stage: Capability Geometry Capability GeometryPointSize + Capability ImageGatherExtended Capability GeometryStreams Capability MultiViewport 1: ExtInstImport "GLSL.std.450" diff --git a/Test/baseResults/spv.430.vert.out b/Test/baseResults/spv.430.vert.out index a1487d53..f84fa556 100755 --- a/Test/baseResults/spv.430.vert.out +++ b/Test/baseResults/spv.430.vert.out @@ -10,7 +10,6 @@ Linked vertex stage: // Id's are bound by 66 Capability Shader - Capability ClipDistance 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 EntryPoint Vertex 4 "main" 12 23 34 38 41 42 62 65 @@ -63,18 +62,10 @@ Linked vertex stage: Decorate 55(sampb2) Binding 5 Decorate 56(sampb4) DescriptorSet 0 Decorate 56(sampb4) Binding 31 - MemberDecorate 59(S) 0 Flat - MemberDecorate 59(S) 0 Location 1 - MemberDecorate 59(S) 1 Flat - MemberDecorate 59(S) 1 Location 2 - MemberDecorate 59(S) 2 Flat - MemberDecorate 59(S) 2 Location 3 MemberDecorate 60(SS) 0 Flat - MemberDecorate 60(SS) 0 Location 0 MemberDecorate 60(SS) 1 Flat - MemberDecorate 60(SS) 1 Location 1 MemberDecorate 60(SS) 2 Flat - MemberDecorate 60(SS) 2 Location 4 + Decorate 62(var) Location 0 MemberDecorate 63(MS) 0 Location 17 Decorate 63(MS) Block 2: TypeVoid diff --git a/Test/baseResults/spv.Operations.frag.out b/Test/baseResults/spv.Operations.frag.out index a5863729..f8b666d5 100755 --- a/Test/baseResults/spv.Operations.frag.out +++ b/Test/baseResults/spv.Operations.frag.out @@ -470,7 +470,7 @@ Linked fragment stage: 339: Label 341: 179(bvec4) Load 181(ub41) 343: 179(bvec4) Load 342(ub42) - 344: 179(bvec4) IEqual 341 343 + 344: 179(bvec4) LogicalEqual 341 343 345: 178(bool) Any 344 Branch 340 340: Label @@ -482,7 +482,7 @@ Linked fragment stage: 348: Label 350: 179(bvec4) Load 181(ub41) 351: 179(bvec4) Load 342(ub42) - 352: 179(bvec4) INotEqual 350 351 + 352: 179(bvec4) LogicalNotEqual 350 351 353: 178(bool) Any 352 Branch 349 349: Label diff --git a/Test/baseResults/spv.bool.vert.out b/Test/baseResults/spv.bool.vert.out index f11fe398..49a69a0e 100644 --- a/Test/baseResults/spv.bool.vert.out +++ b/Test/baseResults/spv.bool.vert.out @@ -10,8 +10,6 @@ Linked vertex stage: // Id's are bound by 49 Capability Shader - Capability ClipDistance - Capability CullDistance 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 EntryPoint Vertex 4 "main" 24 @@ -91,6 +89,6 @@ Linked vertex stage: 9(b): 7(ptr) FunctionParameter 11: Label 12: 6(bool) Load 9(b) - 14: 6(bool) INotEqual 12 13 + 14: 6(bool) LogicalNotEqual 12 13 ReturnValue 14 FunctionEnd diff --git a/Test/baseResults/spv.int64.frag.out b/Test/baseResults/spv.int64.frag.out new file mode 100644 index 00000000..fe450137 --- /dev/null +++ b/Test/baseResults/spv.int64.frag.out @@ -0,0 +1,626 @@ +spv.int64.frag +Warning, version 450 is not yet complete; most version-specific features are present, but some are missing. + + +Linked fragment stage: + + +Missing functionality: shader int64 +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 455 + + Capability Shader + Capability Float64 + Capability Int64 + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Fragment 4 "main" + ExecutionMode 4 OriginUpperLeft + Source GLSL 450 + SourceExtension "GL_ARB_gpu_shader_int64" + Name 4 "main" + Name 6 "literal(" + Name 8 "typeCast(" + Name 10 "operators(" + Name 12 "builtinFuncs(" + Name 16 "i64" + Name 24 "Uniforms" + MemberName 24(Uniforms) 0 "index" + Name 26 "" + Name 33 "indexable" + Name 38 "u64" + Name 47 "indexable" + Name 52 "i64v" + Name 56 "bv" + Name 65 "u64v" + Name 74 "iv" + Name 81 "uv" + Name 89 "fv" + Name 95 "dv" + Name 132 "u64v" + Name 137 "i64" + Name 157 "i" + Name 164 "uv" + Name 216 "b" + Name 276 "i64v" + Name 279 "i64" + Name 289 "u64v" + Name 291 "u64" + Name 363 "dv" + Name 382 "iv" + Name 387 "uv" + Name 391 "bv" + Name 452 "Block" + MemberName 452(Block) 0 "i64v" + MemberName 452(Block) 1 "u64" + Name 454 "block" + MemberDecorate 24(Uniforms) 0 Offset 0 + Decorate 24(Uniforms) Block + Decorate 26 DescriptorSet 0 + Decorate 26 Binding 0 + MemberDecorate 452(Block) 0 Offset 0 + MemberDecorate 452(Block) 1 Offset 24 + Decorate 452(Block) Block + Decorate 454(block) DescriptorSet 0 + Decorate 454(block) Binding 1 + 2: TypeVoid + 3: TypeFunction 2 + 14: TypeInt 64 1 + 15: TypePointer Function 14(int) + 17: TypeInt 32 0 + 18: 17(int) Constant 3 + 19: TypeArray 14(int) 18 + 20: 14(int) Constant 4008636143 4008636142 + 21: 14(int) Constant 4294967295 4294967295 + 22: 14(int) Constant 0 1 + 23: 19 ConstantComposite 20 21 22 + 24(Uniforms): TypeStruct 17(int) + 25: TypePointer Uniform 24(Uniforms) + 26: 25(ptr) Variable Uniform + 27: TypeInt 32 1 + 28: 27(int) Constant 0 + 29: TypePointer Uniform 17(int) + 32: TypePointer Function 19 + 36: TypeInt 64 0 + 37: TypePointer Function 36(int) + 39: TypeArray 36(int) 18 + 40: 36(int) Constant 4294967295 4294967295 + 41: 36(int) Constant 0 1 + 42: 36(int) Constant 4294967295 1 + 43: 39 ConstantComposite 40 41 42 + 46: TypePointer Function 39 + 50: TypeVector 14(int) 2 + 51: TypePointer Function 50(ivec2) + 53: TypeBool + 54: TypeVector 53(bool) 2 + 55: TypePointer Function 54(bvec2) + 58: 14(int) Constant 0 0 + 59: 14(int) Constant 1 0 + 60: 50(ivec2) ConstantComposite 58 58 + 61: 50(ivec2) ConstantComposite 59 59 + 63: TypeVector 36(int) 2 + 64: TypePointer Function 63(ivec2) + 67: 36(int) Constant 0 0 + 68: 36(int) Constant 1 0 + 69: 63(ivec2) ConstantComposite 67 67 + 70: 63(ivec2) ConstantComposite 68 68 + 72: TypeVector 27(int) 2 + 73: TypePointer Function 72(ivec2) + 79: TypeVector 17(int) 2 + 80: TypePointer Function 79(ivec2) + 86: TypeFloat 32 + 87: TypeVector 86(float) 2 + 88: TypePointer Function 87(fvec2) + 92: TypeFloat 64 + 93: TypeVector 92(float) 2 + 94: TypePointer Function 93(fvec2) + 130: TypeVector 36(int) 3 + 131: TypePointer Function 130(ivec3) + 134: TypeVector 14(int) 3 + 156: TypePointer Function 27(int) + 162: TypeVector 17(int) 3 + 163: TypePointer Function 162(ivec3) + 197: TypeVector 27(int) 3 + 200: 17(int) Constant 1 + 201: TypePointer Function 17(int) + 207: 17(int) Constant 2 + 215: TypePointer Function 53(bool) + 217: 17(int) Constant 0 + 287: 50(ivec2) ConstantComposite 21 21 + 296: 130(ivec3) ConstantComposite 67 67 67 + 338: 53(bool) ConstantTrue + 345: 53(bool) ConstantFalse + 346: 54(bvec2) ConstantComposite 345 345 + 358: TypeVector 53(bool) 3 + 359: 358(bvec3) ConstantComposite 345 345 345 + 361: TypeVector 92(float) 3 + 362: TypePointer Function 361(fvec3) + 367: TypePointer Function 92(float) + 378: 27(int) Constant 1 + 379: 27(int) Constant 2 + 380: 72(ivec2) ConstantComposite 378 379 + 385: 79(ivec2) ConstantComposite 207 18 + 390: TypePointer Function 358(bvec3) + 452(Block): TypeStruct 134(ivec3) 36(int) + 453: TypePointer Uniform 452(Block) + 454(block): 453(ptr) Variable Uniform + 4(main): 2 Function None 3 + 5: Label + Return + FunctionEnd + 6(literal(): 2 Function None 3 + 7: Label + 16(i64): 15(ptr) Variable Function + 33(indexable): 32(ptr) Variable Function + 38(u64): 37(ptr) Variable Function + 47(indexable): 46(ptr) Variable Function + 30: 29(ptr) AccessChain 26 28 + 31: 17(int) Load 30 + Store 33(indexable) 23 + 34: 15(ptr) AccessChain 33(indexable) 31 + 35: 14(int) Load 34 + Store 16(i64) 35 + 44: 29(ptr) AccessChain 26 28 + 45: 17(int) Load 44 + Store 47(indexable) 43 + 48: 37(ptr) AccessChain 47(indexable) 45 + 49: 36(int) Load 48 + Store 38(u64) 49 + Return + FunctionEnd + 8(typeCast(): 2 Function None 3 + 9: Label + 52(i64v): 51(ptr) Variable Function + 56(bv): 55(ptr) Variable Function + 65(u64v): 64(ptr) Variable Function + 74(iv): 73(ptr) Variable Function + 81(uv): 80(ptr) Variable Function + 89(fv): 88(ptr) Variable Function + 95(dv): 94(ptr) Variable Function + 57: 54(bvec2) Load 56(bv) + 62: 50(ivec2) Select 57 61 60 + Store 52(i64v) 62 + 66: 54(bvec2) Load 56(bv) + 71: 63(ivec2) Select 66 70 69 + Store 65(u64v) 71 + 75: 72(ivec2) Load 74(iv) + 76: 50(ivec2) SConvert 75 + Store 52(i64v) 76 + 77: 50(ivec2) Load 52(i64v) + 78: 72(ivec2) SConvert 77 + Store 74(iv) 78 + 82: 79(ivec2) Load 81(uv) + 83: 63(ivec2) UConvert 82 + Store 65(u64v) 83 + 84: 63(ivec2) Load 65(u64v) + 85: 79(ivec2) UConvert 84 + Store 81(uv) 85 + 90: 50(ivec2) Load 52(i64v) + 91: 87(fvec2) ConvertSToF 90 + Store 89(fv) 91 + 96: 50(ivec2) Load 52(i64v) + 97: 93(fvec2) ConvertSToF 96 + Store 95(dv) 97 + 98: 63(ivec2) Load 65(u64v) + 99: 87(fvec2) ConvertUToF 98 + Store 89(fv) 99 + 100: 63(ivec2) Load 65(u64v) + 101: 93(fvec2) ConvertUToF 100 + Store 95(dv) 101 + 102: 87(fvec2) Load 89(fv) + 103: 50(ivec2) ConvertFToS 102 + Store 52(i64v) 103 + 104: 93(fvec2) Load 95(dv) + 105: 50(ivec2) ConvertFToS 104 + Store 52(i64v) 105 + 106: 87(fvec2) Load 89(fv) + 107: 63(ivec2) ConvertFToU 106 + Store 65(u64v) 107 + 108: 93(fvec2) Load 95(dv) + 109: 63(ivec2) ConvertFToU 108 + Store 65(u64v) 109 + 110: 50(ivec2) Load 52(i64v) + 111: 54(bvec2) INotEqual 110 69 + Store 56(bv) 111 + 112: 63(ivec2) Load 65(u64v) + 113: 54(bvec2) INotEqual 112 69 + Store 56(bv) 113 + 114: 50(ivec2) Load 52(i64v) + 115: 63(ivec2) Bitcast 114 + Store 65(u64v) 115 + 116: 63(ivec2) Load 65(u64v) + 117: 50(ivec2) Bitcast 116 + Store 52(i64v) 117 + 118: 50(ivec2) Load 52(i64v) + 119: 72(ivec2) SConvert 118 + 120: 79(ivec2) Bitcast 119 + Store 81(uv) 120 + 121: 79(ivec2) Load 81(uv) + 122: 63(ivec2) UConvert 121 + 123: 50(ivec2) Bitcast 122 + Store 52(i64v) 123 + 124: 63(ivec2) Load 65(u64v) + 125: 79(ivec2) UConvert 124 + 126: 72(ivec2) Bitcast 125 + Store 74(iv) 126 + 127: 72(ivec2) Load 74(iv) + 128: 50(ivec2) SConvert 127 + 129: 63(ivec2) Bitcast 128 + Store 65(u64v) 129 + Return + FunctionEnd + 10(operators(): 2 Function None 3 + 11: Label + 132(u64v): 131(ptr) Variable Function + 137(i64): 15(ptr) Variable Function + 157(i): 156(ptr) Variable Function + 164(uv): 163(ptr) Variable Function + 216(b): 215(ptr) Variable Function + 133: 130(ivec3) Load 132(u64v) + 135: 134(ivec3) CompositeConstruct 59 59 59 + 136: 130(ivec3) IAdd 133 135 + Store 132(u64v) 136 + 138: 14(int) Load 137(i64) + 139: 14(int) ISub 138 59 + Store 137(i64) 139 + 140: 14(int) Load 137(i64) + 141: 14(int) IAdd 140 59 + Store 137(i64) 141 + 142: 130(ivec3) Load 132(u64v) + 143: 134(ivec3) CompositeConstruct 59 59 59 + 144: 130(ivec3) ISub 142 143 + Store 132(u64v) 144 + 145: 130(ivec3) Load 132(u64v) + 146: 130(ivec3) Not 145 + Store 132(u64v) 146 + 147: 14(int) Load 137(i64) + Store 137(i64) 147 + 148: 130(ivec3) Load 132(u64v) + 149: 130(ivec3) SNegate 148 + Store 132(u64v) 149 + 150: 14(int) Load 137(i64) + 151: 14(int) Load 137(i64) + 152: 14(int) IAdd 151 150 + Store 137(i64) 152 + 153: 130(ivec3) Load 132(u64v) + 154: 130(ivec3) Load 132(u64v) + 155: 130(ivec3) ISub 154 153 + Store 132(u64v) 155 + 158: 27(int) Load 157(i) + 159: 14(int) SConvert 158 + 160: 14(int) Load 137(i64) + 161: 14(int) IMul 160 159 + Store 137(i64) 161 + 165: 162(ivec3) Load 164(uv) + 166: 130(ivec3) UConvert 165 + 167: 130(ivec3) Load 132(u64v) + 168: 130(ivec3) UDiv 167 166 + Store 132(u64v) 168 + 169: 27(int) Load 157(i) + 170: 14(int) SConvert 169 + 171: 36(int) Bitcast 170 + 172: 130(ivec3) Load 132(u64v) + 173: 130(ivec3) CompositeConstruct 171 171 171 + 174: 130(ivec3) UMod 172 173 + Store 132(u64v) 174 + 175: 130(ivec3) Load 132(u64v) + 176: 162(ivec3) Load 164(uv) + 177: 130(ivec3) UConvert 176 + 178: 130(ivec3) IAdd 175 177 + Store 132(u64v) 178 + 179: 14(int) Load 137(i64) + 180: 27(int) Load 157(i) + 181: 14(int) SConvert 180 + 182: 14(int) ISub 179 181 + Store 137(i64) 182 + 183: 130(ivec3) Load 132(u64v) + 184: 162(ivec3) Load 164(uv) + 185: 130(ivec3) UConvert 184 + 186: 130(ivec3) IMul 183 185 + Store 132(u64v) 186 + 187: 14(int) Load 137(i64) + 188: 27(int) Load 157(i) + 189: 14(int) SConvert 188 + 190: 14(int) IMul 187 189 + Store 137(i64) 190 + 191: 14(int) Load 137(i64) + 192: 27(int) Load 157(i) + 193: 14(int) SConvert 192 + 194: 14(int) SMod 191 193 + Store 137(i64) 194 + 195: 27(int) Load 157(i) + 196: 130(ivec3) Load 132(u64v) + 198: 197(ivec3) CompositeConstruct 195 195 195 + 199: 130(ivec3) ShiftLeftLogical 196 198 + Store 132(u64v) 199 + 202: 201(ptr) AccessChain 164(uv) 200 + 203: 17(int) Load 202 + 204: 14(int) Load 137(i64) + 205: 14(int) ShiftRightArithmetic 204 203 + Store 137(i64) 205 + 206: 14(int) Load 137(i64) + 208: 37(ptr) AccessChain 132(u64v) 207 + 209: 36(int) Load 208 + 210: 14(int) ShiftLeftLogical 206 209 + Store 137(i64) 210 + 211: 130(ivec3) Load 132(u64v) + 212: 14(int) Load 137(i64) + 213: 134(ivec3) CompositeConstruct 212 212 212 + 214: 130(ivec3) ShiftLeftLogical 211 213 + Store 132(u64v) 214 + 218: 37(ptr) AccessChain 132(u64v) 217 + 219: 36(int) Load 218 + 220: 14(int) Load 137(i64) + 221: 36(int) Bitcast 220 + 222: 53(bool) INotEqual 219 221 + Store 216(b) 222 + 223: 14(int) Load 137(i64) + 224: 36(int) Bitcast 223 + 225: 37(ptr) AccessChain 132(u64v) 217 + 226: 36(int) Load 225 + 227: 53(bool) IEqual 224 226 + Store 216(b) 227 + 228: 37(ptr) AccessChain 132(u64v) 217 + 229: 36(int) Load 228 + 230: 201(ptr) AccessChain 164(uv) 200 + 231: 17(int) Load 230 + 232: 36(int) UConvert 231 + 233: 53(bool) UGreaterThan 229 232 + Store 216(b) 233 + 234: 14(int) Load 137(i64) + 235: 27(int) Load 157(i) + 236: 14(int) SConvert 235 + 237: 53(bool) SLessThan 234 236 + Store 216(b) 237 + 238: 37(ptr) AccessChain 132(u64v) 200 + 239: 36(int) Load 238 + 240: 201(ptr) AccessChain 164(uv) 217 + 241: 17(int) Load 240 + 242: 36(int) UConvert 241 + 243: 53(bool) UGreaterThanEqual 239 242 + Store 216(b) 243 + 244: 14(int) Load 137(i64) + 245: 27(int) Load 157(i) + 246: 14(int) SConvert 245 + 247: 53(bool) SLessThanEqual 244 246 + Store 216(b) 247 + 248: 27(int) Load 157(i) + 249: 14(int) SConvert 248 + 250: 36(int) Bitcast 249 + 251: 130(ivec3) Load 132(u64v) + 252: 130(ivec3) CompositeConstruct 250 250 250 + 253: 130(ivec3) BitwiseOr 251 252 + Store 132(u64v) 253 + 254: 14(int) Load 137(i64) + 255: 27(int) Load 157(i) + 256: 14(int) SConvert 255 + 257: 14(int) BitwiseOr 254 256 + Store 137(i64) 257 + 258: 27(int) Load 157(i) + 259: 14(int) SConvert 258 + 260: 14(int) Load 137(i64) + 261: 14(int) BitwiseAnd 260 259 + Store 137(i64) 261 + 262: 130(ivec3) Load 132(u64v) + 263: 162(ivec3) Load 164(uv) + 264: 130(ivec3) UConvert 263 + 265: 130(ivec3) BitwiseAnd 262 264 + Store 132(u64v) 265 + 266: 14(int) Load 137(i64) + 267: 36(int) Bitcast 266 + 268: 130(ivec3) Load 132(u64v) + 269: 130(ivec3) CompositeConstruct 267 267 267 + 270: 130(ivec3) BitwiseXor 268 269 + Store 132(u64v) 270 + 271: 130(ivec3) Load 132(u64v) + 272: 14(int) Load 137(i64) + 273: 36(int) Bitcast 272 + 274: 130(ivec3) CompositeConstruct 273 273 273 + 275: 130(ivec3) BitwiseXor 271 274 + Store 132(u64v) 275 + Return + FunctionEnd +12(builtinFuncs(): 2 Function None 3 + 13: Label + 276(i64v): 51(ptr) Variable Function + 279(i64): 15(ptr) Variable Function + 289(u64v): 131(ptr) Variable Function + 291(u64): 37(ptr) Variable Function + 363(dv): 362(ptr) Variable Function + 382(iv): 73(ptr) Variable Function + 387(uv): 80(ptr) Variable Function + 391(bv): 390(ptr) Variable Function + 277: 50(ivec2) Load 276(i64v) + 278: 50(ivec2) ExtInst 1(GLSL.std.450) 5(SAbs) 277 + Store 276(i64v) 278 + 280: 14(int) Load 279(i64) + 281: 14(int) ExtInst 1(GLSL.std.450) 7(SSign) 280 + Store 279(i64) 281 + 282: 50(ivec2) Load 276(i64v) + 283: 14(int) Load 279(i64) + 284: 50(ivec2) CompositeConstruct 283 283 + 285: 50(ivec2) ExtInst 1(GLSL.std.450) 39(SMin) 282 284 + Store 276(i64v) 285 + 286: 50(ivec2) Load 276(i64v) + 288: 50(ivec2) ExtInst 1(GLSL.std.450) 39(SMin) 286 287 + Store 276(i64v) 288 + 290: 130(ivec3) Load 289(u64v) + 292: 36(int) Load 291(u64) + 293: 130(ivec3) CompositeConstruct 292 292 292 + 294: 130(ivec3) ExtInst 1(GLSL.std.450) 38(UMin) 290 293 + Store 289(u64v) 294 + 295: 130(ivec3) Load 289(u64v) + 297: 130(ivec3) ExtInst 1(GLSL.std.450) 38(UMin) 295 296 + Store 289(u64v) 297 + 298: 50(ivec2) Load 276(i64v) + 299: 14(int) Load 279(i64) + 300: 50(ivec2) CompositeConstruct 299 299 + 301: 50(ivec2) ExtInst 1(GLSL.std.450) 42(SMax) 298 300 + Store 276(i64v) 301 + 302: 50(ivec2) Load 276(i64v) + 303: 50(ivec2) ExtInst 1(GLSL.std.450) 42(SMax) 302 287 + Store 276(i64v) 303 + 304: 130(ivec3) Load 289(u64v) + 305: 36(int) Load 291(u64) + 306: 130(ivec3) CompositeConstruct 305 305 305 + 307: 130(ivec3) ExtInst 1(GLSL.std.450) 41(UMax) 304 306 + Store 289(u64v) 307 + 308: 130(ivec3) Load 289(u64v) + 309: 130(ivec3) ExtInst 1(GLSL.std.450) 41(UMax) 308 296 + Store 289(u64v) 309 + 310: 50(ivec2) Load 276(i64v) + 311: 14(int) Load 279(i64) + 312: 14(int) SNegate 311 + 313: 14(int) Load 279(i64) + 314: 50(ivec2) CompositeConstruct 312 312 + 315: 50(ivec2) CompositeConstruct 313 313 + 316: 50(ivec2) ExtInst 1(GLSL.std.450) 45(SClamp) 310 314 315 + Store 276(i64v) 316 + 317: 50(ivec2) Load 276(i64v) + 318: 50(ivec2) Load 276(i64v) + 319: 50(ivec2) SNegate 318 + 320: 50(ivec2) Load 276(i64v) + 321: 50(ivec2) ExtInst 1(GLSL.std.450) 45(SClamp) 317 319 320 + Store 276(i64v) 321 + 322: 130(ivec3) Load 289(u64v) + 323: 36(int) Load 291(u64) + 324: 36(int) SNegate 323 + 325: 36(int) Load 291(u64) + 326: 130(ivec3) CompositeConstruct 324 324 324 + 327: 130(ivec3) CompositeConstruct 325 325 325 + 328: 130(ivec3) ExtInst 1(GLSL.std.450) 44(UClamp) 322 326 327 + Store 289(u64v) 328 + 329: 130(ivec3) Load 289(u64v) + 330: 130(ivec3) Load 289(u64v) + 331: 130(ivec3) SNegate 330 + 332: 130(ivec3) Load 289(u64v) + 333: 130(ivec3) ExtInst 1(GLSL.std.450) 44(UClamp) 329 331 332 + Store 289(u64v) 333 + 334: 15(ptr) AccessChain 276(i64v) 217 + 335: 14(int) Load 334 + 336: 15(ptr) AccessChain 276(i64v) 200 + 337: 14(int) Load 336 + 339: 14(int) Select 338 337 335 + Store 279(i64) 339 + 340: 14(int) Load 279(i64) + 341: 50(ivec2) CompositeConstruct 340 340 + 342: 14(int) Load 279(i64) + 343: 14(int) SNegate 342 + 344: 50(ivec2) CompositeConstruct 343 343 + 347: 50(ivec2) Select 346 344 341 + Store 276(i64v) 347 + 348: 37(ptr) AccessChain 289(u64v) 217 + 349: 36(int) Load 348 + 350: 37(ptr) AccessChain 289(u64v) 200 + 351: 36(int) Load 350 + 352: 36(int) Select 338 351 349 + Store 291(u64) 352 + 353: 36(int) Load 291(u64) + 354: 130(ivec3) CompositeConstruct 353 353 353 + 355: 36(int) Load 291(u64) + 356: 36(int) SNegate 355 + 357: 130(ivec3) CompositeConstruct 356 356 356 + 360: 130(ivec3) Select 359 357 354 + Store 289(u64v) 360 + 364: 361(fvec3) Load 363(dv) + 365: 93(fvec2) VectorShuffle 364 364 0 1 + 366: 50(ivec2) Bitcast 365 + Store 276(i64v) 366 + 368: 367(ptr) AccessChain 363(dv) 207 + 369: 92(float) Load 368 + 370: 36(int) Bitcast 369 + 371: 37(ptr) AccessChain 289(u64v) 217 + Store 371 370 + 372: 50(ivec2) Load 276(i64v) + 373: 93(fvec2) Bitcast 372 + 374: 361(fvec3) Load 363(dv) + 375: 361(fvec3) VectorShuffle 374 373 3 4 2 + Store 363(dv) 375 + 376: 130(ivec3) Load 289(u64v) + 377: 361(fvec3) Bitcast 376 + Store 363(dv) 377 + 381: 14(int) ExtInst 1(GLSL.std.450) 0(Unknown) 380 + Store 279(i64) 381 + 383: 14(int) Load 279(i64) + 384: 72(ivec2) ExtInst 1(GLSL.std.450) 0(Unknown) 383 + Store 382(iv) 384 + 386: 36(int) ExtInst 1(GLSL.std.450) 0(Unknown) 385 + Store 291(u64) 386 + 388: 36(int) Load 291(u64) + 389: 79(ivec2) ExtInst 1(GLSL.std.450) 0(Unknown) 388 + Store 387(uv) 389 + 392: 130(ivec3) Load 289(u64v) + 393: 36(int) Load 291(u64) + 394: 130(ivec3) CompositeConstruct 393 393 393 + 395: 358(bvec3) ULessThan 392 394 + Store 391(bv) 395 + 396: 50(ivec2) Load 276(i64v) + 397: 14(int) Load 279(i64) + 398: 50(ivec2) CompositeConstruct 397 397 + 399: 54(bvec2) SLessThan 396 398 + 400: 358(bvec3) Load 391(bv) + 401: 358(bvec3) VectorShuffle 400 399 3 4 2 + Store 391(bv) 401 + 402: 130(ivec3) Load 289(u64v) + 403: 36(int) Load 291(u64) + 404: 130(ivec3) CompositeConstruct 403 403 403 + 405: 358(bvec3) ULessThanEqual 402 404 + Store 391(bv) 405 + 406: 50(ivec2) Load 276(i64v) + 407: 14(int) Load 279(i64) + 408: 50(ivec2) CompositeConstruct 407 407 + 409: 54(bvec2) SLessThanEqual 406 408 + 410: 358(bvec3) Load 391(bv) + 411: 358(bvec3) VectorShuffle 410 409 3 4 2 + Store 391(bv) 411 + 412: 130(ivec3) Load 289(u64v) + 413: 36(int) Load 291(u64) + 414: 130(ivec3) CompositeConstruct 413 413 413 + 415: 358(bvec3) UGreaterThan 412 414 + Store 391(bv) 415 + 416: 50(ivec2) Load 276(i64v) + 417: 14(int) Load 279(i64) + 418: 50(ivec2) CompositeConstruct 417 417 + 419: 54(bvec2) SGreaterThan 416 418 + 420: 358(bvec3) Load 391(bv) + 421: 358(bvec3) VectorShuffle 420 419 3 4 2 + Store 391(bv) 421 + 422: 130(ivec3) Load 289(u64v) + 423: 36(int) Load 291(u64) + 424: 130(ivec3) CompositeConstruct 423 423 423 + 425: 358(bvec3) UGreaterThanEqual 422 424 + Store 391(bv) 425 + 426: 50(ivec2) Load 276(i64v) + 427: 14(int) Load 279(i64) + 428: 50(ivec2) CompositeConstruct 427 427 + 429: 54(bvec2) SGreaterThanEqual 426 428 + 430: 358(bvec3) Load 391(bv) + 431: 358(bvec3) VectorShuffle 430 429 3 4 2 + Store 391(bv) 431 + 432: 130(ivec3) Load 289(u64v) + 433: 36(int) Load 291(u64) + 434: 130(ivec3) CompositeConstruct 433 433 433 + 435: 358(bvec3) IEqual 432 434 + Store 391(bv) 435 + 436: 50(ivec2) Load 276(i64v) + 437: 14(int) Load 279(i64) + 438: 50(ivec2) CompositeConstruct 437 437 + 439: 54(bvec2) IEqual 436 438 + 440: 358(bvec3) Load 391(bv) + 441: 358(bvec3) VectorShuffle 440 439 3 4 2 + Store 391(bv) 441 + 442: 130(ivec3) Load 289(u64v) + 443: 36(int) Load 291(u64) + 444: 130(ivec3) CompositeConstruct 443 443 443 + 445: 358(bvec3) INotEqual 442 444 + Store 391(bv) 445 + 446: 50(ivec2) Load 276(i64v) + 447: 14(int) Load 279(i64) + 448: 50(ivec2) CompositeConstruct 447 447 + 449: 54(bvec2) INotEqual 446 448 + 450: 358(bvec3) Load 391(bv) + 451: 358(bvec3) VectorShuffle 450 449 3 4 2 + Store 391(bv) 451 + Return + FunctionEnd diff --git a/Test/baseResults/spv.intOps.vert.out b/Test/baseResults/spv.intOps.vert.out index bbab470f..926ab7c6 100644 --- a/Test/baseResults/spv.intOps.vert.out +++ b/Test/baseResults/spv.intOps.vert.out @@ -44,6 +44,12 @@ Linked vertex stage: Name 173 "u3" Name 182 "i3" Name 247 "v4" + Decorate 210 RelaxedPrecision + Decorate 216 RelaxedPrecision + Decorate 223 RelaxedPrecision + Decorate 230 RelaxedPrecision + Decorate 234 RelaxedPrecision + Decorate 240 RelaxedPrecision Decorate 261 RelaxedPrecision Decorate 265 RelaxedPrecision 2: TypeVoid diff --git a/Test/baseResults/spv.localAggregates.frag.out b/Test/baseResults/spv.localAggregates.frag.out index 14f56092..cd8afedc 100755 --- a/Test/baseResults/spv.localAggregates.frag.out +++ b/Test/baseResults/spv.localAggregates.frag.out @@ -66,14 +66,6 @@ Linked fragment stage: MemberName 140(s2) 2 "s1_1" MemberName 140(s2) 3 "bleh" Name 142 "foo2" - MemberDecorate 13(s1) 0 Flat - MemberDecorate 13(s1) 1 Flat - MemberDecorate 14(s2) 0 Flat - MemberDecorate 14(s2) 1 Flat - MemberDecorate 14(s2) 2 Flat - MemberDecorate 14(s2) 3 Flat - MemberDecorate 15(s1) 0 Flat - MemberDecorate 15(s1) 1 Flat MemberDecorate 16(s3) 0 Flat MemberDecorate 16(s3) 1 Flat MemberDecorate 16(s3) 2 Flat @@ -82,8 +74,6 @@ Linked fragment stage: Decorate 131(samp2D) DescriptorSet 0 MemberDecorate 136(s1) 0 Flat MemberDecorate 136(s1) 1 Flat - MemberDecorate 139(s1) 0 Flat - MemberDecorate 139(s1) 1 Flat MemberDecorate 140(s2) 0 Flat MemberDecorate 140(s2) 1 Flat MemberDecorate 140(s2) 2 Flat diff --git a/Test/baseResults/spv.matFun.vert.out b/Test/baseResults/spv.matFun.vert.out index ab487763..0aa0a52d 100755 --- a/Test/baseResults/spv.matFun.vert.out +++ b/Test/baseResults/spv.matFun.vert.out @@ -10,7 +10,6 @@ Linked vertex stage: // Id's are bound by 103 Capability Shader - Capability ClipDistance 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 EntryPoint Vertex 4 "main" 76 81 diff --git a/Test/baseResults/spv.matrix.frag.out b/Test/baseResults/spv.matrix.frag.out index 8f0d6463..7b34fca4 100644 --- a/Test/baseResults/spv.matrix.frag.out +++ b/Test/baseResults/spv.matrix.frag.out @@ -1,30 +1,34 @@ spv.matrix.frag +Warning, version 420 is not yet complete; most version-specific features are present, but some are missing. + Linked fragment stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 240 +// Id's are bound by 261 Capability Shader + Capability Float64 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 12 14 28 140 148 166 + EntryPoint Fragment 4 "main" 12 14 28 161 169 187 ExecutionMode 4 OriginUpperLeft - Source GLSL 140 + Source GLSL 420 Name 4 "main" Name 10 "sum34" Name 12 "m1" Name 14 "m2" Name 28 "f" - Name 138 "sum3" - Name 140 "v4" - Name 145 "sum4" - Name 148 "v3" - Name 153 "m43" - Name 158 "m4" - Name 166 "color" + Name 140 "dm" + Name 159 "sum3" + Name 161 "v4" + Name 166 "sum4" + Name 169 "v3" + Name 174 "m43" + Name 179 "m4" + Name 187 "color" 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -37,27 +41,32 @@ Linked fragment stage: 27: TypePointer Input 6(float) 28(f): 27(ptr) Variable Input 81: 6(float) Constant 1065353216 - 136: TypeVector 6(float) 3 - 137: TypePointer Function 136(fvec3) - 139: TypePointer Input 7(fvec4) - 140(v4): 139(ptr) Variable Input - 144: TypePointer Function 7(fvec4) - 147: TypePointer Input 136(fvec3) - 148(v3): 147(ptr) Variable Input - 151: TypeMatrix 136(fvec3) 4 - 152: TypePointer Function 151 - 156: TypeMatrix 7(fvec4) 4 - 157: TypePointer Function 156 - 165: TypePointer Output 7(fvec4) - 166(color): 165(ptr) Variable Output - 187: 6(float) Constant 0 + 136: TypeFloat 64 + 137: TypeVector 136(float) 4 + 138: TypeMatrix 137(fvec4) 3 + 139: TypePointer Function 138 + 157: TypeVector 6(float) 3 + 158: TypePointer Function 157(fvec3) + 160: TypePointer Input 7(fvec4) + 161(v4): 160(ptr) Variable Input + 165: TypePointer Function 7(fvec4) + 168: TypePointer Input 157(fvec3) + 169(v3): 168(ptr) Variable Input + 172: TypeMatrix 157(fvec3) 4 + 173: TypePointer Function 172 + 177: TypeMatrix 7(fvec4) 4 + 178: TypePointer Function 177 + 186: TypePointer Output 7(fvec4) + 187(color): 186(ptr) Variable Output + 208: 6(float) Constant 0 4(main): 2 Function None 3 5: Label 10(sum34): 9(ptr) Variable Function - 138(sum3): 137(ptr) Variable Function - 145(sum4): 144(ptr) Variable Function - 153(m43): 152(ptr) Variable Function - 158(m4): 157(ptr) Variable Function + 140(dm): 139(ptr) Variable Function + 159(sum3): 158(ptr) Variable Function + 166(sum4): 165(ptr) Variable Function + 174(m43): 173(ptr) Variable Function + 179(m4): 178(ptr) Variable Function 13: 8 Load 12(m1) 15: 8 Load 14(m2) 16: 7(fvec4) CompositeExtract 13 0 @@ -185,102 +194,120 @@ Linked fragment stage: 134: 7(fvec4) FSub 133 128 135: 8 CompositeConstruct 130 132 134 Store 10(sum34) 135 - 141: 7(fvec4) Load 140(v4) - 142: 8 Load 14(m2) - 143: 136(fvec3) VectorTimesMatrix 141 142 - Store 138(sum3) 143 - 146: 8 Load 14(m2) - 149: 136(fvec3) Load 148(v3) - 150: 7(fvec4) MatrixTimesVector 146 149 - Store 145(sum4) 150 - 154: 8 Load 10(sum34) - 155: 151 Transpose 154 - Store 153(m43) 155 - 159: 8 Load 12(m1) - 160: 151 Load 153(m43) - 161: 156 MatrixTimesMatrix 159 160 - Store 158(m4) 161 - 162: 7(fvec4) Load 140(v4) - 163: 156 Load 158(m4) - 164: 7(fvec4) VectorTimesMatrix 162 163 - Store 145(sum4) 164 - 167: 7(fvec4) Load 145(sum4) - Store 166(color) 167 - 168: 8 Load 10(sum34) - 169: 7(fvec4) CompositeConstruct 81 81 81 81 - 170: 7(fvec4) CompositeExtract 168 0 - 171: 7(fvec4) FAdd 170 169 - 172: 7(fvec4) CompositeExtract 168 1 - 173: 7(fvec4) FAdd 172 169 - 174: 7(fvec4) CompositeExtract 168 2 - 175: 7(fvec4) FAdd 174 169 - 176: 8 CompositeConstruct 171 173 175 - Store 10(sum34) 176 - 177: 8 Load 10(sum34) - 178: 7(fvec4) CompositeConstruct 81 81 81 81 - 179: 7(fvec4) CompositeExtract 177 0 - 180: 7(fvec4) FSub 179 178 - 181: 7(fvec4) CompositeExtract 177 1 - 182: 7(fvec4) FSub 181 178 - 183: 7(fvec4) CompositeExtract 177 2 - 184: 7(fvec4) FSub 183 178 - 185: 8 CompositeConstruct 180 182 184 - Store 10(sum34) 185 - 186: 6(float) Load 28(f) - 188: 7(fvec4) CompositeConstruct 186 187 187 187 - 189: 7(fvec4) CompositeConstruct 187 186 187 187 - 190: 7(fvec4) CompositeConstruct 187 187 186 187 - 191: 8 CompositeConstruct 188 189 190 - 192: 8 Load 10(sum34) - 193: 7(fvec4) CompositeExtract 192 0 - 194: 7(fvec4) CompositeExtract 191 0 - 195: 7(fvec4) FAdd 193 194 - 196: 7(fvec4) CompositeExtract 192 1 - 197: 7(fvec4) CompositeExtract 191 1 - 198: 7(fvec4) FAdd 196 197 - 199: 7(fvec4) CompositeExtract 192 2 - 200: 7(fvec4) CompositeExtract 191 2 - 201: 7(fvec4) FAdd 199 200 - 202: 8 CompositeConstruct 195 198 201 - Store 10(sum34) 202 - 203: 136(fvec3) Load 148(v3) - 204: 6(float) Load 28(f) - 205: 136(fvec3) Load 148(v3) - 206: 6(float) Load 28(f) - 207: 136(fvec3) Load 148(v3) - 208: 6(float) Load 28(f) - 209: 6(float) CompositeExtract 203 0 - 210: 6(float) CompositeExtract 203 1 - 211: 6(float) CompositeExtract 203 2 - 212: 6(float) CompositeExtract 205 0 - 213: 6(float) CompositeExtract 205 1 - 214: 6(float) CompositeExtract 205 2 - 215: 6(float) CompositeExtract 207 0 - 216: 6(float) CompositeExtract 207 1 - 217: 6(float) CompositeExtract 207 2 - 218: 7(fvec4) CompositeConstruct 209 210 211 204 - 219: 7(fvec4) CompositeConstruct 212 213 214 206 - 220: 7(fvec4) CompositeConstruct 215 216 217 208 - 221: 8 CompositeConstruct 218 219 220 - 222: 8 Load 10(sum34) - 223: 7(fvec4) CompositeExtract 222 0 - 224: 7(fvec4) CompositeExtract 221 0 - 225: 7(fvec4) FAdd 223 224 - 226: 7(fvec4) CompositeExtract 222 1 - 227: 7(fvec4) CompositeExtract 221 1 - 228: 7(fvec4) FAdd 226 227 - 229: 7(fvec4) CompositeExtract 222 2 - 230: 7(fvec4) CompositeExtract 221 2 - 231: 7(fvec4) FAdd 229 230 - 232: 8 CompositeConstruct 225 228 231 - Store 10(sum34) 232 - 233: 136(fvec3) Load 138(sum3) - 234: 151 Load 153(m43) - 235: 7(fvec4) VectorTimesMatrix 233 234 - 236: 7(fvec4) Load 145(sum4) - 237: 7(fvec4) FAdd 235 236 - 238: 7(fvec4) Load 166(color) - 239: 7(fvec4) FAdd 238 237 - Store 166(color) 239 + 141: 8 Load 10(sum34) + 142: 7(fvec4) CompositeExtract 141 0 + 143: 137(fvec4) FConvert 142 + 144: 7(fvec4) CompositeExtract 141 1 + 145: 137(fvec4) FConvert 144 + 146: 7(fvec4) CompositeExtract 141 2 + 147: 137(fvec4) FConvert 146 + 148: 138 CompositeConstruct 143 145 147 + Store 140(dm) 148 + 149: 138 Load 140(dm) + 150: 137(fvec4) CompositeExtract 149 0 + 151: 7(fvec4) FConvert 150 + 152: 137(fvec4) CompositeExtract 149 1 + 153: 7(fvec4) FConvert 152 + 154: 137(fvec4) CompositeExtract 149 2 + 155: 7(fvec4) FConvert 154 + 156: 8 CompositeConstruct 151 153 155 + Store 10(sum34) 156 + 162: 7(fvec4) Load 161(v4) + 163: 8 Load 14(m2) + 164: 157(fvec3) VectorTimesMatrix 162 163 + Store 159(sum3) 164 + 167: 8 Load 14(m2) + 170: 157(fvec3) Load 169(v3) + 171: 7(fvec4) MatrixTimesVector 167 170 + Store 166(sum4) 171 + 175: 8 Load 10(sum34) + 176: 172 Transpose 175 + Store 174(m43) 176 + 180: 8 Load 12(m1) + 181: 172 Load 174(m43) + 182: 177 MatrixTimesMatrix 180 181 + Store 179(m4) 182 + 183: 7(fvec4) Load 161(v4) + 184: 177 Load 179(m4) + 185: 7(fvec4) VectorTimesMatrix 183 184 + Store 166(sum4) 185 + 188: 7(fvec4) Load 166(sum4) + Store 187(color) 188 + 189: 8 Load 10(sum34) + 190: 7(fvec4) CompositeConstruct 81 81 81 81 + 191: 7(fvec4) CompositeExtract 189 0 + 192: 7(fvec4) FAdd 191 190 + 193: 7(fvec4) CompositeExtract 189 1 + 194: 7(fvec4) FAdd 193 190 + 195: 7(fvec4) CompositeExtract 189 2 + 196: 7(fvec4) FAdd 195 190 + 197: 8 CompositeConstruct 192 194 196 + Store 10(sum34) 197 + 198: 8 Load 10(sum34) + 199: 7(fvec4) CompositeConstruct 81 81 81 81 + 200: 7(fvec4) CompositeExtract 198 0 + 201: 7(fvec4) FSub 200 199 + 202: 7(fvec4) CompositeExtract 198 1 + 203: 7(fvec4) FSub 202 199 + 204: 7(fvec4) CompositeExtract 198 2 + 205: 7(fvec4) FSub 204 199 + 206: 8 CompositeConstruct 201 203 205 + Store 10(sum34) 206 + 207: 6(float) Load 28(f) + 209: 7(fvec4) CompositeConstruct 207 208 208 208 + 210: 7(fvec4) CompositeConstruct 208 207 208 208 + 211: 7(fvec4) CompositeConstruct 208 208 207 208 + 212: 8 CompositeConstruct 209 210 211 + 213: 8 Load 10(sum34) + 214: 7(fvec4) CompositeExtract 213 0 + 215: 7(fvec4) CompositeExtract 212 0 + 216: 7(fvec4) FAdd 214 215 + 217: 7(fvec4) CompositeExtract 213 1 + 218: 7(fvec4) CompositeExtract 212 1 + 219: 7(fvec4) FAdd 217 218 + 220: 7(fvec4) CompositeExtract 213 2 + 221: 7(fvec4) CompositeExtract 212 2 + 222: 7(fvec4) FAdd 220 221 + 223: 8 CompositeConstruct 216 219 222 + Store 10(sum34) 223 + 224: 157(fvec3) Load 169(v3) + 225: 6(float) Load 28(f) + 226: 157(fvec3) Load 169(v3) + 227: 6(float) Load 28(f) + 228: 157(fvec3) Load 169(v3) + 229: 6(float) Load 28(f) + 230: 6(float) CompositeExtract 224 0 + 231: 6(float) CompositeExtract 224 1 + 232: 6(float) CompositeExtract 224 2 + 233: 6(float) CompositeExtract 226 0 + 234: 6(float) CompositeExtract 226 1 + 235: 6(float) CompositeExtract 226 2 + 236: 6(float) CompositeExtract 228 0 + 237: 6(float) CompositeExtract 228 1 + 238: 6(float) CompositeExtract 228 2 + 239: 7(fvec4) CompositeConstruct 230 231 232 225 + 240: 7(fvec4) CompositeConstruct 233 234 235 227 + 241: 7(fvec4) CompositeConstruct 236 237 238 229 + 242: 8 CompositeConstruct 239 240 241 + 243: 8 Load 10(sum34) + 244: 7(fvec4) CompositeExtract 243 0 + 245: 7(fvec4) CompositeExtract 242 0 + 246: 7(fvec4) FAdd 244 245 + 247: 7(fvec4) CompositeExtract 243 1 + 248: 7(fvec4) CompositeExtract 242 1 + 249: 7(fvec4) FAdd 247 248 + 250: 7(fvec4) CompositeExtract 243 2 + 251: 7(fvec4) CompositeExtract 242 2 + 252: 7(fvec4) FAdd 250 251 + 253: 8 CompositeConstruct 246 249 252 + Store 10(sum34) 253 + 254: 157(fvec3) Load 159(sum3) + 255: 172 Load 174(m43) + 256: 7(fvec4) VectorTimesMatrix 254 255 + 257: 7(fvec4) Load 166(sum4) + 258: 7(fvec4) FAdd 256 257 + 259: 7(fvec4) Load 187(color) + 260: 7(fvec4) FAdd 259 258 + Store 187(color) 260 Return FunctionEnd diff --git a/Test/baseResults/spv.newTexture.frag.out b/Test/baseResults/spv.newTexture.frag.out index 1c99ac01..4390e26d 100755 --- a/Test/baseResults/spv.newTexture.frag.out +++ b/Test/baseResults/spv.newTexture.frag.out @@ -7,7 +7,7 @@ Linked fragment stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 278 +// Id's are bound by 282 Capability Shader Capability SampledRect @@ -15,7 +15,7 @@ Linked fragment stage: Capability ImageQuery 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 17 26 29 55 81 84 91 247 277 + EntryPoint Fragment 4 "main" 17 26 29 55 81 84 92 251 281 ExecutionMode 4 OriginUpperLeft Source GLSL 430 Name 4 "main" @@ -31,24 +31,24 @@ Linked fragment stage: Name 64 "s2DShadow" Name 81 "ic3D" Name 84 "ic1D" - Name 91 "ic2D" - Name 100 "sr" - Name 125 "sCube" - Name 136 "s2DArrayShadow" - Name 164 "iv" - Name 168 "is2D" - Name 203 "is3D" - Name 215 "isCube" - Name 227 "is2DArray" - Name 237 "iv2" - Name 241 "sCubeShadow" - Name 247 "FragData" - Name 259 "is2Dms" - Name 263 "us2D" - Name 267 "us3D" - Name 271 "usCube" - Name 275 "us2DArray" - Name 277 "ic4D" + Name 92 "ic2D" + Name 102 "sr" + Name 128 "sCube" + Name 139 "s2DArrayShadow" + Name 167 "iv" + Name 171 "is2D" + Name 206 "is3D" + Name 218 "isCube" + Name 230 "is2DArray" + Name 241 "iv2" + Name 245 "sCubeShadow" + Name 251 "FragData" + Name 263 "is2Dms" + Name 267 "us2D" + Name 271 "us3D" + Name 275 "usCube" + Name 279 "us2DArray" + Name 281 "ic4D" Decorate 13(s2D) DescriptorSet 0 Decorate 23(sCubeArrayShadow) DescriptorSet 0 Decorate 42(s3D) DescriptorSet 0 @@ -56,21 +56,21 @@ Linked fragment stage: Decorate 64(s2DShadow) DescriptorSet 0 Decorate 81(ic3D) Flat Decorate 84(ic1D) Flat - Decorate 91(ic2D) Flat - Decorate 100(sr) DescriptorSet 0 - Decorate 125(sCube) DescriptorSet 0 - Decorate 136(s2DArrayShadow) DescriptorSet 0 - Decorate 168(is2D) DescriptorSet 0 - Decorate 203(is3D) DescriptorSet 0 - Decorate 215(isCube) DescriptorSet 0 - Decorate 227(is2DArray) DescriptorSet 0 - Decorate 241(sCubeShadow) DescriptorSet 0 - Decorate 259(is2Dms) DescriptorSet 0 - Decorate 263(us2D) DescriptorSet 0 - Decorate 267(us3D) DescriptorSet 0 - Decorate 271(usCube) DescriptorSet 0 - Decorate 275(us2DArray) DescriptorSet 0 - Decorate 277(ic4D) Flat + Decorate 92(ic2D) Flat + Decorate 102(sr) DescriptorSet 0 + Decorate 128(sCube) DescriptorSet 0 + Decorate 139(s2DArrayShadow) DescriptorSet 0 + Decorate 171(is2D) DescriptorSet 0 + Decorate 206(is3D) DescriptorSet 0 + Decorate 218(isCube) DescriptorSet 0 + Decorate 230(is2DArray) DescriptorSet 0 + Decorate 245(sCubeShadow) DescriptorSet 0 + Decorate 263(is2Dms) DescriptorSet 0 + Decorate 267(us2D) DescriptorSet 0 + Decorate 271(us3D) DescriptorSet 0 + Decorate 275(usCube) DescriptorSet 0 + Decorate 279(us2DArray) DescriptorSet 0 + Decorate 281(ic4D) Flat 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -119,78 +119,78 @@ Linked fragment stage: 81(ic3D): 80(ptr) Variable Input 83: TypePointer Input 67(int) 84(ic1D): 83(ptr) Variable Input - 90: TypePointer Input 68(ivec2) - 91(ic2D): 90(ptr) Variable Input - 93: 67(int) Constant 4 - 97: TypeImage 6(float) Rect sampled format:Unknown - 98: TypeSampledImage 97 - 99: TypePointer UniformConstant 98 - 100(sr): 99(ptr) Variable UniformConstant - 103: 68(ivec2) ConstantComposite 93 93 - 122: TypeImage 6(float) Cube sampled format:Unknown - 123: TypeSampledImage 122 - 124: TypePointer UniformConstant 123 - 125(sCube): 124(ptr) Variable UniformConstant - 133: TypeImage 6(float) 2D depth array sampled format:Unknown - 134: TypeSampledImage 133 - 135: TypePointer UniformConstant 134 -136(s2DArrayShadow): 135(ptr) Variable UniformConstant - 143: 32(int) Constant 0 - 162: TypeVector 67(int) 4 - 163: TypePointer Function 162(ivec4) - 165: TypeImage 67(int) 2D sampled format:Unknown - 166: TypeSampledImage 165 - 167: TypePointer UniformConstant 166 - 168(is2D): 167(ptr) Variable UniformConstant - 200: TypeImage 67(int) 3D sampled format:Unknown - 201: TypeSampledImage 200 - 202: TypePointer UniformConstant 201 - 203(is3D): 202(ptr) Variable UniformConstant - 206: 6(float) Constant 1082549862 - 212: TypeImage 67(int) Cube sampled format:Unknown - 213: TypeSampledImage 212 - 214: TypePointer UniformConstant 213 - 215(isCube): 214(ptr) Variable UniformConstant - 224: TypeImage 67(int) 2D array sampled format:Unknown - 225: TypeSampledImage 224 - 226: TypePointer UniformConstant 225 - 227(is2DArray): 226(ptr) Variable UniformConstant - 236: TypePointer Function 68(ivec2) - 238: TypeImage 6(float) Cube depth sampled format:Unknown - 239: TypeSampledImage 238 - 240: TypePointer UniformConstant 239 -241(sCubeShadow): 240(ptr) Variable UniformConstant - 243: 67(int) Constant 2 - 246: TypePointer Output 7(fvec4) - 247(FragData): 246(ptr) Variable Output - 251: 6(float) Constant 0 - 256: TypeImage 67(int) 2D multi-sampled sampled format:Unknown - 257: TypeSampledImage 256 - 258: TypePointer UniformConstant 257 - 259(is2Dms): 258(ptr) Variable UniformConstant - 260: TypeImage 32(int) 2D sampled format:Unknown + 91: TypePointer Input 68(ivec2) + 92(ic2D): 91(ptr) Variable Input + 94: 67(int) Constant 4 + 99: TypeImage 6(float) Rect sampled format:Unknown + 100: TypeSampledImage 99 + 101: TypePointer UniformConstant 100 + 102(sr): 101(ptr) Variable UniformConstant + 105: 68(ivec2) ConstantComposite 94 94 + 125: TypeImage 6(float) Cube sampled format:Unknown + 126: TypeSampledImage 125 + 127: TypePointer UniformConstant 126 + 128(sCube): 127(ptr) Variable UniformConstant + 136: TypeImage 6(float) 2D depth array sampled format:Unknown + 137: TypeSampledImage 136 + 138: TypePointer UniformConstant 137 +139(s2DArrayShadow): 138(ptr) Variable UniformConstant + 146: 32(int) Constant 0 + 165: TypeVector 67(int) 4 + 166: TypePointer Function 165(ivec4) + 168: TypeImage 67(int) 2D sampled format:Unknown + 169: TypeSampledImage 168 + 170: TypePointer UniformConstant 169 + 171(is2D): 170(ptr) Variable UniformConstant + 203: TypeImage 67(int) 3D sampled format:Unknown + 204: TypeSampledImage 203 + 205: TypePointer UniformConstant 204 + 206(is3D): 205(ptr) Variable UniformConstant + 209: 6(float) Constant 1082549862 + 215: TypeImage 67(int) Cube sampled format:Unknown + 216: TypeSampledImage 215 + 217: TypePointer UniformConstant 216 + 218(isCube): 217(ptr) Variable UniformConstant + 227: TypeImage 67(int) 2D array sampled format:Unknown + 228: TypeSampledImage 227 + 229: TypePointer UniformConstant 228 + 230(is2DArray): 229(ptr) Variable UniformConstant + 240: TypePointer Function 68(ivec2) + 242: TypeImage 6(float) Cube depth sampled format:Unknown + 243: TypeSampledImage 242 + 244: TypePointer UniformConstant 243 +245(sCubeShadow): 244(ptr) Variable UniformConstant + 247: 67(int) Constant 2 + 250: TypePointer Output 7(fvec4) + 251(FragData): 250(ptr) Variable Output + 255: 6(float) Constant 0 + 260: TypeImage 67(int) 2D multi-sampled sampled format:Unknown 261: TypeSampledImage 260 262: TypePointer UniformConstant 261 - 263(us2D): 262(ptr) Variable UniformConstant - 264: TypeImage 32(int) 3D sampled format:Unknown + 263(is2Dms): 262(ptr) Variable UniformConstant + 264: TypeImage 32(int) 2D sampled format:Unknown 265: TypeSampledImage 264 266: TypePointer UniformConstant 265 - 267(us3D): 266(ptr) Variable UniformConstant - 268: TypeImage 32(int) Cube sampled format:Unknown + 267(us2D): 266(ptr) Variable UniformConstant + 268: TypeImage 32(int) 3D sampled format:Unknown 269: TypeSampledImage 268 270: TypePointer UniformConstant 269 - 271(usCube): 270(ptr) Variable UniformConstant - 272: TypeImage 32(int) 2D array sampled format:Unknown + 271(us3D): 270(ptr) Variable UniformConstant + 272: TypeImage 32(int) Cube sampled format:Unknown 273: TypeSampledImage 272 274: TypePointer UniformConstant 273 - 275(us2DArray): 274(ptr) Variable UniformConstant - 276: TypePointer Input 162(ivec4) - 277(ic4D): 276(ptr) Variable Input + 275(usCube): 274(ptr) Variable UniformConstant + 276: TypeImage 32(int) 2D array sampled format:Unknown + 277: TypeSampledImage 276 + 278: TypePointer UniformConstant 277 + 279(us2DArray): 278(ptr) Variable UniformConstant + 280: TypePointer Input 165(ivec4) + 281(ic4D): 280(ptr) Variable Input 4(main): 2 Function None 3 5: Label 9(v): 8(ptr) Variable Function - 164(iv): 163(ptr) Variable Function - 237(iv2): 236(ptr) Variable Function + 167(iv): 166(ptr) Variable Function + 241(iv2): 240(ptr) Variable Function 14: 11 Load 13(s2D) 18: 15(fvec2) Load 17(c2D) 19: 7(fvec4) ImageSampleImplicitLod 14 18 @@ -229,153 +229,157 @@ Linked fragment stage: 78: 40 Load 42(s3D) 82: 79(ivec3) Load 81(ic3D) 85: 67(int) Load 84(ic1D) - 86: 7(fvec4) ImageFetch 78 82 Lod 85 - 87: 7(fvec4) Load 9(v) - 88: 7(fvec4) FAdd 87 86 - Store 9(v) 88 - 89: 11 Load 13(s2D) - 92: 68(ivec2) Load 91(ic2D) - 94: 7(fvec4) ImageFetch 89 92 Lod ConstOffset 93 70 - 95: 7(fvec4) Load 9(v) - 96: 7(fvec4) FAdd 95 94 - Store 9(v) 96 - 101: 98 Load 100(sr) - 102: 68(ivec2) Load 91(ic2D) - 104: 7(fvec4) ImageFetch 101 102 ConstOffset 103 - 105: 7(fvec4) Load 9(v) - 106: 7(fvec4) FAdd 105 104 - Store 9(v) 106 - 107: 62 Load 64(s2DShadow) - 108: 53(fvec3) Load 55(c3D) - 109: 6(float) Load 29(c1D) - 110: 6(float) CompositeExtract 108 2 - 111: 6(float) ImageSampleDrefExplicitLod 107 108 110 Lod ConstOffset 109 70 - 112: 34(ptr) AccessChain 9(v) 33 - 113: 6(float) Load 112 - 114: 6(float) FAdd 113 111 + 86: 39 Image 78 + 87: 7(fvec4) ImageFetch 86 82 Lod 85 + 88: 7(fvec4) Load 9(v) + 89: 7(fvec4) FAdd 88 87 + Store 9(v) 89 + 90: 11 Load 13(s2D) + 93: 68(ivec2) Load 92(ic2D) + 95: 10 Image 90 + 96: 7(fvec4) ImageFetch 95 93 Lod ConstOffset 94 70 + 97: 7(fvec4) Load 9(v) + 98: 7(fvec4) FAdd 97 96 + Store 9(v) 98 + 103: 100 Load 102(sr) + 104: 68(ivec2) Load 92(ic2D) + 106: 99 Image 103 + 107: 7(fvec4) ImageFetch 106 104 ConstOffset 105 + 108: 7(fvec4) Load 9(v) + 109: 7(fvec4) FAdd 108 107 + Store 9(v) 109 + 110: 62 Load 64(s2DShadow) + 111: 53(fvec3) Load 55(c3D) + 112: 6(float) Load 29(c1D) + 113: 6(float) CompositeExtract 111 2 + 114: 6(float) ImageSampleDrefExplicitLod 110 111 113 Lod ConstOffset 112 70 115: 34(ptr) AccessChain 9(v) 33 - Store 115 114 - 116: 11 Load 13(s2D) - 117: 53(fvec3) Load 55(c3D) - 118: 6(float) Load 29(c1D) - 119: 7(fvec4) ImageSampleProjExplicitLod 116 117 Lod ConstOffset 118 70 - 120: 7(fvec4) Load 9(v) - 121: 7(fvec4) FAdd 120 119 - Store 9(v) 121 - 126: 123 Load 125(sCube) - 127: 53(fvec3) Load 55(c3D) - 128: 53(fvec3) Load 55(c3D) - 129: 53(fvec3) Load 55(c3D) - 130: 7(fvec4) ImageSampleExplicitLod 126 127 Grad 128 129 - 131: 7(fvec4) Load 9(v) - 132: 7(fvec4) FAdd 131 130 - Store 9(v) 132 - 137: 134 Load 136(s2DArrayShadow) - 138: 7(fvec4) Load 26(c4D) - 139: 15(fvec2) Load 17(c2D) - 140: 15(fvec2) Load 17(c2D) - 141: 6(float) CompositeExtract 138 3 - 142: 6(float) ImageSampleDrefExplicitLod 137 138 141 Grad ConstOffset 139 140 70 - 144: 34(ptr) AccessChain 9(v) 143 - 145: 6(float) Load 144 - 146: 6(float) FAdd 145 142 - 147: 34(ptr) AccessChain 9(v) 143 - Store 147 146 - 148: 40 Load 42(s3D) - 149: 7(fvec4) Load 26(c4D) - 150: 53(fvec3) Load 55(c3D) - 151: 53(fvec3) Load 55(c3D) - 152: 7(fvec4) ImageSampleProjExplicitLod 148 149 Grad 150 151 - 153: 7(fvec4) Load 9(v) - 154: 7(fvec4) FAdd 153 152 - Store 9(v) 154 - 155: 11 Load 13(s2D) - 156: 53(fvec3) Load 55(c3D) - 157: 15(fvec2) Load 17(c2D) - 158: 15(fvec2) Load 17(c2D) - 159: 7(fvec4) ImageSampleProjExplicitLod 155 156 Grad ConstOffset 157 158 70 - 160: 7(fvec4) Load 9(v) - 161: 7(fvec4) FAdd 160 159 - Store 9(v) 161 - 169: 166 Load 168(is2D) - 170: 15(fvec2) Load 17(c2D) - 171: 162(ivec4) ImageSampleImplicitLod 169 170 - Store 164(iv) 171 - 172: 162(ivec4) Load 164(iv) - 173: 7(fvec4) ConvertSToF 172 - 174: 7(fvec4) Load 9(v) - 175: 7(fvec4) FAdd 174 173 - Store 9(v) 175 - 176: 166 Load 168(is2D) - 177: 7(fvec4) Load 26(c4D) - 178: 162(ivec4) ImageSampleProjImplicitLod 176 177 ConstOffset 70 - Store 164(iv) 178 - 179: 162(ivec4) Load 164(iv) - 180: 7(fvec4) ConvertSToF 179 - 181: 7(fvec4) Load 9(v) - 182: 7(fvec4) FAdd 181 180 - Store 9(v) 182 - 183: 166 Load 168(is2D) - 184: 53(fvec3) Load 55(c3D) - 185: 6(float) Load 29(c1D) - 186: 162(ivec4) ImageSampleProjExplicitLod 183 184 Lod 185 - Store 164(iv) 186 - 187: 162(ivec4) Load 164(iv) - 188: 7(fvec4) ConvertSToF 187 - 189: 7(fvec4) Load 9(v) - 190: 7(fvec4) FAdd 189 188 - Store 9(v) 190 - 191: 166 Load 168(is2D) - 192: 53(fvec3) Load 55(c3D) - 193: 15(fvec2) Load 17(c2D) - 194: 15(fvec2) Load 17(c2D) - 195: 162(ivec4) ImageSampleProjExplicitLod 191 192 Grad 193 194 - Store 164(iv) 195 - 196: 162(ivec4) Load 164(iv) - 197: 7(fvec4) ConvertSToF 196 - 198: 7(fvec4) Load 9(v) - 199: 7(fvec4) FAdd 198 197 - Store 9(v) 199 - 204: 201 Load 203(is3D) - 205: 53(fvec3) Load 55(c3D) - 207: 162(ivec4) ImageSampleImplicitLod 204 205 Bias 206 - Store 164(iv) 207 - 208: 162(ivec4) Load 164(iv) - 209: 7(fvec4) ConvertSToF 208 - 210: 7(fvec4) Load 9(v) - 211: 7(fvec4) FAdd 210 209 - Store 9(v) 211 - 216: 213 Load 215(isCube) - 217: 53(fvec3) Load 55(c3D) - 218: 6(float) Load 29(c1D) - 219: 162(ivec4) ImageSampleExplicitLod 216 217 Lod 218 - Store 164(iv) 219 - 220: 162(ivec4) Load 164(iv) - 221: 7(fvec4) ConvertSToF 220 - 222: 7(fvec4) Load 9(v) - 223: 7(fvec4) FAdd 222 221 - Store 9(v) 223 - 228: 225 Load 227(is2DArray) - 229: 79(ivec3) Load 81(ic3D) - 230: 67(int) Load 84(ic1D) - 231: 162(ivec4) ImageFetch 228 229 Lod 230 - Store 164(iv) 231 - 232: 162(ivec4) Load 164(iv) - 233: 7(fvec4) ConvertSToF 232 - 234: 7(fvec4) Load 9(v) - 235: 7(fvec4) FAdd 234 233 - Store 9(v) 235 - 242: 239 Load 241(sCubeShadow) - 244: 238 Image 242 - 245: 68(ivec2) ImageQuerySizeLod 244 243 - Store 237(iv2) 245 - 248: 7(fvec4) Load 9(v) - 249: 68(ivec2) Load 237(iv2) - 250: 15(fvec2) ConvertSToF 249 - 252: 6(float) CompositeExtract 250 0 - 253: 6(float) CompositeExtract 250 1 - 254: 7(fvec4) CompositeConstruct 252 253 251 251 - 255: 7(fvec4) FAdd 248 254 - Store 247(FragData) 255 + 116: 6(float) Load 115 + 117: 6(float) FAdd 116 114 + 118: 34(ptr) AccessChain 9(v) 33 + Store 118 117 + 119: 11 Load 13(s2D) + 120: 53(fvec3) Load 55(c3D) + 121: 6(float) Load 29(c1D) + 122: 7(fvec4) ImageSampleProjExplicitLod 119 120 Lod ConstOffset 121 70 + 123: 7(fvec4) Load 9(v) + 124: 7(fvec4) FAdd 123 122 + Store 9(v) 124 + 129: 126 Load 128(sCube) + 130: 53(fvec3) Load 55(c3D) + 131: 53(fvec3) Load 55(c3D) + 132: 53(fvec3) Load 55(c3D) + 133: 7(fvec4) ImageSampleExplicitLod 129 130 Grad 131 132 + 134: 7(fvec4) Load 9(v) + 135: 7(fvec4) FAdd 134 133 + Store 9(v) 135 + 140: 137 Load 139(s2DArrayShadow) + 141: 7(fvec4) Load 26(c4D) + 142: 15(fvec2) Load 17(c2D) + 143: 15(fvec2) Load 17(c2D) + 144: 6(float) CompositeExtract 141 3 + 145: 6(float) ImageSampleDrefExplicitLod 140 141 144 Grad ConstOffset 142 143 70 + 147: 34(ptr) AccessChain 9(v) 146 + 148: 6(float) Load 147 + 149: 6(float) FAdd 148 145 + 150: 34(ptr) AccessChain 9(v) 146 + Store 150 149 + 151: 40 Load 42(s3D) + 152: 7(fvec4) Load 26(c4D) + 153: 53(fvec3) Load 55(c3D) + 154: 53(fvec3) Load 55(c3D) + 155: 7(fvec4) ImageSampleProjExplicitLod 151 152 Grad 153 154 + 156: 7(fvec4) Load 9(v) + 157: 7(fvec4) FAdd 156 155 + Store 9(v) 157 + 158: 11 Load 13(s2D) + 159: 53(fvec3) Load 55(c3D) + 160: 15(fvec2) Load 17(c2D) + 161: 15(fvec2) Load 17(c2D) + 162: 7(fvec4) ImageSampleProjExplicitLod 158 159 Grad ConstOffset 160 161 70 + 163: 7(fvec4) Load 9(v) + 164: 7(fvec4) FAdd 163 162 + Store 9(v) 164 + 172: 169 Load 171(is2D) + 173: 15(fvec2) Load 17(c2D) + 174: 165(ivec4) ImageSampleImplicitLod 172 173 + Store 167(iv) 174 + 175: 165(ivec4) Load 167(iv) + 176: 7(fvec4) ConvertSToF 175 + 177: 7(fvec4) Load 9(v) + 178: 7(fvec4) FAdd 177 176 + Store 9(v) 178 + 179: 169 Load 171(is2D) + 180: 7(fvec4) Load 26(c4D) + 181: 165(ivec4) ImageSampleProjImplicitLod 179 180 ConstOffset 70 + Store 167(iv) 181 + 182: 165(ivec4) Load 167(iv) + 183: 7(fvec4) ConvertSToF 182 + 184: 7(fvec4) Load 9(v) + 185: 7(fvec4) FAdd 184 183 + Store 9(v) 185 + 186: 169 Load 171(is2D) + 187: 53(fvec3) Load 55(c3D) + 188: 6(float) Load 29(c1D) + 189: 165(ivec4) ImageSampleProjExplicitLod 186 187 Lod 188 + Store 167(iv) 189 + 190: 165(ivec4) Load 167(iv) + 191: 7(fvec4) ConvertSToF 190 + 192: 7(fvec4) Load 9(v) + 193: 7(fvec4) FAdd 192 191 + Store 9(v) 193 + 194: 169 Load 171(is2D) + 195: 53(fvec3) Load 55(c3D) + 196: 15(fvec2) Load 17(c2D) + 197: 15(fvec2) Load 17(c2D) + 198: 165(ivec4) ImageSampleProjExplicitLod 194 195 Grad 196 197 + Store 167(iv) 198 + 199: 165(ivec4) Load 167(iv) + 200: 7(fvec4) ConvertSToF 199 + 201: 7(fvec4) Load 9(v) + 202: 7(fvec4) FAdd 201 200 + Store 9(v) 202 + 207: 204 Load 206(is3D) + 208: 53(fvec3) Load 55(c3D) + 210: 165(ivec4) ImageSampleImplicitLod 207 208 Bias 209 + Store 167(iv) 210 + 211: 165(ivec4) Load 167(iv) + 212: 7(fvec4) ConvertSToF 211 + 213: 7(fvec4) Load 9(v) + 214: 7(fvec4) FAdd 213 212 + Store 9(v) 214 + 219: 216 Load 218(isCube) + 220: 53(fvec3) Load 55(c3D) + 221: 6(float) Load 29(c1D) + 222: 165(ivec4) ImageSampleExplicitLod 219 220 Lod 221 + Store 167(iv) 222 + 223: 165(ivec4) Load 167(iv) + 224: 7(fvec4) ConvertSToF 223 + 225: 7(fvec4) Load 9(v) + 226: 7(fvec4) FAdd 225 224 + Store 9(v) 226 + 231: 228 Load 230(is2DArray) + 232: 79(ivec3) Load 81(ic3D) + 233: 67(int) Load 84(ic1D) + 234: 227 Image 231 + 235: 165(ivec4) ImageFetch 234 232 Lod 233 + Store 167(iv) 235 + 236: 165(ivec4) Load 167(iv) + 237: 7(fvec4) ConvertSToF 236 + 238: 7(fvec4) Load 9(v) + 239: 7(fvec4) FAdd 238 237 + Store 9(v) 239 + 246: 243 Load 245(sCubeShadow) + 248: 242 Image 246 + 249: 68(ivec2) ImageQuerySizeLod 248 247 + Store 241(iv2) 249 + 252: 7(fvec4) Load 9(v) + 253: 68(ivec2) Load 241(iv2) + 254: 15(fvec2) ConvertSToF 253 + 256: 6(float) CompositeExtract 254 0 + 257: 6(float) CompositeExtract 254 1 + 258: 7(fvec4) CompositeConstruct 256 257 255 255 + 259: 7(fvec4) FAdd 252 258 + Store 251(FragData) 259 Return FunctionEnd diff --git a/Test/baseResults/spv.precise.tesc.out b/Test/baseResults/spv.precise.tesc.out new file mode 100644 index 00000000..0331a14a --- /dev/null +++ b/Test/baseResults/spv.precise.tesc.out @@ -0,0 +1,122 @@ +spv.precise.tesc +Warning, version 310 is not yet complete; most version-specific features are present, but some are missing. + + +Linked tessellation control stage: + + +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 72 + + Capability Tessellation + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint TessellationControl 4 "main" 12 15 20 30 40 45 + ExecutionMode 4 OutputVertices 3 + Source ESSL 310 + SourceExtension "GL_EXT_gpu_shader5" + SourceExtension "GL_EXT_shader_io_blocks" + SourceExtension "GL_EXT_tessellation_shader" + Name 4 "main" + Name 12 "in_te_position" + Name 15 "gl_InvocationID" + Name 20 "in_tc_position" + Name 30 "gl_TessLevelInner" + Name 40 "gl_TessLevelOuter" + Name 45 "in_tc_tessParam" + Decorate 12(in_te_position) Location 0 + Decorate 15(gl_InvocationID) BuiltIn InvocationId + Decorate 20(in_tc_position) Location 0 + Decorate 30(gl_TessLevelInner) Patch + Decorate 30(gl_TessLevelInner) BuiltIn TessLevelInner + Decorate 40(gl_TessLevelOuter) Patch + Decorate 40(gl_TessLevelOuter) BuiltIn TessLevelOuter + Decorate 45(in_tc_tessParam) Location 1 + Decorate 52 NoContraction + Decorate 53 NoContraction + Decorate 54 NoContraction + Decorate 60 NoContraction + Decorate 61 NoContraction + Decorate 62 NoContraction + Decorate 68 NoContraction + Decorate 69 NoContraction + Decorate 70 NoContraction + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 2 + 8: TypeInt 32 0 + 9: 8(int) Constant 3 + 10: TypeArray 7(fvec2) 9 + 11: TypePointer Output 10 +12(in_te_position): 11(ptr) Variable Output + 13: TypeInt 32 1 + 14: TypePointer Input 13(int) +15(gl_InvocationID): 14(ptr) Variable Input + 17: 8(int) Constant 32 + 18: TypeArray 7(fvec2) 17 + 19: TypePointer Input 18 +20(in_tc_position): 19(ptr) Variable Input + 22: TypePointer Input 7(fvec2) + 25: TypePointer Output 7(fvec2) + 27: 8(int) Constant 2 + 28: TypeArray 6(float) 27 + 29: TypePointer Output 28 +30(gl_TessLevelInner): 29(ptr) Variable Output + 31: 13(int) Constant 0 + 32: 6(float) Constant 1084227584 + 33: TypePointer Output 6(float) + 35: 13(int) Constant 1 + 37: 8(int) Constant 4 + 38: TypeArray 6(float) 37 + 39: TypePointer Output 38 +40(gl_TessLevelOuter): 39(ptr) Variable Output + 41: 6(float) Constant 1065353216 + 42: 6(float) Constant 1105985536 + 43: TypeArray 6(float) 17 + 44: TypePointer Input 43 +45(in_tc_tessParam): 44(ptr) Variable Input + 46: TypePointer Input 6(float) + 49: 13(int) Constant 2 + 4(main): 2 Function None 3 + 5: Label + 16: 13(int) Load 15(gl_InvocationID) + 21: 13(int) Load 15(gl_InvocationID) + 23: 22(ptr) AccessChain 20(in_tc_position) 21 + 24: 7(fvec2) Load 23 + 26: 25(ptr) AccessChain 12(in_te_position) 16 + Store 26 24 + 34: 33(ptr) AccessChain 30(gl_TessLevelInner) 31 + Store 34 32 + 36: 33(ptr) AccessChain 30(gl_TessLevelInner) 35 + Store 36 32 + 47: 46(ptr) AccessChain 45(in_tc_tessParam) 35 + 48: 6(float) Load 47 + 50: 46(ptr) AccessChain 45(in_tc_tessParam) 49 + 51: 6(float) Load 50 + 52: 6(float) FAdd 48 51 + 53: 6(float) FMul 42 52 + 54: 6(float) FAdd 41 53 + 55: 33(ptr) AccessChain 40(gl_TessLevelOuter) 31 + Store 55 54 + 56: 46(ptr) AccessChain 45(in_tc_tessParam) 49 + 57: 6(float) Load 56 + 58: 46(ptr) AccessChain 45(in_tc_tessParam) 31 + 59: 6(float) Load 58 + 60: 6(float) FAdd 57 59 + 61: 6(float) FMul 42 60 + 62: 6(float) FAdd 41 61 + 63: 33(ptr) AccessChain 40(gl_TessLevelOuter) 35 + Store 63 62 + 64: 46(ptr) AccessChain 45(in_tc_tessParam) 31 + 65: 6(float) Load 64 + 66: 46(ptr) AccessChain 45(in_tc_tessParam) 35 + 67: 6(float) Load 66 + 68: 6(float) FAdd 65 67 + 69: 6(float) FMul 42 68 + 70: 6(float) FAdd 41 69 + 71: 33(ptr) AccessChain 40(gl_TessLevelOuter) 49 + Store 71 70 + Return + FunctionEnd diff --git a/Test/baseResults/spv.precise.tese.out b/Test/baseResults/spv.precise.tese.out new file mode 100644 index 00000000..231ea333 --- /dev/null +++ b/Test/baseResults/spv.precise.tese.out @@ -0,0 +1,192 @@ +spv.precise.tese +Warning, version 310 is not yet complete; most version-specific features are present, but some are missing. + + +Linked tessellation evaluation stage: + + +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 119 + + Capability Tessellation + Capability TessellationPointSize + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint TessellationEvaluation 4 "main" 12 21 62 112 + ExecutionMode 4 Triangles + ExecutionMode 4 SpacingEqual + ExecutionMode 4 VertexOrderCcw + Source ESSL 310 + SourceExtension "GL_EXT_gpu_shader5" + SourceExtension "GL_EXT_shader_io_blocks" + SourceExtension "GL_EXT_tessellation_shader" + Name 4 "main" + Name 9 "pos" + Name 12 "gl_TessCoord" + Name 21 "in_te_position" + Name 45 "f" + Name 62 "in_f_color" + Name 73 "bits" + Name 77 "numBits" + Name 78 "i" + Name 110 "gl_PerVertex" + MemberName 110(gl_PerVertex) 0 "gl_Position" + MemberName 110(gl_PerVertex) 1 "gl_PointSize" + Name 112 "" + Decorate 12(gl_TessCoord) BuiltIn TessCoord + Decorate 21(in_te_position) Location 0 + Decorate 27 NoContraction + Decorate 34 NoContraction + Decorate 35 NoContraction + Decorate 42 NoContraction + Decorate 43 NoContraction + Decorate 62(in_f_color) RelaxedPrecision + Decorate 62(in_f_color) Location 0 + Decorate 67 RelaxedPrecision + Decorate 68 RelaxedPrecision + Decorate 69 RelaxedPrecision + Decorate 70 RelaxedPrecision + Decorate 97 NoContraction + Decorate 99 NoContraction + Decorate 101 NoContraction + Decorate 106 NoContraction + Decorate 109 NoContraction + MemberDecorate 110(gl_PerVertex) 0 BuiltIn Position + MemberDecorate 110(gl_PerVertex) 1 BuiltIn PointSize + Decorate 110(gl_PerVertex) Block + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: TypeVector 6(float) 2 + 8: TypePointer Function 7(fvec2) + 10: TypeVector 6(float) 3 + 11: TypePointer Input 10(fvec3) +12(gl_TessCoord): 11(ptr) Variable Input + 13: TypeInt 32 0 + 14: 13(int) Constant 0 + 15: TypePointer Input 6(float) + 18: 13(int) Constant 32 + 19: TypeArray 7(fvec2) 18 + 20: TypePointer Input 19 +21(in_te_position): 20(ptr) Variable Input + 22: TypeInt 32 1 + 23: 22(int) Constant 0 + 24: TypePointer Input 7(fvec2) + 28: 13(int) Constant 1 + 31: 22(int) Constant 1 + 36: 13(int) Constant 2 + 39: 22(int) Constant 2 + 44: TypePointer Function 6(float) + 46: 6(float) Constant 1077936128 + 57: 6(float) Constant 1056964608 + 60: TypeVector 6(float) 4 + 61: TypePointer Output 60(fvec4) + 62(in_f_color): 61(ptr) Variable Output + 66: 6(float) Constant 1065353216 + 71: TypeVector 13(int) 2 + 72: TypePointer Function 71(ivec2) + 76: TypePointer Function 13(int) + 85: TypeBool + 105: 6(float) Constant 1025758986 +110(gl_PerVertex): TypeStruct 60(fvec4) 6(float) + 111: TypePointer Output 110(gl_PerVertex) + 112: 111(ptr) Variable Output + 114: 6(float) Constant 0 + 4(main): 2 Function None 3 + 5: Label + 9(pos): 8(ptr) Variable Function + 45(f): 44(ptr) Variable Function + 73(bits): 72(ptr) Variable Function + 77(numBits): 76(ptr) Variable Function + 78(i): 76(ptr) Variable Function + 16: 15(ptr) AccessChain 12(gl_TessCoord) 14 + 17: 6(float) Load 16 + 25: 24(ptr) AccessChain 21(in_te_position) 23 + 26: 7(fvec2) Load 25 + 27: 7(fvec2) VectorTimesScalar 26 17 + 29: 15(ptr) AccessChain 12(gl_TessCoord) 28 + 30: 6(float) Load 29 + 32: 24(ptr) AccessChain 21(in_te_position) 31 + 33: 7(fvec2) Load 32 + 34: 7(fvec2) VectorTimesScalar 33 30 + 35: 7(fvec2) FAdd 27 34 + 37: 15(ptr) AccessChain 12(gl_TessCoord) 36 + 38: 6(float) Load 37 + 40: 24(ptr) AccessChain 21(in_te_position) 39 + 41: 7(fvec2) Load 40 + 42: 7(fvec2) VectorTimesScalar 41 38 + 43: 7(fvec2) FAdd 35 42 + Store 9(pos) 43 + 47: 15(ptr) AccessChain 12(gl_TessCoord) 14 + 48: 6(float) Load 47 + 49: 15(ptr) AccessChain 12(gl_TessCoord) 28 + 50: 6(float) Load 49 + 51: 15(ptr) AccessChain 12(gl_TessCoord) 36 + 52: 6(float) Load 51 + 53: 6(float) ExtInst 1(GLSL.std.450) 37(FMin) 50 52 + 54: 6(float) ExtInst 1(GLSL.std.450) 37(FMin) 48 53 + 55: 6(float) FMul 46 54 + 56: 6(float) ExtInst 1(GLSL.std.450) 31(Sqrt) 55 + 58: 6(float) FMul 56 57 + 59: 6(float) FAdd 58 57 + Store 45(f) 59 + 63: 10(fvec3) Load 12(gl_TessCoord) + 64: 6(float) Load 45(f) + 65: 10(fvec3) VectorTimesScalar 63 64 + 67: 6(float) CompositeExtract 65 0 + 68: 6(float) CompositeExtract 65 1 + 69: 6(float) CompositeExtract 65 2 + 70: 60(fvec4) CompositeConstruct 67 68 69 66 + Store 62(in_f_color) 70 + 74: 7(fvec2) Load 9(pos) + 75: 71(ivec2) Bitcast 74 + Store 73(bits) 75 + Store 77(numBits) 14 + Store 78(i) 14 + Branch 79 + 79: Label + LoopMerge 81 82 None + Branch 83 + 83: Label + 84: 13(int) Load 78(i) + 86: 85(bool) ULessThan 84 18 + BranchConditional 86 80 81 + 80: Label + 87: 76(ptr) AccessChain 73(bits) 14 + 88: 13(int) Load 87 + 89: 13(int) Load 78(i) + 90: 13(int) ShiftLeftLogical 88 89 + 91: 13(int) BitwiseAnd 90 28 + 92: 76(ptr) AccessChain 73(bits) 28 + 93: 13(int) Load 92 + 94: 13(int) Load 78(i) + 95: 13(int) ShiftLeftLogical 93 94 + 96: 13(int) BitwiseAnd 95 28 + 97: 13(int) IAdd 91 96 + 98: 13(int) Load 77(numBits) + 99: 13(int) IAdd 98 97 + Store 77(numBits) 99 + Branch 82 + 82: Label + 100: 13(int) Load 78(i) + 101: 13(int) IAdd 100 31 + Store 78(i) 101 + Branch 79 + 81: Label + 102: 13(int) Load 77(numBits) + 103: 13(int) BitwiseAnd 102 28 + 104: 6(float) ConvertUToF 103 + 106: 6(float) FMul 104 105 + 107: 7(fvec2) Load 9(pos) + 108: 7(fvec2) CompositeConstruct 106 106 + 109: 7(fvec2) FAdd 107 108 + Store 9(pos) 109 + 113: 7(fvec2) Load 9(pos) + 115: 6(float) CompositeExtract 113 0 + 116: 6(float) CompositeExtract 113 1 + 117: 60(fvec4) CompositeConstruct 115 116 114 66 + 118: 61(ptr) AccessChain 112 23 + Store 118 117 + Return + FunctionEnd diff --git a/Test/baseResults/spv.qualifiers.vert.out b/Test/baseResults/spv.qualifiers.vert.out index bedd6912..d2baf722 100755 --- a/Test/baseResults/spv.qualifiers.vert.out +++ b/Test/baseResults/spv.qualifiers.vert.out @@ -21,9 +21,11 @@ Linked vertex stage: Name 15 "outVf" Name 17 "outVn" Name 19 "outVcn" + Decorate 9(outVc) Centroid Decorate 15(outVf) Flat Decorate 17(outVn) NoPerspective Decorate 19(outVcn) NoPerspective + Decorate 19(outVcn) Centroid 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 diff --git a/Test/baseResults/spv.shaderBallot.comp.out b/Test/baseResults/spv.shaderBallot.comp.out new file mode 100644 index 00000000..cb2e0130 --- /dev/null +++ b/Test/baseResults/spv.shaderBallot.comp.out @@ -0,0 +1,314 @@ +spv.shaderBallot.comp +Warning, version 450 is not yet complete; most version-specific features are present, but some are missing. + + +Linked compute stage: + + +Missing functionality: shader ballot +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 241 + + Capability Shader + Capability Int64 + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint GLCompute 4 "main" 10 22 24 27 30 33 + ExecutionMode 4 LocalSize 8 8 1 + Source GLSL 450 + SourceExtension "GL_ARB_gpu_shader_int64" + SourceExtension "GL_ARB_shader_ballot" + Name 4 "main" + Name 8 "invocation" + Name 10 "gl_SubGroupInvocationARB" + Name 13 "gl_SubGroupSizeARB" + Name 20 "relMask" + Name 22 "gl_SubGroupEqMaskARB" + Name 24 "gl_SubGroupGeMaskARB" + Name 27 "gl_SubGroupGtMaskARB" + Name 30 "gl_SubGroupLeMaskARB" + Name 33 "gl_SubGroupLtMaskARB" + Name 48 "Buffers" + MemberName 48(Buffers) 0 "f4" + MemberName 48(Buffers) 1 "i4" + MemberName 48(Buffers) 2 "u4" + Name 51 "data" + MemberDecorate 48(Buffers) 0 Offset 0 + MemberDecorate 48(Buffers) 1 Offset 16 + MemberDecorate 48(Buffers) 2 Offset 32 + Decorate 48(Buffers) BufferBlock + Decorate 51(data) DescriptorSet 0 + Decorate 51(data) Binding 0 + Decorate 240 BuiltIn WorkgroupSize + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 0 + 7: TypePointer Function 6(int) + 9: TypePointer Input 6(int) +10(gl_SubGroupInvocationARB): 9(ptr) Variable Input + 12: TypePointer UniformConstant 6(int) +13(gl_SubGroupSizeARB): 12(ptr) Variable UniformConstant + 16: 6(int) Constant 4 + 18: TypeInt 64 0 + 19: TypePointer Function 18(int) + 21: TypePointer Input 18(int) +22(gl_SubGroupEqMaskARB): 21(ptr) Variable Input +24(gl_SubGroupGeMaskARB): 21(ptr) Variable Input +27(gl_SubGroupGtMaskARB): 21(ptr) Variable Input +30(gl_SubGroupLeMaskARB): 21(ptr) Variable Input +33(gl_SubGroupLtMaskARB): 21(ptr) Variable Input + 37: TypeBool + 38: 37(bool) ConstantTrue + 43: TypeFloat 32 + 44: TypeVector 43(float) 4 + 45: TypeInt 32 1 + 46: TypeVector 45(int) 4 + 47: TypeVector 6(int) 4 + 48(Buffers): TypeStruct 44(fvec4) 46(ivec4) 47(ivec4) + 49: TypeArray 48(Buffers) 16 + 50: TypePointer Uniform 49 + 51(data): 50(ptr) Variable Uniform + 53: 45(int) Constant 0 + 54: 6(int) Constant 0 + 55: TypePointer Uniform 43(float) + 62: 45(int) Constant 1 + 63: TypeVector 43(float) 2 + 64: TypePointer Uniform 44(fvec4) + 74: 45(int) Constant 2 + 75: TypeVector 43(float) 3 + 85: 45(int) Constant 3 + 92: TypePointer Uniform 45(int) + 99: TypeVector 45(int) 2 + 100: TypePointer Uniform 46(ivec4) + 110: TypeVector 45(int) 3 + 126: TypePointer Uniform 6(int) + 133: TypeVector 6(int) 2 + 134: TypePointer Uniform 47(ivec4) + 144: TypeVector 6(int) 3 + 238: 6(int) Constant 8 + 239: 6(int) Constant 1 + 240: 144(ivec3) ConstantComposite 238 238 239 + 4(main): 2 Function None 3 + 5: Label + 8(invocation): 7(ptr) Variable Function + 20(relMask): 19(ptr) Variable Function + 11: 6(int) Load 10(gl_SubGroupInvocationARB) + 14: 6(int) Load 13(gl_SubGroupSizeARB) + 15: 6(int) IAdd 11 14 + 17: 6(int) UMod 15 16 + Store 8(invocation) 17 + 23: 18(int) Load 22(gl_SubGroupEqMaskARB) + 25: 18(int) Load 24(gl_SubGroupGeMaskARB) + 26: 18(int) IAdd 23 25 + 28: 18(int) Load 27(gl_SubGroupGtMaskARB) + 29: 18(int) IAdd 26 28 + 31: 18(int) Load 30(gl_SubGroupLeMaskARB) + 32: 18(int) IAdd 29 31 + 34: 18(int) Load 33(gl_SubGroupLtMaskARB) + 35: 18(int) IAdd 32 34 + Store 20(relMask) 35 + 36: 18(int) Load 20(relMask) + 39: 18(int) ExtInst 1(GLSL.std.450) 0(Unknown) 38 + 40: 37(bool) IEqual 36 39 + SelectionMerge 42 None + BranchConditional 40 41 159 + 41: Label + 52: 6(int) Load 8(invocation) + 56: 55(ptr) AccessChain 51(data) 53 53 54 + 57: 43(float) Load 56 + 58: 6(int) Load 8(invocation) + 59: 43(float) ExtInst 1(GLSL.std.450) 0(Unknown) 57 58 + 60: 55(ptr) AccessChain 51(data) 52 53 54 + Store 60 59 + 61: 6(int) Load 8(invocation) + 65: 64(ptr) AccessChain 51(data) 62 53 + 66: 44(fvec4) Load 65 + 67: 63(fvec2) VectorShuffle 66 66 0 1 + 68: 6(int) Load 8(invocation) + 69: 63(fvec2) ExtInst 1(GLSL.std.450) 0(Unknown) 67 68 + 70: 64(ptr) AccessChain 51(data) 61 53 + 71: 44(fvec4) Load 70 + 72: 44(fvec4) VectorShuffle 71 69 4 5 2 3 + Store 70 72 + 73: 6(int) Load 8(invocation) + 76: 64(ptr) AccessChain 51(data) 74 53 + 77: 44(fvec4) Load 76 + 78: 75(fvec3) VectorShuffle 77 77 0 1 2 + 79: 6(int) Load 8(invocation) + 80: 75(fvec3) ExtInst 1(GLSL.std.450) 0(Unknown) 78 79 + 81: 64(ptr) AccessChain 51(data) 73 53 + 82: 44(fvec4) Load 81 + 83: 44(fvec4) VectorShuffle 82 80 4 5 6 3 + Store 81 83 + 84: 6(int) Load 8(invocation) + 86: 64(ptr) AccessChain 51(data) 85 53 + 87: 44(fvec4) Load 86 + 88: 6(int) Load 8(invocation) + 89: 44(fvec4) ExtInst 1(GLSL.std.450) 0(Unknown) 87 88 + 90: 64(ptr) AccessChain 51(data) 84 53 + Store 90 89 + 91: 6(int) Load 8(invocation) + 93: 92(ptr) AccessChain 51(data) 53 62 54 + 94: 45(int) Load 93 + 95: 6(int) Load 8(invocation) + 96: 45(int) ExtInst 1(GLSL.std.450) 0(Unknown) 94 95 + 97: 92(ptr) AccessChain 51(data) 91 62 54 + Store 97 96 + 98: 6(int) Load 8(invocation) + 101: 100(ptr) AccessChain 51(data) 62 62 + 102: 46(ivec4) Load 101 + 103: 99(ivec2) VectorShuffle 102 102 0 1 + 104: 6(int) Load 8(invocation) + 105: 99(ivec2) ExtInst 1(GLSL.std.450) 0(Unknown) 103 104 + 106: 100(ptr) AccessChain 51(data) 98 62 + 107: 46(ivec4) Load 106 + 108: 46(ivec4) VectorShuffle 107 105 4 5 2 3 + Store 106 108 + 109: 6(int) Load 8(invocation) + 111: 100(ptr) AccessChain 51(data) 74 62 + 112: 46(ivec4) Load 111 + 113: 110(ivec3) VectorShuffle 112 112 0 1 2 + 114: 6(int) Load 8(invocation) + 115: 110(ivec3) ExtInst 1(GLSL.std.450) 0(Unknown) 113 114 + 116: 100(ptr) AccessChain 51(data) 109 62 + 117: 46(ivec4) Load 116 + 118: 46(ivec4) VectorShuffle 117 115 4 5 6 3 + Store 116 118 + 119: 6(int) Load 8(invocation) + 120: 100(ptr) AccessChain 51(data) 85 62 + 121: 46(ivec4) Load 120 + 122: 6(int) Load 8(invocation) + 123: 46(ivec4) ExtInst 1(GLSL.std.450) 0(Unknown) 121 122 + 124: 100(ptr) AccessChain 51(data) 119 62 + Store 124 123 + 125: 6(int) Load 8(invocation) + 127: 126(ptr) AccessChain 51(data) 53 74 54 + 128: 6(int) Load 127 + 129: 6(int) Load 8(invocation) + 130: 6(int) ExtInst 1(GLSL.std.450) 0(Unknown) 128 129 + 131: 126(ptr) AccessChain 51(data) 125 74 54 + Store 131 130 + 132: 6(int) Load 8(invocation) + 135: 134(ptr) AccessChain 51(data) 62 74 + 136: 47(ivec4) Load 135 + 137: 133(ivec2) VectorShuffle 136 136 0 1 + 138: 6(int) Load 8(invocation) + 139: 133(ivec2) ExtInst 1(GLSL.std.450) 0(Unknown) 137 138 + 140: 134(ptr) AccessChain 51(data) 132 74 + 141: 47(ivec4) Load 140 + 142: 47(ivec4) VectorShuffle 141 139 4 5 2 3 + Store 140 142 + 143: 6(int) Load 8(invocation) + 145: 134(ptr) AccessChain 51(data) 74 74 + 146: 47(ivec4) Load 145 + 147: 144(ivec3) VectorShuffle 146 146 0 1 2 + 148: 6(int) Load 8(invocation) + 149: 144(ivec3) ExtInst 1(GLSL.std.450) 0(Unknown) 147 148 + 150: 134(ptr) AccessChain 51(data) 143 74 + 151: 47(ivec4) Load 150 + 152: 47(ivec4) VectorShuffle 151 149 4 5 6 3 + Store 150 152 + 153: 6(int) Load 8(invocation) + 154: 134(ptr) AccessChain 51(data) 85 74 + 155: 47(ivec4) Load 154 + 156: 6(int) Load 8(invocation) + 157: 47(ivec4) ExtInst 1(GLSL.std.450) 0(Unknown) 155 156 + 158: 134(ptr) AccessChain 51(data) 153 74 + Store 158 157 + Branch 42 + 159: Label + 160: 6(int) Load 8(invocation) + 161: 55(ptr) AccessChain 51(data) 53 53 54 + 162: 43(float) Load 161 + 163: 43(float) ExtInst 1(GLSL.std.450) 0(Unknown) 162 + 164: 55(ptr) AccessChain 51(data) 160 53 54 + Store 164 163 + 165: 6(int) Load 8(invocation) + 166: 64(ptr) AccessChain 51(data) 62 53 + 167: 44(fvec4) Load 166 + 168: 63(fvec2) VectorShuffle 167 167 0 1 + 169: 63(fvec2) ExtInst 1(GLSL.std.450) 0(Unknown) 168 + 170: 64(ptr) AccessChain 51(data) 165 53 + 171: 44(fvec4) Load 170 + 172: 44(fvec4) VectorShuffle 171 169 4 5 2 3 + Store 170 172 + 173: 6(int) Load 8(invocation) + 174: 64(ptr) AccessChain 51(data) 74 53 + 175: 44(fvec4) Load 174 + 176: 75(fvec3) VectorShuffle 175 175 0 1 2 + 177: 75(fvec3) ExtInst 1(GLSL.std.450) 0(Unknown) 176 + 178: 64(ptr) AccessChain 51(data) 173 53 + 179: 44(fvec4) Load 178 + 180: 44(fvec4) VectorShuffle 179 177 4 5 6 3 + Store 178 180 + 181: 6(int) Load 8(invocation) + 182: 64(ptr) AccessChain 51(data) 85 53 + 183: 44(fvec4) Load 182 + 184: 44(fvec4) ExtInst 1(GLSL.std.450) 0(Unknown) 183 + 185: 64(ptr) AccessChain 51(data) 181 53 + Store 185 184 + 186: 6(int) Load 8(invocation) + 187: 92(ptr) AccessChain 51(data) 53 62 54 + 188: 45(int) Load 187 + 189: 45(int) ExtInst 1(GLSL.std.450) 0(Unknown) 188 + 190: 92(ptr) AccessChain 51(data) 186 62 54 + Store 190 189 + 191: 6(int) Load 8(invocation) + 192: 100(ptr) AccessChain 51(data) 62 62 + 193: 46(ivec4) Load 192 + 194: 99(ivec2) VectorShuffle 193 193 0 1 + 195: 99(ivec2) ExtInst 1(GLSL.std.450) 0(Unknown) 194 + 196: 100(ptr) AccessChain 51(data) 191 62 + 197: 46(ivec4) Load 196 + 198: 46(ivec4) VectorShuffle 197 195 4 5 2 3 + Store 196 198 + 199: 6(int) Load 8(invocation) + 200: 100(ptr) AccessChain 51(data) 74 62 + 201: 46(ivec4) Load 200 + 202: 110(ivec3) VectorShuffle 201 201 0 1 2 + 203: 110(ivec3) ExtInst 1(GLSL.std.450) 0(Unknown) 202 + 204: 100(ptr) AccessChain 51(data) 199 62 + 205: 46(ivec4) Load 204 + 206: 46(ivec4) VectorShuffle 205 203 4 5 6 3 + Store 204 206 + 207: 6(int) Load 8(invocation) + 208: 100(ptr) AccessChain 51(data) 85 62 + 209: 46(ivec4) Load 208 + 210: 46(ivec4) ExtInst 1(GLSL.std.450) 0(Unknown) 209 + 211: 100(ptr) AccessChain 51(data) 207 62 + Store 211 210 + 212: 6(int) Load 8(invocation) + 213: 126(ptr) AccessChain 51(data) 53 74 54 + 214: 6(int) Load 213 + 215: 6(int) ExtInst 1(GLSL.std.450) 0(Unknown) 214 + 216: 126(ptr) AccessChain 51(data) 212 74 54 + Store 216 215 + 217: 6(int) Load 8(invocation) + 218: 134(ptr) AccessChain 51(data) 62 74 + 219: 47(ivec4) Load 218 + 220: 133(ivec2) VectorShuffle 219 219 0 1 + 221: 133(ivec2) ExtInst 1(GLSL.std.450) 0(Unknown) 220 + 222: 134(ptr) AccessChain 51(data) 217 74 + 223: 47(ivec4) Load 222 + 224: 47(ivec4) VectorShuffle 223 221 4 5 2 3 + Store 222 224 + 225: 6(int) Load 8(invocation) + 226: 134(ptr) AccessChain 51(data) 74 74 + 227: 47(ivec4) Load 226 + 228: 144(ivec3) VectorShuffle 227 227 0 1 2 + 229: 144(ivec3) ExtInst 1(GLSL.std.450) 0(Unknown) 228 + 230: 134(ptr) AccessChain 51(data) 225 74 + 231: 47(ivec4) Load 230 + 232: 47(ivec4) VectorShuffle 231 229 4 5 6 3 + Store 230 232 + 233: 6(int) Load 8(invocation) + 234: 134(ptr) AccessChain 51(data) 85 74 + 235: 47(ivec4) Load 234 + 236: 47(ivec4) ExtInst 1(GLSL.std.450) 0(Unknown) 235 + 237: 134(ptr) AccessChain 51(data) 233 74 + Store 237 236 + Branch 42 + 42: Label + Return + FunctionEnd diff --git a/Test/baseResults/spv.shaderGroupVote.comp.out b/Test/baseResults/spv.shaderGroupVote.comp.out new file mode 100644 index 00000000..e63164d0 --- /dev/null +++ b/Test/baseResults/spv.shaderGroupVote.comp.out @@ -0,0 +1,71 @@ +spv.shaderGroupVote.comp +Warning, version 450 is not yet complete; most version-specific features are present, but some are missing. + + +Linked compute stage: + + +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 37 + + Capability Shader + Capability Groups + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint GLCompute 4 "main" + ExecutionMode 4 LocalSize 4 4 1 + Source GLSL 450 + SourceExtension "GL_ARB_shader_group_vote" + Name 4 "main" + Name 8 "b1" + Name 10 "Buffers" + MemberName 10(Buffers) 0 "b" + Name 12 "" + MemberDecorate 10(Buffers) 0 Offset 0 + Decorate 10(Buffers) BufferBlock + Decorate 12 DescriptorSet 0 + Decorate 12 Binding 0 + Decorate 36 BuiltIn WorkgroupSize + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeBool + 7: TypePointer Function 6(bool) + 9: TypeInt 32 0 + 10(Buffers): TypeStruct 9(int) + 11: TypePointer Uniform 10(Buffers) + 12: 11(ptr) Variable Uniform + 13: TypeInt 32 1 + 14: 13(int) Constant 0 + 15: TypePointer Uniform 9(int) + 18: 9(int) Constant 0 + 21: 9(int) Constant 3 + 31: 9(int) Constant 1 + 34: TypeVector 9(int) 3 + 35: 9(int) Constant 4 + 36: 34(ivec3) ConstantComposite 35 35 31 + 4(main): 2 Function None 3 + 5: Label + 8(b1): 7(ptr) Variable Function + 16: 15(ptr) AccessChain 12 14 + 17: 9(int) Load 16 + 19: 6(bool) INotEqual 17 18 + Store 8(b1) 19 + 20: 6(bool) Load 8(b1) + 22: 6(bool) GroupAny 21 20 + Store 8(b1) 22 + 23: 6(bool) Load 8(b1) + 24: 6(bool) GroupAll 21 23 + Store 8(b1) 24 + 25: 6(bool) Load 8(b1) + 26: 6(bool) GroupAll 21 25 + 27: 6(bool) GroupAny 21 25 + 28: 6(bool) LogicalNot 27 + 29: 6(bool) LogicalOr 26 28 + Store 8(b1) 29 + 30: 6(bool) Load 8(b1) + 32: 9(int) Select 30 31 18 + 33: 15(ptr) AccessChain 12 14 + Store 33 32 + Return + FunctionEnd diff --git a/Test/baseResults/spv.sparseTexture.frag.out b/Test/baseResults/spv.sparseTexture.frag.out index 315e1bb4..ae48f41d 100644 --- a/Test/baseResults/spv.sparseTexture.frag.out +++ b/Test/baseResults/spv.sparseTexture.frag.out @@ -7,7 +7,7 @@ Linked fragment stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 433 +// Id's are bound by 438 Capability Shader Capability SampledRect @@ -15,7 +15,7 @@ Linked fragment stage: Capability SampledCubeArray 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 33 48 89 360 388 400 418 + EntryPoint Fragment 4 "main" 33 48 89 365 393 405 423 ExecutionMode 4 OriginUpperLeft Source GLSL 450 SourceExtension "GL_ARB_sparse_texture2" @@ -39,17 +39,17 @@ Linked fragment stage: Name 111 "ResType" Name 140 "us2DRect" Name 154 "s2DArrayShadow" - Name 186 "s2DMS" - Name 223 "is2DArray" - Name 256 "sCubeShadow" - Name 289 "s2DRectShadow" - Name 360 "offsets" - Name 385 "i2D" - Name 388 "ic2" - Name 397 "ii3D" - Name 400 "ic3" - Name 409 "i2DMS" - Name 418 "outColor" + Name 188 "s2DMS" + Name 228 "is2DArray" + Name 261 "sCubeShadow" + Name 294 "s2DRectShadow" + Name 365 "offsets" + Name 390 "i2D" + Name 393 "ic2" + Name 402 "ii3D" + Name 405 "ic3" + Name 414 "i2DMS" + Name 423 "outColor" Decorate 29(s2D) DescriptorSet 0 Decorate 44(s3D) DescriptorSet 0 Decorate 59(isCube) DescriptorSet 0 @@ -58,16 +58,16 @@ Linked fragment stage: Decorate 108(usCubeArray) DescriptorSet 0 Decorate 140(us2DRect) DescriptorSet 0 Decorate 154(s2DArrayShadow) DescriptorSet 0 - Decorate 186(s2DMS) DescriptorSet 0 - Decorate 223(is2DArray) DescriptorSet 0 - Decorate 256(sCubeShadow) DescriptorSet 0 - Decorate 289(s2DRectShadow) DescriptorSet 0 - Decorate 360(offsets) Flat - Decorate 385(i2D) DescriptorSet 0 - Decorate 388(ic2) Flat - Decorate 397(ii3D) DescriptorSet 0 - Decorate 400(ic3) Flat - Decorate 409(i2DMS) DescriptorSet 0 + Decorate 188(s2DMS) DescriptorSet 0 + Decorate 228(is2DArray) DescriptorSet 0 + Decorate 261(sCubeShadow) DescriptorSet 0 + Decorate 294(s2DRectShadow) DescriptorSet 0 + Decorate 365(offsets) Flat + Decorate 390(i2D) DescriptorSet 0 + Decorate 393(ic2) Flat + Decorate 402(ii3D) DescriptorSet 0 + Decorate 405(ic3) Flat + Decorate 414(i2DMS) DescriptorSet 0 2: TypeVoid 3: TypeFunction 2 6: TypeInt 32 1 @@ -143,58 +143,58 @@ Linked fragment stage: 157: 6(int) Constant 5 158: 143(ivec2) ConstantComposite 157 157 159: 20(int) Constant 2 - 183: TypeImage 10(float) 2D multi-sampled sampled format:Unknown - 184: TypeSampledImage 183 - 185: TypePointer UniformConstant 184 - 186(s2DMS): 185(ptr) Variable UniformConstant - 190: 6(int) Constant 4 - 199: 129(ivec3) ConstantComposite 190 190 190 - 220: TypeImage 6(int) 2D array sampled format:Unknown - 221: TypeSampledImage 220 - 222: TypePointer UniformConstant 221 - 223(is2DArray): 222(ptr) Variable UniformConstant - 226: 6(int) Constant 6 - 227: 143(ivec2) ConstantComposite 226 226 - 235: 6(int) Constant 7 - 236: 143(ivec2) ConstantComposite 235 235 - 253: TypeImage 10(float) Cube depth sampled format:Unknown - 254: TypeSampledImage 253 - 255: TypePointer UniformConstant 254 -256(sCubeShadow): 255(ptr) Variable UniformConstant - 286: TypeImage 10(float) Rect depth sampled format:Unknown - 287: TypeSampledImage 286 - 288: TypePointer UniformConstant 287 -289(s2DRectShadow): 288(ptr) Variable UniformConstant - 294: 20(int) Constant 3 - 306: 143(ivec2) ConstantComposite 130 130 - 335: 143(ivec2) ConstantComposite 190 190 - 357: 20(int) Constant 4 - 358: TypeArray 143(ivec2) 357 - 359: TypePointer Input 358 - 360(offsets): 359(ptr) Variable Input - 383: TypeImage 10(float) 2D nonsampled format:Rgba32f - 384: TypePointer UniformConstant 383 - 385(i2D): 384(ptr) Variable UniformConstant - 387: TypePointer Input 143(ivec2) - 388(ic2): 387(ptr) Variable Input - 395: TypeImage 6(int) 3D nonsampled format:Rgba32i - 396: TypePointer UniformConstant 395 - 397(ii3D): 396(ptr) Variable UniformConstant - 399: TypePointer Input 129(ivec3) - 400(ic3): 399(ptr) Variable Input - 407: TypeImage 10(float) 2D multi-sampled nonsampled format:Rgba32f - 408: TypePointer UniformConstant 407 - 409(i2DMS): 408(ptr) Variable UniformConstant - 417: TypePointer Output 11(fvec4) - 418(outColor): 417(ptr) Variable Output - 421: TypeBool + 185: TypeImage 10(float) 2D multi-sampled sampled format:Unknown + 186: TypeSampledImage 185 + 187: TypePointer UniformConstant 186 + 188(s2DMS): 187(ptr) Variable UniformConstant + 192: 6(int) Constant 4 + 202: 129(ivec3) ConstantComposite 192 192 192 + 225: TypeImage 6(int) 2D array sampled format:Unknown + 226: TypeSampledImage 225 + 227: TypePointer UniformConstant 226 + 228(is2DArray): 227(ptr) Variable UniformConstant + 231: 6(int) Constant 6 + 232: 143(ivec2) ConstantComposite 231 231 + 240: 6(int) Constant 7 + 241: 143(ivec2) ConstantComposite 240 240 + 258: TypeImage 10(float) Cube depth sampled format:Unknown + 259: TypeSampledImage 258 + 260: TypePointer UniformConstant 259 +261(sCubeShadow): 260(ptr) Variable UniformConstant + 291: TypeImage 10(float) Rect depth sampled format:Unknown + 292: TypeSampledImage 291 + 293: TypePointer UniformConstant 292 +294(s2DRectShadow): 293(ptr) Variable UniformConstant + 299: 20(int) Constant 3 + 311: 143(ivec2) ConstantComposite 130 130 + 340: 143(ivec2) ConstantComposite 192 192 + 362: 20(int) Constant 4 + 363: TypeArray 143(ivec2) 362 + 364: TypePointer Input 363 + 365(offsets): 364(ptr) Variable Input + 388: TypeImage 10(float) 2D nonsampled format:Rgba32f + 389: TypePointer UniformConstant 388 + 390(i2D): 389(ptr) Variable UniformConstant + 392: TypePointer Input 143(ivec2) + 393(ic2): 392(ptr) Variable Input + 400: TypeImage 6(int) 3D nonsampled format:Rgba32i + 401: TypePointer UniformConstant 400 + 402(ii3D): 401(ptr) Variable UniformConstant + 404: TypePointer Input 129(ivec3) + 405(ic3): 404(ptr) Variable Input + 412: TypeImage 10(float) 2D multi-sampled nonsampled format:Rgba32f + 413: TypePointer UniformConstant 412 + 414(i2DMS): 413(ptr) Variable UniformConstant + 422: TypePointer Output 11(fvec4) + 423(outColor): 422(ptr) Variable Output + 426: TypeBool 4(main): 2 Function None 3 5: Label 8(resident): 7(ptr) Variable Function 13(texel): 12(ptr) Variable Function 18(itexel): 17(ptr) Variable Function 23(utexel): 22(ptr) Variable Function - 419: 12(ptr) Variable Function + 424: 12(ptr) Variable Function Store 8(resident) 9 Store 13(texel) 15 Store 18(itexel) 19 @@ -308,281 +308,286 @@ Linked fragment stage: 167: 27 Load 29(s2D) 168: 31(fvec2) Load 33(c2) 169: 143(ivec2) ConvertFToS 168 - 170: 35(ResType) ImageSparseFetch 167 169 Lod 130 - 171: 11(fvec4) CompositeExtract 170 1 - Store 13(texel) 171 - 172: 6(int) CompositeExtract 170 0 - 173: 6(int) Load 8(resident) - 174: 6(int) BitwiseOr 173 172 - Store 8(resident) 174 - 175: 138 Load 140(us2DRect) - 176: 31(fvec2) Load 33(c2) - 177: 143(ivec2) ConvertFToS 176 - 178:111(ResType) ImageSparseFetch 175 177 - 179: 21(ivec4) CompositeExtract 178 1 - Store 23(utexel) 179 - 180: 6(int) CompositeExtract 178 0 - 181: 6(int) Load 8(resident) - 182: 6(int) BitwiseOr 181 180 - Store 8(resident) 182 - 187: 184 Load 186(s2DMS) - 188: 31(fvec2) Load 33(c2) - 189: 143(ivec2) ConvertFToS 188 - 191: 35(ResType) ImageSparseFetch 187 189 Sample 190 - 192: 11(fvec4) CompositeExtract 191 1 - Store 13(texel) 192 - 193: 6(int) CompositeExtract 191 0 - 194: 6(int) Load 8(resident) - 195: 6(int) BitwiseOr 194 193 - Store 8(resident) 195 - 196: 42 Load 44(s3D) - 197: 46(fvec3) Load 48(c3) - 198: 129(ivec3) ConvertFToS 197 - 200: 35(ResType) ImageSparseFetch 196 198 Lod ConstOffset 130 199 - 201: 11(fvec4) CompositeExtract 200 1 - Store 13(texel) 201 - 202: 6(int) CompositeExtract 200 0 - 203: 6(int) Load 8(resident) - 204: 6(int) BitwiseOr 203 202 - Store 8(resident) 204 - 205: 138 Load 140(us2DRect) - 206: 31(fvec2) Load 33(c2) - 207: 143(ivec2) ConvertFToS 206 - 208:111(ResType) ImageSparseFetch 205 207 ConstOffset 145 - 209: 21(ivec4) CompositeExtract 208 1 - Store 23(utexel) 209 - 210: 6(int) CompositeExtract 208 0 - 211: 6(int) Load 8(resident) - 212: 6(int) BitwiseOr 211 210 - Store 8(resident) 212 - 213: 27 Load 29(s2D) - 214: 31(fvec2) Load 33(c2) - 215: 35(ResType) ImageSparseSampleExplicitLod 213 214 Lod ConstOffset 50 158 - 216: 11(fvec4) CompositeExtract 215 1 - Store 13(texel) 216 - 217: 6(int) CompositeExtract 215 0 - 218: 6(int) Load 8(resident) - 219: 6(int) BitwiseOr 218 217 - Store 8(resident) 219 - 224: 221 Load 223(is2DArray) - 225: 46(fvec3) Load 48(c3) - 228: 62(ResType) ImageSparseSampleExplicitLod 224 225 Lod ConstOffset 50 227 - 229: 16(ivec4) CompositeExtract 228 1 - Store 18(itexel) 229 - 230: 6(int) CompositeExtract 228 0 - 231: 6(int) Load 8(resident) - 232: 6(int) BitwiseOr 231 230 - Store 8(resident) 232 - 233: 69 Load 71(s2DShadow) - 234: 46(fvec3) Load 48(c3) - 237: 74(ptr) AccessChain 13(texel) 159 - 238: 10(float) CompositeExtract 234 2 - 239: 77(ResType) ImageSparseSampleDrefExplicitLod 233 234 238 Lod ConstOffset 50 236 - 240: 10(float) CompositeExtract 239 1 - Store 237 240 - 241: 6(int) CompositeExtract 239 0 - 242: 6(int) Load 8(resident) - 243: 6(int) BitwiseOr 242 241 - Store 8(resident) 243 - 244: 42 Load 44(s3D) - 245: 46(fvec3) Load 48(c3) - 246: 46(fvec3) Load 48(c3) - 247: 46(fvec3) Load 48(c3) - 248: 35(ResType) ImageSparseSampleExplicitLod 244 245 Grad 246 247 - 249: 11(fvec4) CompositeExtract 248 1 - Store 13(texel) 249 - 250: 6(int) CompositeExtract 248 0 - 251: 6(int) Load 8(resident) - 252: 6(int) BitwiseOr 251 250 - Store 8(resident) 252 - 257: 254 Load 256(sCubeShadow) - 258: 11(fvec4) Load 89(c4) - 259: 46(fvec3) Load 48(c3) - 260: 46(fvec3) Load 48(c3) - 261: 74(ptr) AccessChain 13(texel) 119 - 262: 10(float) CompositeExtract 258 3 - 263: 77(ResType) ImageSparseSampleDrefExplicitLod 257 258 262 Grad 259 260 - 264: 10(float) CompositeExtract 263 1 - Store 261 264 - 265: 6(int) CompositeExtract 263 0 - 266: 6(int) Load 8(resident) - 267: 6(int) BitwiseOr 266 265 - Store 8(resident) 267 - 268: 106 Load 108(usCubeArray) - 269: 11(fvec4) Load 89(c4) - 270: 46(fvec3) Load 48(c3) - 271: 46(fvec3) Load 48(c3) - 272:111(ResType) ImageSparseSampleExplicitLod 268 269 Grad 270 271 - 273: 21(ivec4) CompositeExtract 272 1 - Store 23(utexel) 273 - 274: 6(int) CompositeExtract 272 0 - 275: 6(int) Load 8(resident) - 276: 6(int) BitwiseOr 275 274 - Store 8(resident) 276 - 277: 27 Load 29(s2D) - 278: 31(fvec2) Load 33(c2) - 279: 31(fvec2) Load 33(c2) - 280: 31(fvec2) Load 33(c2) - 281: 35(ResType) ImageSparseSampleExplicitLod 277 278 Grad ConstOffset 279 280 158 - 282: 11(fvec4) CompositeExtract 281 1 - Store 13(texel) 282 - 283: 6(int) CompositeExtract 281 0 - 284: 6(int) Load 8(resident) - 285: 6(int) BitwiseOr 284 283 - Store 8(resident) 285 - 290: 287 Load 289(s2DRectShadow) - 291: 46(fvec3) Load 48(c3) - 292: 31(fvec2) Load 33(c2) - 293: 31(fvec2) Load 33(c2) - 295: 74(ptr) AccessChain 13(texel) 294 - 296: 10(float) CompositeExtract 291 2 - 297: 77(ResType) ImageSparseSampleDrefExplicitLod 290 291 296 Grad ConstOffset 292 293 227 - 298: 10(float) CompositeExtract 297 1 - Store 295 298 - 299: 6(int) CompositeExtract 297 0 - 300: 6(int) Load 8(resident) - 301: 6(int) BitwiseOr 300 299 - Store 8(resident) 301 - 302: 221 Load 223(is2DArray) - 303: 46(fvec3) Load 48(c3) - 304: 31(fvec2) Load 33(c2) - 305: 31(fvec2) Load 33(c2) - 307: 62(ResType) ImageSparseSampleExplicitLod 302 303 Grad ConstOffset 304 305 306 - 308: 16(ivec4) CompositeExtract 307 1 - Store 18(itexel) 308 - 309: 6(int) CompositeExtract 307 0 - 310: 6(int) Load 8(resident) - 311: 6(int) BitwiseOr 310 309 - Store 8(resident) 311 - 312: 27 Load 29(s2D) - 313: 31(fvec2) Load 33(c2) - 314: 35(ResType) ImageSparseGather 312 313 9 - 315: 11(fvec4) CompositeExtract 314 1 - Store 13(texel) 315 - 316: 6(int) CompositeExtract 314 0 - 317: 6(int) Load 8(resident) - 318: 6(int) BitwiseOr 317 316 - Store 8(resident) 318 - 319: 221 Load 223(is2DArray) - 320: 46(fvec3) Load 48(c3) - 321: 62(ResType) ImageSparseGather 319 320 130 - 322: 16(ivec4) CompositeExtract 321 1 - Store 18(itexel) 322 - 323: 6(int) CompositeExtract 321 0 - 324: 6(int) Load 8(resident) - 325: 6(int) BitwiseOr 324 323 - Store 8(resident) 325 - 326: 152 Load 154(s2DArrayShadow) - 327: 46(fvec3) Load 48(c3) - 328: 35(ResType) ImageSparseDrefGather 326 327 50 - 329: 11(fvec4) CompositeExtract 328 1 - Store 13(texel) 329 - 330: 6(int) CompositeExtract 328 0 - 331: 6(int) Load 8(resident) - 332: 6(int) BitwiseOr 331 330 - Store 8(resident) 332 - 333: 27 Load 29(s2D) - 334: 31(fvec2) Load 33(c2) - 336: 35(ResType) ImageSparseGather 333 334 9 ConstOffset 335 - 337: 11(fvec4) CompositeExtract 336 1 - Store 13(texel) 337 - 338: 6(int) CompositeExtract 336 0 - 339: 6(int) Load 8(resident) - 340: 6(int) BitwiseOr 339 338 - Store 8(resident) 340 - 341: 221 Load 223(is2DArray) - 342: 46(fvec3) Load 48(c3) - 343: 62(ResType) ImageSparseGather 341 342 130 ConstOffset 158 - 344: 16(ivec4) CompositeExtract 343 1 - Store 18(itexel) 344 - 345: 6(int) CompositeExtract 343 0 - 346: 6(int) Load 8(resident) - 347: 6(int) BitwiseOr 346 345 - Store 8(resident) 347 - 348: 287 Load 289(s2DRectShadow) - 349: 31(fvec2) Load 33(c2) - 350: 35(ResType) ImageSparseDrefGather 348 349 50 ConstOffset 236 - 351: 11(fvec4) CompositeExtract 350 1 - Store 13(texel) 351 - 352: 6(int) CompositeExtract 350 0 - 353: 6(int) Load 8(resident) - 354: 6(int) BitwiseOr 353 352 - Store 8(resident) 354 - 355: 27 Load 29(s2D) - 356: 31(fvec2) Load 33(c2) - 361: 358 Load 360(offsets) - 362: 35(ResType) ImageSparseGather 355 356 9 ConstOffsets 361 - 363: 11(fvec4) CompositeExtract 362 1 - Store 13(texel) 363 - 364: 6(int) CompositeExtract 362 0 - 365: 6(int) Load 8(resident) - 366: 6(int) BitwiseOr 365 364 - Store 8(resident) 366 - 367: 221 Load 223(is2DArray) - 368: 46(fvec3) Load 48(c3) - 369: 358 Load 360(offsets) - 370: 62(ResType) ImageSparseGather 367 368 130 ConstOffsets 369 - 371: 16(ivec4) CompositeExtract 370 1 - Store 18(itexel) 371 - 372: 6(int) CompositeExtract 370 0 - 373: 6(int) Load 8(resident) - 374: 6(int) BitwiseOr 373 372 - Store 8(resident) 374 - 375: 287 Load 289(s2DRectShadow) - 376: 31(fvec2) Load 33(c2) - 377: 358 Load 360(offsets) - 378: 35(ResType) ImageSparseDrefGather 375 376 50 ConstOffsets 377 - 379: 11(fvec4) CompositeExtract 378 1 - Store 13(texel) 379 - 380: 6(int) CompositeExtract 378 0 - 381: 6(int) Load 8(resident) - 382: 6(int) BitwiseOr 381 380 - Store 8(resident) 382 - 386: 383 Load 385(i2D) - 389: 143(ivec2) Load 388(ic2) - 390: 35(ResType) ImageSparseRead 386 389 - 391: 11(fvec4) CompositeExtract 390 1 - Store 13(texel) 391 - 392: 6(int) CompositeExtract 390 0 - 393: 6(int) Load 8(resident) - 394: 6(int) BitwiseOr 393 392 - Store 8(resident) 394 - 398: 395 Load 397(ii3D) - 401: 129(ivec3) Load 400(ic3) - 402: 62(ResType) ImageSparseRead 398 401 - 403: 16(ivec4) CompositeExtract 402 1 - Store 18(itexel) 403 - 404: 6(int) CompositeExtract 402 0 - 405: 6(int) Load 8(resident) - 406: 6(int) BitwiseOr 405 404 - Store 8(resident) 406 - 410: 407 Load 409(i2DMS) - 411: 143(ivec2) Load 388(ic2) - 412: 35(ResType) ImageSparseRead 410 411 Sample 144 - 413: 11(fvec4) CompositeExtract 412 1 - Store 13(texel) 413 - 414: 6(int) CompositeExtract 412 0 - 415: 6(int) Load 8(resident) - 416: 6(int) BitwiseOr 415 414 - Store 8(resident) 416 + 170: 26 Image 167 + 171: 35(ResType) ImageSparseFetch 170 169 Lod 130 + 172: 11(fvec4) CompositeExtract 171 1 + Store 13(texel) 172 + 173: 6(int) CompositeExtract 171 0 + 174: 6(int) Load 8(resident) + 175: 6(int) BitwiseOr 174 173 + Store 8(resident) 175 + 176: 138 Load 140(us2DRect) + 177: 31(fvec2) Load 33(c2) + 178: 143(ivec2) ConvertFToS 177 + 179: 137 Image 176 + 180:111(ResType) ImageSparseFetch 179 178 + 181: 21(ivec4) CompositeExtract 180 1 + Store 23(utexel) 181 + 182: 6(int) CompositeExtract 180 0 + 183: 6(int) Load 8(resident) + 184: 6(int) BitwiseOr 183 182 + Store 8(resident) 184 + 189: 186 Load 188(s2DMS) + 190: 31(fvec2) Load 33(c2) + 191: 143(ivec2) ConvertFToS 190 + 193: 185 Image 189 + 194: 35(ResType) ImageSparseFetch 193 191 Sample 192 + 195: 11(fvec4) CompositeExtract 194 1 + Store 13(texel) 195 + 196: 6(int) CompositeExtract 194 0 + 197: 6(int) Load 8(resident) + 198: 6(int) BitwiseOr 197 196 + Store 8(resident) 198 + 199: 42 Load 44(s3D) + 200: 46(fvec3) Load 48(c3) + 201: 129(ivec3) ConvertFToS 200 + 203: 41 Image 199 + 204: 35(ResType) ImageSparseFetch 203 201 Lod ConstOffset 130 202 + 205: 11(fvec4) CompositeExtract 204 1 + Store 13(texel) 205 + 206: 6(int) CompositeExtract 204 0 + 207: 6(int) Load 8(resident) + 208: 6(int) BitwiseOr 207 206 + Store 8(resident) 208 + 209: 138 Load 140(us2DRect) + 210: 31(fvec2) Load 33(c2) + 211: 143(ivec2) ConvertFToS 210 + 212: 137 Image 209 + 213:111(ResType) ImageSparseFetch 212 211 ConstOffset 145 + 214: 21(ivec4) CompositeExtract 213 1 + Store 23(utexel) 214 + 215: 6(int) CompositeExtract 213 0 + 216: 6(int) Load 8(resident) + 217: 6(int) BitwiseOr 216 215 + Store 8(resident) 217 + 218: 27 Load 29(s2D) + 219: 31(fvec2) Load 33(c2) + 220: 35(ResType) ImageSparseSampleExplicitLod 218 219 Lod ConstOffset 50 158 + 221: 11(fvec4) CompositeExtract 220 1 + Store 13(texel) 221 + 222: 6(int) CompositeExtract 220 0 + 223: 6(int) Load 8(resident) + 224: 6(int) BitwiseOr 223 222 + Store 8(resident) 224 + 229: 226 Load 228(is2DArray) + 230: 46(fvec3) Load 48(c3) + 233: 62(ResType) ImageSparseSampleExplicitLod 229 230 Lod ConstOffset 50 232 + 234: 16(ivec4) CompositeExtract 233 1 + Store 18(itexel) 234 + 235: 6(int) CompositeExtract 233 0 + 236: 6(int) Load 8(resident) + 237: 6(int) BitwiseOr 236 235 + Store 8(resident) 237 + 238: 69 Load 71(s2DShadow) + 239: 46(fvec3) Load 48(c3) + 242: 74(ptr) AccessChain 13(texel) 159 + 243: 10(float) CompositeExtract 239 2 + 244: 77(ResType) ImageSparseSampleDrefExplicitLod 238 239 243 Lod ConstOffset 50 241 + 245: 10(float) CompositeExtract 244 1 + Store 242 245 + 246: 6(int) CompositeExtract 244 0 + 247: 6(int) Load 8(resident) + 248: 6(int) BitwiseOr 247 246 + Store 8(resident) 248 + 249: 42 Load 44(s3D) + 250: 46(fvec3) Load 48(c3) + 251: 46(fvec3) Load 48(c3) + 252: 46(fvec3) Load 48(c3) + 253: 35(ResType) ImageSparseSampleExplicitLod 249 250 Grad 251 252 + 254: 11(fvec4) CompositeExtract 253 1 + Store 13(texel) 254 + 255: 6(int) CompositeExtract 253 0 + 256: 6(int) Load 8(resident) + 257: 6(int) BitwiseOr 256 255 + Store 8(resident) 257 + 262: 259 Load 261(sCubeShadow) + 263: 11(fvec4) Load 89(c4) + 264: 46(fvec3) Load 48(c3) + 265: 46(fvec3) Load 48(c3) + 266: 74(ptr) AccessChain 13(texel) 119 + 267: 10(float) CompositeExtract 263 3 + 268: 77(ResType) ImageSparseSampleDrefExplicitLod 262 263 267 Grad 264 265 + 269: 10(float) CompositeExtract 268 1 + Store 266 269 + 270: 6(int) CompositeExtract 268 0 + 271: 6(int) Load 8(resident) + 272: 6(int) BitwiseOr 271 270 + Store 8(resident) 272 + 273: 106 Load 108(usCubeArray) + 274: 11(fvec4) Load 89(c4) + 275: 46(fvec3) Load 48(c3) + 276: 46(fvec3) Load 48(c3) + 277:111(ResType) ImageSparseSampleExplicitLod 273 274 Grad 275 276 + 278: 21(ivec4) CompositeExtract 277 1 + Store 23(utexel) 278 + 279: 6(int) CompositeExtract 277 0 + 280: 6(int) Load 8(resident) + 281: 6(int) BitwiseOr 280 279 + Store 8(resident) 281 + 282: 27 Load 29(s2D) + 283: 31(fvec2) Load 33(c2) + 284: 31(fvec2) Load 33(c2) + 285: 31(fvec2) Load 33(c2) + 286: 35(ResType) ImageSparseSampleExplicitLod 282 283 Grad ConstOffset 284 285 158 + 287: 11(fvec4) CompositeExtract 286 1 + Store 13(texel) 287 + 288: 6(int) CompositeExtract 286 0 + 289: 6(int) Load 8(resident) + 290: 6(int) BitwiseOr 289 288 + Store 8(resident) 290 + 295: 292 Load 294(s2DRectShadow) + 296: 46(fvec3) Load 48(c3) + 297: 31(fvec2) Load 33(c2) + 298: 31(fvec2) Load 33(c2) + 300: 74(ptr) AccessChain 13(texel) 299 + 301: 10(float) CompositeExtract 296 2 + 302: 77(ResType) ImageSparseSampleDrefExplicitLod 295 296 301 Grad ConstOffset 297 298 232 + 303: 10(float) CompositeExtract 302 1 + Store 300 303 + 304: 6(int) CompositeExtract 302 0 + 305: 6(int) Load 8(resident) + 306: 6(int) BitwiseOr 305 304 + Store 8(resident) 306 + 307: 226 Load 228(is2DArray) + 308: 46(fvec3) Load 48(c3) + 309: 31(fvec2) Load 33(c2) + 310: 31(fvec2) Load 33(c2) + 312: 62(ResType) ImageSparseSampleExplicitLod 307 308 Grad ConstOffset 309 310 311 + 313: 16(ivec4) CompositeExtract 312 1 + Store 18(itexel) 313 + 314: 6(int) CompositeExtract 312 0 + 315: 6(int) Load 8(resident) + 316: 6(int) BitwiseOr 315 314 + Store 8(resident) 316 + 317: 27 Load 29(s2D) + 318: 31(fvec2) Load 33(c2) + 319: 35(ResType) ImageSparseGather 317 318 9 + 320: 11(fvec4) CompositeExtract 319 1 + Store 13(texel) 320 + 321: 6(int) CompositeExtract 319 0 + 322: 6(int) Load 8(resident) + 323: 6(int) BitwiseOr 322 321 + Store 8(resident) 323 + 324: 226 Load 228(is2DArray) + 325: 46(fvec3) Load 48(c3) + 326: 62(ResType) ImageSparseGather 324 325 130 + 327: 16(ivec4) CompositeExtract 326 1 + Store 18(itexel) 327 + 328: 6(int) CompositeExtract 326 0 + 329: 6(int) Load 8(resident) + 330: 6(int) BitwiseOr 329 328 + Store 8(resident) 330 + 331: 152 Load 154(s2DArrayShadow) + 332: 46(fvec3) Load 48(c3) + 333: 35(ResType) ImageSparseDrefGather 331 332 50 + 334: 11(fvec4) CompositeExtract 333 1 + Store 13(texel) 334 + 335: 6(int) CompositeExtract 333 0 + 336: 6(int) Load 8(resident) + 337: 6(int) BitwiseOr 336 335 + Store 8(resident) 337 + 338: 27 Load 29(s2D) + 339: 31(fvec2) Load 33(c2) + 341: 35(ResType) ImageSparseGather 338 339 9 ConstOffset 340 + 342: 11(fvec4) CompositeExtract 341 1 + Store 13(texel) 342 + 343: 6(int) CompositeExtract 341 0 + 344: 6(int) Load 8(resident) + 345: 6(int) BitwiseOr 344 343 + Store 8(resident) 345 + 346: 226 Load 228(is2DArray) + 347: 46(fvec3) Load 48(c3) + 348: 62(ResType) ImageSparseGather 346 347 130 ConstOffset 158 + 349: 16(ivec4) CompositeExtract 348 1 + Store 18(itexel) 349 + 350: 6(int) CompositeExtract 348 0 + 351: 6(int) Load 8(resident) + 352: 6(int) BitwiseOr 351 350 + Store 8(resident) 352 + 353: 292 Load 294(s2DRectShadow) + 354: 31(fvec2) Load 33(c2) + 355: 35(ResType) ImageSparseDrefGather 353 354 50 ConstOffset 241 + 356: 11(fvec4) CompositeExtract 355 1 + Store 13(texel) 356 + 357: 6(int) CompositeExtract 355 0 + 358: 6(int) Load 8(resident) + 359: 6(int) BitwiseOr 358 357 + Store 8(resident) 359 + 360: 27 Load 29(s2D) + 361: 31(fvec2) Load 33(c2) + 366: 363 Load 365(offsets) + 367: 35(ResType) ImageSparseGather 360 361 9 ConstOffsets 366 + 368: 11(fvec4) CompositeExtract 367 1 + Store 13(texel) 368 + 369: 6(int) CompositeExtract 367 0 + 370: 6(int) Load 8(resident) + 371: 6(int) BitwiseOr 370 369 + Store 8(resident) 371 + 372: 226 Load 228(is2DArray) + 373: 46(fvec3) Load 48(c3) + 374: 363 Load 365(offsets) + 375: 62(ResType) ImageSparseGather 372 373 130 ConstOffsets 374 + 376: 16(ivec4) CompositeExtract 375 1 + Store 18(itexel) 376 + 377: 6(int) CompositeExtract 375 0 + 378: 6(int) Load 8(resident) + 379: 6(int) BitwiseOr 378 377 + Store 8(resident) 379 + 380: 292 Load 294(s2DRectShadow) + 381: 31(fvec2) Load 33(c2) + 382: 363 Load 365(offsets) + 383: 35(ResType) ImageSparseDrefGather 380 381 50 ConstOffsets 382 + 384: 11(fvec4) CompositeExtract 383 1 + Store 13(texel) 384 + 385: 6(int) CompositeExtract 383 0 + 386: 6(int) Load 8(resident) + 387: 6(int) BitwiseOr 386 385 + Store 8(resident) 387 + 391: 388 Load 390(i2D) + 394: 143(ivec2) Load 393(ic2) + 395: 35(ResType) ImageSparseRead 391 394 + 396: 11(fvec4) CompositeExtract 395 1 + Store 13(texel) 396 + 397: 6(int) CompositeExtract 395 0 + 398: 6(int) Load 8(resident) + 399: 6(int) BitwiseOr 398 397 + Store 8(resident) 399 + 403: 400 Load 402(ii3D) + 406: 129(ivec3) Load 405(ic3) + 407: 62(ResType) ImageSparseRead 403 406 + 408: 16(ivec4) CompositeExtract 407 1 + Store 18(itexel) 408 + 409: 6(int) CompositeExtract 407 0 + 410: 6(int) Load 8(resident) + 411: 6(int) BitwiseOr 410 409 + Store 8(resident) 411 + 415: 412 Load 414(i2DMS) + 416: 143(ivec2) Load 393(ic2) + 417: 35(ResType) ImageSparseRead 415 416 Sample 144 + 418: 11(fvec4) CompositeExtract 417 1 + Store 13(texel) 418 + 419: 6(int) CompositeExtract 417 0 420: 6(int) Load 8(resident) - 422: 421(bool) ImageSparseTexelsResident 420 - SelectionMerge 424 None - BranchConditional 422 423 426 - 423: Label - 425: 11(fvec4) Load 13(texel) - Store 419 425 - Branch 424 - 426: Label - 427: 16(ivec4) Load 18(itexel) - 428: 11(fvec4) ConvertSToF 427 - 429: 21(ivec4) Load 23(utexel) - 430: 11(fvec4) ConvertUToF 429 - 431: 11(fvec4) FAdd 428 430 - Store 419 431 - Branch 424 - 424: Label - 432: 11(fvec4) Load 419 - Store 418(outColor) 432 + 421: 6(int) BitwiseOr 420 419 + Store 8(resident) 421 + 425: 6(int) Load 8(resident) + 427: 426(bool) ImageSparseTexelsResident 425 + SelectionMerge 429 None + BranchConditional 427 428 431 + 428: Label + 430: 11(fvec4) Load 13(texel) + Store 424 430 + Branch 429 + 431: Label + 432: 16(ivec4) Load 18(itexel) + 433: 11(fvec4) ConvertSToF 432 + 434: 21(ivec4) Load 23(utexel) + 435: 11(fvec4) ConvertUToF 434 + 436: 11(fvec4) FAdd 433 435 + Store 424 436 + Branch 429 + 429: Label + 437: 11(fvec4) Load 424 + Store 423(outColor) 437 Return FunctionEnd diff --git a/Test/baseResults/spv.specConstant.comp.out b/Test/baseResults/spv.specConstant.comp.out index d1c9b0a6..2f16f04d 100644 --- a/Test/baseResults/spv.specConstant.comp.out +++ b/Test/baseResults/spv.specConstant.comp.out @@ -39,16 +39,16 @@ Linked compute stage: 15: TypeVector 6(int) 3 16: 15(ivec3) SpecConstantComposite 12 13 14 17: 6(int) Constant 0 + 18: 6(int) SpecConstantOp 81 16 0 19: 6(int) Constant 1 + 20: 6(int) SpecConstantOp 81 16 1(GLSL.std.450) + 21: 6(int) SpecConstantOp 132 18 20 22: 6(int) Constant 2 + 23: 6(int) SpecConstantOp 81 16 2 + 24: 6(int) SpecConstantOp 132 21 23 25: TypePointer Uniform 6(int) 4(main): 2 Function None 3 5: Label - 18: 6(int) CompositeExtract 16 0 - 20: 6(int) CompositeExtract 16 1 - 21: 6(int) IMul 18 20 - 23: 6(int) CompositeExtract 16 2 - 24: 6(int) IMul 21 23 26: 25(ptr) AccessChain 9(bi) 11 Store 26 24 Return diff --git a/Test/baseResults/spv.specConstant.vert.out b/Test/baseResults/spv.specConstant.vert.out index 862dc19a..fb7c70a7 100644 --- a/Test/baseResults/spv.specConstant.vert.out +++ b/Test/baseResults/spv.specConstant.vert.out @@ -7,32 +7,35 @@ Linked vertex stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 72 +// Id's are bound by 81 Capability Shader Capability Float64 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Vertex 4 "main" 17 19 25 50 + EntryPoint Vertex 4 "main" 20 22 28 53 Source GLSL 400 Name 4 "main" - Name 14 "foo(vf4[s1498];" + Name 14 "foo(vf4[s1516];" Name 13 "p" - Name 17 "color" - Name 19 "ucol" - Name 25 "size" - Name 44 "param" - Name 50 "dupUcol" + Name 17 "builtin_spec_constant(" + Name 20 "color" + Name 22 "ucol" + Name 28 "size" + Name 47 "param" + Name 53 "dupUcol" + Name 76 "result" Decorate 9 SpecId 16 - Decorate 27 SpecId 17 - Decorate 31 SpecId 22 - Decorate 36 SpecId 19 - Decorate 37 SpecId 18 - Decorate 47 SpecId 116 - Decorate 57 SpecId 117 - Decorate 60 SpecId 122 - Decorate 64 SpecId 119 - Decorate 65 SpecId 118 + Decorate 30 SpecId 17 + Decorate 34 SpecId 22 + Decorate 39 SpecId 19 + Decorate 40 SpecId 18 + Decorate 50 SpecId 116 + Decorate 60 SpecId 117 + Decorate 63 SpecId 122 + Decorate 67 SpecId 119 + Decorate 68 SpecId 118 + Decorate 77 SpecId 24 2: TypeVoid 3: TypeFunction 2 6: TypeFloat 32 @@ -42,83 +45,93 @@ Linked vertex stage: 10: TypeArray 7(fvec4) 9 11: TypePointer Function 10 12: TypeFunction 2 11(ptr) - 16: TypePointer Output 7(fvec4) - 17(color): 16(ptr) Variable Output - 18: TypePointer Input 10 - 19(ucol): 18(ptr) Variable Input - 20: 8(int) Constant 2 - 21: TypePointer Input 7(fvec4) - 24: TypePointer Output 8(int) - 25(size): 24(ptr) Variable Output - 26: TypeBool - 27: 26(bool) SpecConstantTrue - 30: TypeInt 32 0 - 31: 30(int) SpecConstant 2 - 35: TypeFloat 64 - 36: 35(float) SpecConstant 1413754136 1074340347 - 37: 6(float) SpecConstant 1078523331 - 47: 8(int) SpecConstant 12 - 48: TypeArray 7(fvec4) 47 - 49: TypePointer Input 48 - 50(dupUcol): 49(ptr) Variable Input - 57: 26(bool) SpecConstantTrue - 60: 30(int) SpecConstant 2 - 64: 35(float) SpecConstant 1413754136 1074340347 - 65: 6(float) SpecConstant 1078523331 + 16: TypeFunction 8(int) + 19: TypePointer Output 7(fvec4) + 20(color): 19(ptr) Variable Output + 21: TypePointer Input 10 + 22(ucol): 21(ptr) Variable Input + 23: 8(int) Constant 2 + 24: TypePointer Input 7(fvec4) + 27: TypePointer Output 8(int) + 28(size): 27(ptr) Variable Output + 29: TypeBool + 30: 29(bool) SpecConstantTrue + 33: TypeInt 32 0 + 34: 33(int) SpecConstant 2 + 38: TypeFloat 64 + 39: 38(float) SpecConstant 1413754136 1074340347 + 40: 6(float) SpecConstant 1078523331 + 50: 8(int) SpecConstant 12 + 51: TypeArray 7(fvec4) 50 + 52: TypePointer Input 51 + 53(dupUcol): 52(ptr) Variable Input + 60: 29(bool) SpecConstantTrue + 63: 33(int) SpecConstant 2 + 67: 38(float) SpecConstant 1413754136 1074340347 + 68: 6(float) SpecConstant 1078523331 + 75: TypePointer Function 8(int) + 77: 8(int) SpecConstant 8 4(main): 2 Function None 3 5: Label - 44(param): 11(ptr) Variable Function - 22: 21(ptr) AccessChain 19(ucol) 20 - 23: 7(fvec4) Load 22 - Store 17(color) 23 - Store 25(size) 9 - SelectionMerge 29 None - BranchConditional 27 28 29 - 28: Label - 32: 6(float) ConvertUToF 31 - 33: 7(fvec4) Load 17(color) - 34: 7(fvec4) VectorTimesScalar 33 32 - Store 17(color) 34 - Branch 29 - 29: Label - 38: 35(float) FConvert 37 - 39: 35(float) FDiv 36 38 - 40: 6(float) FConvert 39 - 41: 7(fvec4) Load 17(color) - 42: 7(fvec4) CompositeConstruct 40 40 40 40 - 43: 7(fvec4) FAdd 41 42 - Store 17(color) 43 - 45: 10 Load 19(ucol) - Store 44(param) 45 - 46: 2 FunctionCall 14(foo(vf4[s1498];) 44(param) + 47(param): 11(ptr) Variable Function + 25: 24(ptr) AccessChain 22(ucol) 23 + 26: 7(fvec4) Load 25 + Store 20(color) 26 + Store 28(size) 9 + SelectionMerge 32 None + BranchConditional 30 31 32 + 31: Label + 35: 6(float) ConvertUToF 34 + 36: 7(fvec4) Load 20(color) + 37: 7(fvec4) VectorTimesScalar 36 35 + Store 20(color) 37 + Branch 32 + 32: Label + 41: 38(float) FConvert 40 + 42: 38(float) FDiv 39 41 + 43: 6(float) FConvert 42 + 44: 7(fvec4) Load 20(color) + 45: 7(fvec4) CompositeConstruct 43 43 43 43 + 46: 7(fvec4) FAdd 44 45 + Store 20(color) 46 + 48: 10 Load 22(ucol) + Store 47(param) 48 + 49: 2 FunctionCall 14(foo(vf4[s1516];) 47(param) Return FunctionEnd -14(foo(vf4[s1498];): 2 Function None 12 +14(foo(vf4[s1516];): 2 Function None 12 13(p): 11(ptr) FunctionParameter 15: Label - 51: 21(ptr) AccessChain 50(dupUcol) 20 - 52: 7(fvec4) Load 51 - 53: 7(fvec4) Load 17(color) - 54: 7(fvec4) FAdd 53 52 - Store 17(color) 54 - 55: 8(int) Load 25(size) - 56: 8(int) IAdd 55 47 - Store 25(size) 56 - SelectionMerge 59 None - BranchConditional 57 58 59 - 58: Label - 61: 6(float) ConvertUToF 60 - 62: 7(fvec4) Load 17(color) - 63: 7(fvec4) VectorTimesScalar 62 61 - Store 17(color) 63 - Branch 59 - 59: Label - 66: 35(float) FConvert 65 - 67: 35(float) FDiv 64 66 - 68: 6(float) FConvert 67 - 69: 7(fvec4) Load 17(color) - 70: 7(fvec4) CompositeConstruct 68 68 68 68 - 71: 7(fvec4) FAdd 69 70 - Store 17(color) 71 + 54: 24(ptr) AccessChain 53(dupUcol) 23 + 55: 7(fvec4) Load 54 + 56: 7(fvec4) Load 20(color) + 57: 7(fvec4) FAdd 56 55 + Store 20(color) 57 + 58: 8(int) Load 28(size) + 59: 8(int) IAdd 58 50 + Store 28(size) 59 + SelectionMerge 62 None + BranchConditional 60 61 62 + 61: Label + 64: 6(float) ConvertUToF 63 + 65: 7(fvec4) Load 20(color) + 66: 7(fvec4) VectorTimesScalar 65 64 + Store 20(color) 66 + Branch 62 + 62: Label + 69: 38(float) FConvert 68 + 70: 38(float) FDiv 67 69 + 71: 6(float) FConvert 70 + 72: 7(fvec4) Load 20(color) + 73: 7(fvec4) CompositeConstruct 71 71 71 71 + 74: 7(fvec4) FAdd 72 73 + Store 20(color) 74 Return FunctionEnd +17(builtin_spec_constant(): 8(int) Function None 16 + 18: Label + 76(result): 75(ptr) Variable Function + Store 76(result) 77 + 78: 8(int) Load 76(result) + ReturnValue 78 + FunctionEnd diff --git a/Test/baseResults/spv.specConstantComposite.vert.out b/Test/baseResults/spv.specConstantComposite.vert.out index 5e2dfa4a..c4585e40 100644 --- a/Test/baseResults/spv.specConstantComposite.vert.out +++ b/Test/baseResults/spv.specConstantComposite.vert.out @@ -7,13 +7,13 @@ Linked vertex stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 106 +// Id's are bound by 43 Capability Shader Capability Float64 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Vertex 4 "main" 27 105 + EntryPoint Vertex 4 "main" 27 42 Source GLSL 450 Name 4 "main" Name 6 "refer_primary_spec_const(" @@ -23,23 +23,12 @@ Linked vertex stage: Name 16 "refer_spec_const_array_length(" Name 18 "declare_spec_const_in_func(" Name 27 "color" - Name 41 "flat_struct" - MemberName 41(flat_struct) 0 "i" - MemberName 41(flat_struct) 1 "f" - MemberName 41(flat_struct) 2 "d" - MemberName 41(flat_struct) 3 "b" - Name 42 "nesting_struct" - MemberName 42(nesting_struct) 0 "nested" - MemberName 42(nesting_struct) 1 "v" - MemberName 42(nesting_struct) 2 "i" - Name 72 "indexable" - Name 76 "indexable" - Name 83 "len" - Name 105 "global_vec4_array_with_spec_length" + Name 33 "len" + Name 42 "global_vec4_array_with_spec_length" Decorate 21 SpecId 203 Decorate 28 SpecId 200 - Decorate 32 SpecId 201 - Decorate 43 SpecId 202 + Decorate 37 SpecId 201 + Decorate 39 SpecId 202 2: TypeVoid 3: TypeFunction 2 14: TypeInt 32 1 @@ -51,45 +40,13 @@ Linked vertex stage: 26: TypePointer Output 25(fvec4) 27(color): 26(ptr) Variable Output 28: 14(int) SpecConstant 3 - 32: 24(float) SpecConstant 1078523331 - 33: 25(fvec4) SpecConstantComposite 32 32 32 32 - 36: 24(float) Constant 1133908460 - 37: 25(fvec4) SpecConstantComposite 32 32 36 36 - 40: TypeFloat 64 - 41(flat_struct): TypeStruct 14(int) 24(float) 40(float) 20(bool) -42(nesting_struct): TypeStruct 41(flat_struct) 25(fvec4) 14(int) - 43: 40(float) SpecConstant 1413754136 1074340347 - 44:41(flat_struct) SpecConstantComposite 28 32 43 21 - 45:42(nesting_struct) SpecConstantComposite 44 33 28 - 46: 14(int) Constant 2 - 51: TypeInt 32 0 - 52: 51(int) Constant 0 - 57: 51(int) Constant 5 - 58: TypeArray 24(float) 57 - 59: 24(float) Constant 1065353216 - 60: 24(float) Constant 1073741824 - 61: 24(float) Constant 1077936128 - 62: 58 SpecConstantComposite 32 32 59 60 61 - 63: 14(int) Constant 1 - 68: TypeArray 14(int) 57 - 69: 14(int) Constant 30 - 70: 68 SpecConstantComposite 28 28 63 46 69 - 71: TypePointer Function 68 - 73: TypePointer Function 14(int) - 87: 24(float) Constant 1106321080 - 88:41(flat_struct) SpecConstantComposite 69 87 43 21 - 89: 14(int) Constant 10 - 90:42(nesting_struct) SpecConstantComposite 88 37 89 - 96: 20(bool) ConstantFalse - 97:41(flat_struct) SpecConstantComposite 28 32 43 96 - 98: 24(float) Constant 1036831949 - 99: 25(fvec4) ConstantComposite 98 98 98 98 - 100:42(nesting_struct) SpecConstantComposite 97 99 28 - 101: 14(int) Constant 3000 - 102:42(nesting_struct) SpecConstantComposite 88 37 101 - 103: TypeArray 25(fvec4) 28 - 104: TypePointer Input 103 -105(global_vec4_array_with_spec_length): 104(ptr) Variable Input + 32: TypePointer Function 14(int) + 37: 24(float) SpecConstant 1078523331 + 38: TypeFloat 64 + 39: 38(float) SpecConstant 1413754136 1074340347 + 40: TypeArray 25(fvec4) 28 + 41: TypePointer Input 40 +42(global_vec4_array_with_spec_length): 41(ptr) Variable Input 4(main): 2 Function None 3 5: Label Return @@ -109,64 +66,24 @@ Linked vertex stage: FunctionEnd 8(refer_composite_spec_const(): 2 Function None 3 9: Label - 34: 25(fvec4) Load 27(color) - 35: 25(fvec4) FAdd 34 33 - Store 27(color) 35 - 38: 25(fvec4) Load 27(color) - 39: 25(fvec4) FSub 38 37 - Store 27(color) 39 Return FunctionEnd 10(refer_copmosite_dot_dereference(): 2 Function None 3 11: Label - 47: 14(int) CompositeExtract 45 2 - 48: 24(float) ConvertSToF 47 - 49: 25(fvec4) Load 27(color) - 50: 25(fvec4) VectorTimesScalar 49 48 - Store 27(color) 50 - 53: 24(float) CompositeExtract 33 0 - 54: 25(fvec4) Load 27(color) - 55: 25(fvec4) CompositeConstruct 53 53 53 53 - 56: 25(fvec4) FAdd 54 55 - Store 27(color) 56 Return FunctionEnd 12(refer_composite_bracket_dereference(): 2 Function None 3 13: Label - 72(indexable): 71(ptr) Variable Function - 76(indexable): 71(ptr) Variable Function - 64: 24(float) CompositeExtract 62 1 - 65: 25(fvec4) Load 27(color) - 66: 25(fvec4) CompositeConstruct 64 64 64 64 - 67: 25(fvec4) FSub 65 66 - Store 27(color) 67 - Store 72(indexable) 70 - 74: 73(ptr) AccessChain 72(indexable) 28 - 75: 14(int) Load 74 - Store 76(indexable) 70 - 77: 73(ptr) AccessChain 76(indexable) 75 - 78: 14(int) Load 77 - 79: 24(float) ConvertSToF 78 - 80: 25(fvec4) Load 27(color) - 81: 25(fvec4) CompositeConstruct 79 79 79 79 - 82: 25(fvec4) FDiv 80 81 - Store 27(color) 82 Return FunctionEnd 16(refer_spec_const_array_length(): 14(int) Function None 15 17: Label - 83(len): 73(ptr) Variable Function - Store 83(len) 28 - 84: 14(int) Load 83(len) - ReturnValue 84 + 33(len): 32(ptr) Variable Function + Store 33(len) 28 + 34: 14(int) Load 33(len) + ReturnValue 34 FunctionEnd 18(declare_spec_const_in_func(): 2 Function None 3 19: Label - 91: 14(int) CompositeExtract 90 2 - 92: 24(float) ConvertSToF 91 - 93: 25(fvec4) Load 27(color) - 94: 25(fvec4) CompositeConstruct 92 92 92 92 - 95: 25(fvec4) FDiv 93 94 - Store 27(color) 95 Return FunctionEnd diff --git a/Test/baseResults/spv.specConstantOperations.vert.out b/Test/baseResults/spv.specConstantOperations.vert.out new file mode 100644 index 00000000..ea4c69a2 --- /dev/null +++ b/Test/baseResults/spv.specConstantOperations.vert.out @@ -0,0 +1,164 @@ +spv.specConstantOperations.vert +Warning, version 450 is not yet complete; most version-specific features are present, but some are missing. + + +Linked vertex stage: + + +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 131 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" + Source GLSL 450 + Name 4 "main" + Name 8 "non_const_array_size_from_spec_const(" + Name 11 "i" + Name 27 "array" + Decorate 19 SpecId 201 + Decorate 40 SpecId 200 + Decorate 42 SpecId 202 + Decorate 43 SpecId 203 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeInt 32 1 + 7: TypeFunction 6(int) + 10: TypePointer Function 6(int) + 12: 6(int) Constant 0 + 19: 6(int) SpecConstant 10 + 20: 6(int) Constant 2 + 21: 6(int) SpecConstantOp 128 19 20 + 22: TypeBool + 24: 6(int) SpecConstantOp 128 19 20 + 25: TypeArray 6(int) 24 + 26: TypePointer Function 25 + 29: 6(int) Constant 1023 + 32: 6(int) Constant 1 + 34: 6(int) SpecConstantOp 128 19 32 + 39: TypeFloat 32 + 40: 39(float) SpecConstant 1078530010 + 41: TypeInt 32 0 + 42: 41(int) SpecConstant 100 + 43: 6(int) SpecConstant 4294967286 + 44: 41(int) Constant 0 + 45: 22(bool) SpecConstantOp 171 19 44 + 46: 22(bool) SpecConstantOp 171 42 44 + 47: 6(int) SpecConstantOp 169 45 32 12 + 48: 41(int) Constant 1 + 49: 41(int) SpecConstantOp 169 45 48 44 + 50: 41(int) SpecConstantOp 128 43 44 + 51: 6(int) SpecConstantOp 128 42 44 + 52: 6(int) SpecConstantOp 126 19 + 53: 6(int) SpecConstantOp 200 19 + 54: 6(int) SpecConstantOp 128 19 20 + 55: 6(int) SpecConstantOp 128 19 20 + 56: 6(int) Constant 3 + 57: 6(int) SpecConstantOp 130 55 56 + 58: 6(int) Constant 4 + 59: 6(int) SpecConstantOp 130 54 58 + 60: 6(int) SpecConstantOp 132 43 20 + 61: 41(int) Constant 2 + 62: 41(int) SpecConstantOp 132 42 61 + 63: 6(int) Constant 5 + 64: 6(int) SpecConstantOp 135 60 63 + 65: 41(int) Constant 5 + 66: 41(int) SpecConstantOp 134 62 65 + 67: 6(int) SpecConstantOp 139 43 58 + 68: 41(int) Constant 4 + 69: 41(int) SpecConstantOp 137 42 68 + 70: 6(int) SpecConstantOp 132 43 56 + 71: 6(int) SpecConstantOp 135 70 63 + 72: 6(int) Constant 10 + 73: 6(int) SpecConstantOp 195 43 72 + 74: 6(int) Constant 20 + 75: 41(int) SpecConstantOp 194 42 74 + 76: 6(int) SpecConstantOp 196 43 32 + 77: 41(int) SpecConstantOp 196 42 20 + 78: 6(int) Constant 256 + 79: 6(int) SpecConstantOp 197 43 78 + 80: 41(int) Constant 512 + 81: 41(int) SpecConstantOp 198 42 80 + 82: 22(bool) SpecConstantOp 177 19 43 + 83: 22(bool) SpecConstantOp 170 42 42 + 84: 22(bool) SpecConstantOp 173 19 43 + 85: 6(int) Constant 30 + 86: TypeVector 6(int) 4 + 87: 86(ivec4) SpecConstantComposite 74 85 19 19 + 88: 41(int) Constant 4294967295 + 89: 41(int) Constant 4294967294 + 90: TypeVector 41(int) 4 + 91: 90(ivec4) SpecConstantComposite 42 42 88 89 + 92: TypeVector 22(bool) 4 + 93: 90(ivec4) ConstantComposite 44 44 44 44 + 94: 92(bvec4) SpecConstantOp 171 87 93 + 95: 92(bvec4) SpecConstantOp 171 91 93 + 96: 86(ivec4) ConstantComposite 12 12 12 12 + 97: 86(ivec4) ConstantComposite 32 32 32 32 + 98: 86(ivec4) SpecConstantOp 169 94 97 96 + 99: 90(ivec4) ConstantComposite 48 48 48 48 + 100: 90(ivec4) SpecConstantOp 169 94 99 93 + 101: 90(ivec4) SpecConstantOp 128 87 93 + 102: 86(ivec4) SpecConstantOp 128 91 93 + 103: 86(ivec4) SpecConstantOp 200 87 + 104: 86(ivec4) SpecConstantOp 126 87 + 105: 86(ivec4) ConstantComposite 20 20 20 20 + 106: 86(ivec4) SpecConstantOp 128 87 105 + 107: 86(ivec4) SpecConstantOp 128 87 105 + 108: 86(ivec4) ConstantComposite 56 56 56 56 + 109: 86(ivec4) SpecConstantOp 130 107 108 + 110: 86(ivec4) ConstantComposite 58 58 58 58 + 111: 86(ivec4) SpecConstantOp 130 109 110 + 112: 86(ivec4) SpecConstantOp 132 87 105 + 113: 86(ivec4) ConstantComposite 63 63 63 63 + 114: 86(ivec4) SpecConstantOp 135 112 113 + 115: 86(ivec4) SpecConstantOp 139 87 110 + 116: 86(ivec4) ConstantComposite 72 72 72 72 + 117: 86(ivec4) SpecConstantOp 195 87 116 + 118: 86(ivec4) SpecConstantOp 196 87 105 + 119: 6(int) Constant 1024 + 120: 86(ivec4) ConstantComposite 119 119 119 119 + 121: 86(ivec4) SpecConstantOp 197 87 120 + 122: 41(int) Constant 2048 + 123: 90(ivec4) ConstantComposite 122 122 122 122 + 124: 90(ivec4) SpecConstantOp 198 91 123 + 125: 6(int) SpecConstantOp 81 87 0 + 126: TypeVector 6(int) 2 + 127: 126(ivec2) SpecConstantOp 79 87 87 1(GLSL.std.450) 0 + 128: TypeVector 6(int) 3 + 129: 128(ivec3) SpecConstantOp 79 87 87 2 1(GLSL.std.450) 0 + 130: 86(ivec4) SpecConstantOp 79 87 87 1(GLSL.std.450) 2 0 3 + 4(main): 2 Function None 3 + 5: Label + Return + FunctionEnd +8(non_const_array_size_from_spec_const(): 6(int) Function None 7 + 9: Label + 11(i): 10(ptr) Variable Function + 27(array): 26(ptr) Variable Function + Store 11(i) 12 + Branch 13 + 13: Label + LoopMerge 15 16 None + Branch 17 + 17: Label + 18: 6(int) Load 11(i) + 23: 22(bool) SLessThan 18 21 + BranchConditional 23 14 15 + 14: Label + 28: 6(int) Load 11(i) + 30: 10(ptr) AccessChain 27(array) 28 + Store 30 29 + Branch 16 + 16: Label + 31: 6(int) Load 11(i) + 33: 6(int) IAdd 31 32 + Store 11(i) 33 + Branch 13 + 15: Label + 35: 10(ptr) AccessChain 27(array) 34 + 36: 6(int) Load 35 + ReturnValue 36 + FunctionEnd diff --git a/Test/baseResults/spv.subpass.frag.out b/Test/baseResults/spv.subpass.frag.out index 6393f6f2..4b972aca 100644 --- a/Test/baseResults/spv.subpass.frag.out +++ b/Test/baseResults/spv.subpass.frag.out @@ -7,7 +7,7 @@ Linked fragment stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 70 +// Id's are bound by 68 Capability Shader Capability InputAttachment @@ -28,7 +28,6 @@ Linked fragment stage: Name 54 "ucolor" Name 57 "usub" Name 62 "usubMS" - Name 67 "param" Decorate 30(sub) DescriptorSet 0 Decorate 30(sub) InputAttachmentIndex 1 Decorate 35(subMS) DescriptorSet 0 @@ -81,7 +80,6 @@ Linked fragment stage: 62(usubMS): 61(ptr) Variable UniformConstant 4(main): 2 Function None 3 5: Label - 67(param): 8(ptr) Variable Function 31: 28 Load 30(sub) 32: 25(fvec4) ImageRead 31 20 Store 27(color) 32 @@ -106,9 +104,7 @@ Linked fragment stage: 65: 52(ivec4) Load 54(ucolor) 66: 52(ivec4) IAdd 65 64 Store 54(ucolor) 66 - 68: 7 Load 46(isubMS) - Store 67(param) 68 - 69: 2 FunctionCall 11(foo(iIPM1;) 67(param) + 67: 2 FunctionCall 11(foo(iIPM1;) 46(isubMS) Return FunctionEnd 11(foo(iIPM1;): 2 Function None 9 diff --git a/Test/baseResults/spv.test.frag.out b/Test/baseResults/spv.test.frag.out old mode 100755 new mode 100644 diff --git a/Test/baseResults/spv.test.vert.out b/Test/baseResults/spv.test.vert.out old mode 100755 new mode 100644 diff --git a/Test/baseResults/spv.texture.frag.out b/Test/baseResults/spv.texture.frag.out index df5fe2be..b5794751 100755 --- a/Test/baseResults/spv.texture.frag.out +++ b/Test/baseResults/spv.texture.frag.out @@ -9,13 +9,13 @@ Linked fragment stage: // Module Version 10000 // Generated by (magic number): 80001 -// Id's are bound by 290 +// Id's are bound by 291 Capability Shader Capability Sampled1D 1: ExtInstImport "GLSL.std.450" MemoryModel Logical GLSL450 - EntryPoint Fragment 4 "main" 47 276 279 282 288 289 + EntryPoint Fragment 4 "main" 47 277 280 283 289 290 ExecutionMode 4 OriginUpperLeft Source GLSL 140 Name 4 "main" @@ -36,13 +36,13 @@ Linked fragment stage: Name 158 "shadowSampler2D" Name 207 "iCoords2D" Name 212 "iLod" - Name 221 "gradX" - Name 224 "gradY" - Name 276 "gl_FragColor" - Name 279 "u" - Name 282 "blend" - Name 288 "scale" - Name 289 "t" + Name 222 "gradX" + Name 225 "gradY" + Name 277 "gl_FragColor" + Name 280 "u" + Name 283 "blend" + Name 289 "scale" + Name 290 "t" Decorate 32(texSampler1D) DescriptorSet 0 Decorate 72(texSampler2D) DescriptorSet 0 Decorate 98(texSampler3D) DescriptorSet 0 @@ -101,18 +101,18 @@ Linked fragment stage: 210: 205(ivec2) ConstantComposite 208 209 211: TypePointer Function 204(int) 213: 204(int) Constant 1 - 220: TypePointer Function 45(fvec2) - 249: 204(int) Constant 3 - 250: 204(int) Constant 4294967289 - 251: 205(ivec2) ConstantComposite 249 250 - 275: TypePointer Output 22(fvec4) -276(gl_FragColor): 275(ptr) Variable Output - 278: TypePointer Input 22(fvec4) - 279(u): 278(ptr) Variable Input - 281: TypePointer Input 6(float) - 282(blend): 281(ptr) Variable Input - 288(scale): 46(ptr) Variable Input - 289(t): 46(ptr) Variable Input + 221: TypePointer Function 45(fvec2) + 250: 204(int) Constant 3 + 251: 204(int) Constant 4294967289 + 252: 205(ivec2) ConstantComposite 250 251 + 276: TypePointer Output 22(fvec4) +277(gl_FragColor): 276(ptr) Variable Output + 279: TypePointer Input 22(fvec4) + 280(u): 279(ptr) Variable Input + 282: TypePointer Input 6(float) + 283(blend): 282(ptr) Variable Input + 289(scale): 46(ptr) Variable Input + 290(t): 46(ptr) Variable Input 4(main): 2 Function None 3 5: Label 8(blendscale): 7(ptr) Variable Function @@ -125,8 +125,8 @@ Linked fragment stage: 26(color): 23(ptr) Variable Function 207(iCoords2D): 206(ptr) Variable Function 212(iLod): 211(ptr) Variable Function - 221(gradX): 220(ptr) Variable Function - 224(gradY): 220(ptr) Variable Function + 222(gradX): 221(ptr) Variable Function + 225(gradY): 221(ptr) Variable Function Store 8(blendscale) 9 Store 10(bias) 11 Store 12(lod) 13 @@ -312,73 +312,74 @@ Linked fragment stage: 214: 70 Load 72(texSampler2D) 215: 205(ivec2) Load 207(iCoords2D) 216: 204(int) Load 212(iLod) - 217: 22(fvec4) ImageFetch 214 215 Lod 216 - 218: 22(fvec4) Load 26(color) - 219: 22(fvec4) FAdd 218 217 - Store 26(color) 219 - 222: 45(fvec2) Load 47(coords2D) - 223: 45(fvec2) DPdx 222 - Store 221(gradX) 223 - 225: 45(fvec2) Load 47(coords2D) - 226: 45(fvec2) DPdy 225 - Store 224(gradY) 226 - 227: 70 Load 72(texSampler2D) - 228: 45(fvec2) Load 47(coords2D) - 229: 45(fvec2) Load 221(gradX) - 230: 45(fvec2) Load 224(gradY) - 231: 22(fvec4) ImageSampleExplicitLod 227 228 Grad 229 230 - 232: 22(fvec4) Load 26(color) - 233: 22(fvec4) FAdd 232 231 - Store 26(color) 233 - 234: 70 Load 72(texSampler2D) - 235: 45(fvec2) Load 47(coords2D) - 236: 6(float) Load 14(proj) - 237: 6(float) CompositeExtract 235 0 - 238: 6(float) CompositeExtract 235 1 - 239: 16(fvec3) CompositeConstruct 237 238 236 - 240: 45(fvec2) Load 221(gradX) - 241: 45(fvec2) Load 224(gradY) - 242: 22(fvec4) ImageSampleProjExplicitLod 234 239 Grad 240 241 - 243: 22(fvec4) Load 26(color) - 244: 22(fvec4) FAdd 243 242 - Store 26(color) 244 - 245: 70 Load 72(texSampler2D) - 246: 45(fvec2) Load 47(coords2D) - 247: 45(fvec2) Load 221(gradX) - 248: 45(fvec2) Load 224(gradY) - 252: 22(fvec4) ImageSampleExplicitLod 245 246 Grad ConstOffset 247 248 251 - 253: 22(fvec4) Load 26(color) - 254: 22(fvec4) FAdd 253 252 - Store 26(color) 254 - 255: 70 Load 72(texSampler2D) - 256: 16(fvec3) Load 18(coords3D) - 257: 45(fvec2) Load 221(gradX) - 258: 45(fvec2) Load 224(gradY) - 259: 22(fvec4) ImageSampleProjExplicitLod 255 256 Grad ConstOffset 257 258 251 - 260: 22(fvec4) Load 26(color) - 261: 22(fvec4) FAdd 260 259 - Store 26(color) 261 - 262: 156 Load 158(shadowSampler2D) - 263: 45(fvec2) Load 47(coords2D) - 264: 6(float) Load 12(lod) - 265: 6(float) CompositeExtract 263 0 - 266: 6(float) CompositeExtract 263 1 - 267: 16(fvec3) CompositeConstruct 265 266 264 - 268: 45(fvec2) Load 221(gradX) - 269: 45(fvec2) Load 224(gradY) - 270: 6(float) CompositeExtract 267 2 - 271: 6(float) ImageSampleDrefExplicitLod 262 267 270 Grad 268 269 - 272: 22(fvec4) Load 26(color) - 273: 22(fvec4) CompositeConstruct 271 271 271 271 - 274: 22(fvec4) FAdd 272 273 - Store 26(color) 274 - 277: 22(fvec4) Load 26(color) - 280: 22(fvec4) Load 279(u) - 283: 6(float) Load 282(blend) - 284: 6(float) Load 8(blendscale) - 285: 6(float) FMul 283 284 - 286: 22(fvec4) CompositeConstruct 285 285 285 285 - 287: 22(fvec4) ExtInst 1(GLSL.std.450) 46(FMix) 277 280 286 - Store 276(gl_FragColor) 287 + 217: 69 Image 214 + 218: 22(fvec4) ImageFetch 217 215 Lod 216 + 219: 22(fvec4) Load 26(color) + 220: 22(fvec4) FAdd 219 218 + Store 26(color) 220 + 223: 45(fvec2) Load 47(coords2D) + 224: 45(fvec2) DPdx 223 + Store 222(gradX) 224 + 226: 45(fvec2) Load 47(coords2D) + 227: 45(fvec2) DPdy 226 + Store 225(gradY) 227 + 228: 70 Load 72(texSampler2D) + 229: 45(fvec2) Load 47(coords2D) + 230: 45(fvec2) Load 222(gradX) + 231: 45(fvec2) Load 225(gradY) + 232: 22(fvec4) ImageSampleExplicitLod 228 229 Grad 230 231 + 233: 22(fvec4) Load 26(color) + 234: 22(fvec4) FAdd 233 232 + Store 26(color) 234 + 235: 70 Load 72(texSampler2D) + 236: 45(fvec2) Load 47(coords2D) + 237: 6(float) Load 14(proj) + 238: 6(float) CompositeExtract 236 0 + 239: 6(float) CompositeExtract 236 1 + 240: 16(fvec3) CompositeConstruct 238 239 237 + 241: 45(fvec2) Load 222(gradX) + 242: 45(fvec2) Load 225(gradY) + 243: 22(fvec4) ImageSampleProjExplicitLod 235 240 Grad 241 242 + 244: 22(fvec4) Load 26(color) + 245: 22(fvec4) FAdd 244 243 + Store 26(color) 245 + 246: 70 Load 72(texSampler2D) + 247: 45(fvec2) Load 47(coords2D) + 248: 45(fvec2) Load 222(gradX) + 249: 45(fvec2) Load 225(gradY) + 253: 22(fvec4) ImageSampleExplicitLod 246 247 Grad ConstOffset 248 249 252 + 254: 22(fvec4) Load 26(color) + 255: 22(fvec4) FAdd 254 253 + Store 26(color) 255 + 256: 70 Load 72(texSampler2D) + 257: 16(fvec3) Load 18(coords3D) + 258: 45(fvec2) Load 222(gradX) + 259: 45(fvec2) Load 225(gradY) + 260: 22(fvec4) ImageSampleProjExplicitLod 256 257 Grad ConstOffset 258 259 252 + 261: 22(fvec4) Load 26(color) + 262: 22(fvec4) FAdd 261 260 + Store 26(color) 262 + 263: 156 Load 158(shadowSampler2D) + 264: 45(fvec2) Load 47(coords2D) + 265: 6(float) Load 12(lod) + 266: 6(float) CompositeExtract 264 0 + 267: 6(float) CompositeExtract 264 1 + 268: 16(fvec3) CompositeConstruct 266 267 265 + 269: 45(fvec2) Load 222(gradX) + 270: 45(fvec2) Load 225(gradY) + 271: 6(float) CompositeExtract 268 2 + 272: 6(float) ImageSampleDrefExplicitLod 263 268 271 Grad 269 270 + 273: 22(fvec4) Load 26(color) + 274: 22(fvec4) CompositeConstruct 272 272 272 272 + 275: 22(fvec4) FAdd 273 274 + Store 26(color) 275 + 278: 22(fvec4) Load 26(color) + 281: 22(fvec4) Load 280(u) + 284: 6(float) Load 283(blend) + 285: 6(float) Load 8(blendscale) + 286: 6(float) FMul 284 285 + 287: 22(fvec4) CompositeConstruct 286 286 286 286 + 288: 22(fvec4) ExtInst 1(GLSL.std.450) 46(FMix) 278 281 287 + Store 277(gl_FragColor) 288 Return FunctionEnd diff --git a/Test/baseResults/spv.variableArrayIndex.frag.out b/Test/baseResults/spv.variableArrayIndex.frag.out index 75ed07ee..43df45f5 100755 --- a/Test/baseResults/spv.variableArrayIndex.frag.out +++ b/Test/baseResults/spv.variableArrayIndex.frag.out @@ -52,19 +52,10 @@ Linked fragment stage: Name 67 "coord" Name 73 "constructed" Decorate 10(Count) Flat - MemberDecorate 13(lunarStruct1) 0 Flat - MemberDecorate 13(lunarStruct1) 1 Flat - MemberDecorate 14(lunarStruct2) 0 Flat - MemberDecorate 14(lunarStruct2) 1 Flat - MemberDecorate 14(lunarStruct2) 2 Flat - MemberDecorate 18(lunarStruct1) 0 Flat - MemberDecorate 18(lunarStruct1) 1 Flat MemberDecorate 19(lunarStruct3) 0 Flat MemberDecorate 19(lunarStruct3) 1 Flat MemberDecorate 19(lunarStruct3) 2 Flat MemberDecorate 19(lunarStruct3) 3 Flat - MemberDecorate 32(lunarStruct1) 0 Flat - MemberDecorate 32(lunarStruct1) 1 Flat MemberDecorate 33(lunarStruct2) 0 Flat MemberDecorate 33(lunarStruct2) 1 Flat MemberDecorate 33(lunarStruct2) 2 Flat diff --git a/Test/baseResults/uint.frag.out b/Test/baseResults/uint.frag.out index c06ad846..dbe9578d 100644 --- a/Test/baseResults/uint.frag.out +++ b/Test/baseResults/uint.frag.out @@ -113,7 +113,7 @@ ERROR: node is still EOpNull! 0:55 true case 0:56 move second child to first child (temp mediump 4-component vector of uint) 0:56 'c' (out mediump 4-component vector of uint) -0:56 texture (global mediump 4-component vector of uint) +0:56 texture (global lowp 4-component vector of uint) 0:56 'usampler' (uniform lowp usampler2D) 0:56 'tc' (smooth in highp 2-component vector of float) 0:57 Test condition and select (temp void) @@ -124,7 +124,7 @@ ERROR: node is still EOpNull! 0:57 true case 0:58 move second child to first child (temp mediump 4-component vector of uint) 0:58 'c' (out mediump 4-component vector of uint) -0:58 texture (global mediump 4-component vector of uint) +0:58 texture (global lowp 4-component vector of uint) 0:58 'usampler' (uniform lowp usampler2D) 0:58 add (temp highp 2-component vector of float) 0:58 'tc' (smooth in highp 2-component vector of float) @@ -139,7 +139,7 @@ ERROR: node is still EOpNull! 0:59 true case 0:60 move second child to first child (temp mediump 4-component vector of uint) 0:60 'c' (out mediump 4-component vector of uint) -0:60 texture (global mediump 4-component vector of uint) +0:60 texture (global lowp 4-component vector of uint) 0:60 'usampler' (uniform lowp usampler2D) 0:60 subtract (temp highp 2-component vector of float) 0:60 'tc' (smooth in highp 2-component vector of float) @@ -412,7 +412,7 @@ ERROR: node is still EOpNull! 0:55 true case 0:56 move second child to first child (temp mediump 4-component vector of uint) 0:56 'c' (out mediump 4-component vector of uint) -0:56 texture (global mediump 4-component vector of uint) +0:56 texture (global lowp 4-component vector of uint) 0:56 'usampler' (uniform lowp usampler2D) 0:56 'tc' (smooth in highp 2-component vector of float) 0:57 Test condition and select (temp void) @@ -423,7 +423,7 @@ ERROR: node is still EOpNull! 0:57 true case 0:58 move second child to first child (temp mediump 4-component vector of uint) 0:58 'c' (out mediump 4-component vector of uint) -0:58 texture (global mediump 4-component vector of uint) +0:58 texture (global lowp 4-component vector of uint) 0:58 'usampler' (uniform lowp usampler2D) 0:58 add (temp highp 2-component vector of float) 0:58 'tc' (smooth in highp 2-component vector of float) @@ -438,7 +438,7 @@ ERROR: node is still EOpNull! 0:59 true case 0:60 move second child to first child (temp mediump 4-component vector of uint) 0:60 'c' (out mediump 4-component vector of uint) -0:60 texture (global mediump 4-component vector of uint) +0:60 texture (global lowp 4-component vector of uint) 0:60 'usampler' (uniform lowp usampler2D) 0:60 subtract (temp highp 2-component vector of float) 0:60 'tc' (smooth in highp 2-component vector of float) diff --git a/Test/baseResults/vulkan.ast.vert.out b/Test/baseResults/vulkan.ast.vert.out new file mode 100755 index 00000000..31ac4940 --- /dev/null +++ b/Test/baseResults/vulkan.ast.vert.out @@ -0,0 +1,324 @@ +vulkan.ast.vert +Warning, version 450 is not yet complete; most version-specific features are present, but some are missing. + +Shader version: 450 +0:? Sequence +0:7 Function Definition: main( (global void) +0:7 Function Parameters: +0:9 Sequence +0:9 Convert float to bool (temp bool) +0:9 'scf1' (specialization-constant const float) +0:9 1.000000 +0:10 Construct bool (specialization-constant const bool) +0:10 'scbt' (specialization-constant const bool) +0:10 true (const bool) +0:11 Convert int to bool (specialization-constant const bool) +0:11 'sci2' (specialization-constant const int) +0:11 2 (const int) +0:13 Construct float (temp float) +0:13 'scf1' (specialization-constant const float) +0:13 1.000000 +0:14 Convert bool to float (temp float) +0:14 'scbt' (specialization-constant const bool) +0:14 true (const bool) +0:15 Convert int to float (temp float) +0:15 'sci2' (specialization-constant const int) +0:15 2 (const int) +0:17 Convert float to int (temp int) +0:17 'scf1' (specialization-constant const float) +0:17 1.000000 +0:18 Convert bool to int (specialization-constant const int) +0:18 'scbt' (specialization-constant const bool) +0:18 true (const bool) +0:19 Construct int (specialization-constant const int) +0:19 'sci2' (specialization-constant const int) +0:19 2 (const int) +0:21 component-wise multiply (temp float) +0:21 'scf1' (specialization-constant const float) +0:21 1.000000 +0:21 'scf1' (specialization-constant const float) +0:21 1.000000 +0:22 logical-or (specialization-constant const bool) +0:22 'scbt' (specialization-constant const bool) +0:22 true (const bool) +0:22 'scbt' (specialization-constant const bool) +0:22 true (const bool) +0:23 component-wise multiply (specialization-constant const int) +0:23 'sci2' (specialization-constant const int) +0:23 2 (const int) +0:23 'sci2' (specialization-constant const int) +0:23 2 (const int) +0:24 add (temp float) +0:24 'scf1' (specialization-constant const float) +0:24 1.000000 +0:24 Convert int to float (temp float) +0:24 'sci2' (specialization-constant const int) +0:24 2 (const int) +0:26 Negate value (temp float) +0:26 'scf1' (specialization-constant const float) +0:26 1.000000 +0:27 Negate conditional (specialization-constant const bool) +0:27 'scbt' (specialization-constant const bool) +0:27 true (const bool) +0:28 Negate value (specialization-constant const int) +0:28 'sci2' (specialization-constant const int) +0:28 2 (const int) +0:30 Compare Greater Than (temp bool) +0:30 'scf1' (specialization-constant const float) +0:30 1.000000 +0:30 'scf1' (specialization-constant const float) +0:30 1.000000 +0:31 Compare Greater Than (specialization-constant const bool) +0:31 'sci2' (specialization-constant const int) +0:31 2 (const int) +0:31 'sci2' (specialization-constant const int) +0:31 2 (const int) +0:33 Compare Not Equal (temp bool) +0:33 'scf1' (specialization-constant const float) +0:33 1.000000 +0:33 'scf1' (specialization-constant const float) +0:33 1.000000 +0:34 Compare Not Equal (specialization-constant const bool) +0:34 'scbt' (specialization-constant const bool) +0:34 true (const bool) +0:34 'scbt' (specialization-constant const bool) +0:34 true (const bool) +0:35 Compare Not Equal (specialization-constant const bool) +0:35 'sci2' (specialization-constant const int) +0:35 2 (const int) +0:35 'sci2' (specialization-constant const int) +0:35 2 (const int) +0:37 Construct ivec2 (specialization-constant const 2-component vector of int) +0:37 'sci2' (specialization-constant const int) +0:37 2 (const int) +0:37 'sci2' (specialization-constant const int) +0:37 2 (const int) +0:38 Construct ivec2 (temp 2-element array of 2-component vector of int) +0:38 Construct ivec2 (specialization-constant const 2-component vector of int) +0:38 'sci2' (specialization-constant const int) +0:38 2 (const int) +0:38 'sci2' (specialization-constant const int) +0:38 2 (const int) +0:38 Construct ivec2 (specialization-constant const 2-component vector of int) +0:38 'sci2' (specialization-constant const int) +0:38 2 (const int) +0:38 'sci2' (specialization-constant const int) +0:38 2 (const int) +0:40 Construct vec2 (temp 2-component vector of float) +0:40 'scf1' (specialization-constant const float) +0:40 1.000000 +0:40 'scf1' (specialization-constant const float) +0:40 1.000000 +0:41 Construct vec2 (temp 2-element array of 2-component vector of float) +0:41 Construct vec2 (temp 2-component vector of float) +0:41 'scf1' (specialization-constant const float) +0:41 1.000000 +0:41 'scf1' (specialization-constant const float) +0:41 1.000000 +0:41 Construct vec2 (temp 2-component vector of float) +0:41 'scf1' (specialization-constant const float) +0:41 1.000000 +0:41 'scf1' (specialization-constant const float) +0:41 1.000000 +0:? Linker Objects +0:? 'scf1' (specialization-constant const float) +0:? 1.000000 +0:? 'scbt' (specialization-constant const bool) +0:? true (const bool) +0:? 'sci2' (specialization-constant const int) +0:? 2 (const int) + + +Linked vertex stage: + + +Shader version: 450 +0:? Sequence +0:7 Function Definition: main( (global void) +0:7 Function Parameters: +0:9 Sequence +0:9 Convert float to bool (temp bool) +0:9 'scf1' (specialization-constant const float) +0:9 1.000000 +0:10 Construct bool (specialization-constant const bool) +0:10 'scbt' (specialization-constant const bool) +0:10 true (const bool) +0:11 Convert int to bool (specialization-constant const bool) +0:11 'sci2' (specialization-constant const int) +0:11 2 (const int) +0:13 Construct float (temp float) +0:13 'scf1' (specialization-constant const float) +0:13 1.000000 +0:14 Convert bool to float (temp float) +0:14 'scbt' (specialization-constant const bool) +0:14 true (const bool) +0:15 Convert int to float (temp float) +0:15 'sci2' (specialization-constant const int) +0:15 2 (const int) +0:17 Convert float to int (temp int) +0:17 'scf1' (specialization-constant const float) +0:17 1.000000 +0:18 Convert bool to int (specialization-constant const int) +0:18 'scbt' (specialization-constant const bool) +0:18 true (const bool) +0:19 Construct int (specialization-constant const int) +0:19 'sci2' (specialization-constant const int) +0:19 2 (const int) +0:21 component-wise multiply (temp float) +0:21 'scf1' (specialization-constant const float) +0:21 1.000000 +0:21 'scf1' (specialization-constant const float) +0:21 1.000000 +0:22 logical-or (specialization-constant const bool) +0:22 'scbt' (specialization-constant const bool) +0:22 true (const bool) +0:22 'scbt' (specialization-constant const bool) +0:22 true (const bool) +0:23 component-wise multiply (specialization-constant const int) +0:23 'sci2' (specialization-constant const int) +0:23 2 (const int) +0:23 'sci2' (specialization-constant const int) +0:23 2 (const int) +0:24 add (temp float) +0:24 'scf1' (specialization-constant const float) +0:24 1.000000 +0:24 Convert int to float (temp float) +0:24 'sci2' (specialization-constant const int) +0:24 2 (const int) +0:26 Negate value (temp float) +0:26 'scf1' (specialization-constant const float) +0:26 1.000000 +0:27 Negate conditional (specialization-constant const bool) +0:27 'scbt' (specialization-constant const bool) +0:27 true (const bool) +0:28 Negate value (specialization-constant const int) +0:28 'sci2' (specialization-constant const int) +0:28 2 (const int) +0:30 Compare Greater Than (temp bool) +0:30 'scf1' (specialization-constant const float) +0:30 1.000000 +0:30 'scf1' (specialization-constant const float) +0:30 1.000000 +0:31 Compare Greater Than (specialization-constant const bool) +0:31 'sci2' (specialization-constant const int) +0:31 2 (const int) +0:31 'sci2' (specialization-constant const int) +0:31 2 (const int) +0:33 Compare Not Equal (temp bool) +0:33 'scf1' (specialization-constant const float) +0:33 1.000000 +0:33 'scf1' (specialization-constant const float) +0:33 1.000000 +0:34 Compare Not Equal (specialization-constant const bool) +0:34 'scbt' (specialization-constant const bool) +0:34 true (const bool) +0:34 'scbt' (specialization-constant const bool) +0:34 true (const bool) +0:35 Compare Not Equal (specialization-constant const bool) +0:35 'sci2' (specialization-constant const int) +0:35 2 (const int) +0:35 'sci2' (specialization-constant const int) +0:35 2 (const int) +0:37 Construct ivec2 (specialization-constant const 2-component vector of int) +0:37 'sci2' (specialization-constant const int) +0:37 2 (const int) +0:37 'sci2' (specialization-constant const int) +0:37 2 (const int) +0:38 Construct ivec2 (temp 2-element array of 2-component vector of int) +0:38 Construct ivec2 (specialization-constant const 2-component vector of int) +0:38 'sci2' (specialization-constant const int) +0:38 2 (const int) +0:38 'sci2' (specialization-constant const int) +0:38 2 (const int) +0:38 Construct ivec2 (specialization-constant const 2-component vector of int) +0:38 'sci2' (specialization-constant const int) +0:38 2 (const int) +0:38 'sci2' (specialization-constant const int) +0:38 2 (const int) +0:40 Construct vec2 (temp 2-component vector of float) +0:40 'scf1' (specialization-constant const float) +0:40 1.000000 +0:40 'scf1' (specialization-constant const float) +0:40 1.000000 +0:41 Construct vec2 (temp 2-element array of 2-component vector of float) +0:41 Construct vec2 (temp 2-component vector of float) +0:41 'scf1' (specialization-constant const float) +0:41 1.000000 +0:41 'scf1' (specialization-constant const float) +0:41 1.000000 +0:41 Construct vec2 (temp 2-component vector of float) +0:41 'scf1' (specialization-constant const float) +0:41 1.000000 +0:41 'scf1' (specialization-constant const float) +0:41 1.000000 +0:? Linker Objects +0:? 'scf1' (specialization-constant const float) +0:? 1.000000 +0:? 'scbt' (specialization-constant const bool) +0:? true (const bool) +0:? 'sci2' (specialization-constant const int) +0:? 2 (const int) + +// Module Version 10000 +// Generated by (magic number): 80001 +// Id's are bound by 50 + + Capability Shader + 1: ExtInstImport "GLSL.std.450" + MemoryModel Logical GLSL450 + EntryPoint Vertex 4 "main" + Source GLSL 450 + Name 4 "main" + Decorate 7 SpecId 200 + Decorate 11 SpecId 201 + Decorate 13 SpecId 202 + 2: TypeVoid + 3: TypeFunction 2 + 6: TypeFloat 32 + 7: 6(float) SpecConstant 1065353216 + 8: TypeBool + 9: 6(float) Constant 0 + 11: 8(bool) SpecConstantTrue + 12: TypeInt 32 1 + 13: 12(int) SpecConstant 2 + 14: TypeInt 32 0 + 15: 14(int) Constant 0 + 16: 8(bool) SpecConstantOp 171 13 15 + 17: 6(float) Constant 1065353216 + 21: 12(int) Constant 0 + 22: 12(int) Constant 1 + 23: 12(int) SpecConstantOp 169 11 22 21 + 25: 8(bool) SpecConstantOp 166 11 11 + 26: 12(int) SpecConstantOp 132 13 13 + 30: 8(bool) SpecConstantOp 168 11 + 31: 12(int) SpecConstantOp 126 13 + 33: 8(bool) SpecConstantOp 173 13 13 + 35: 8(bool) SpecConstantOp 165 11 11 + 36: 8(bool) SpecConstantOp 171 13 13 + 37: TypeVector 12(int) 2 + 38: 37(ivec2) SpecConstantComposite 13 13 + 39: 37(ivec2) SpecConstantComposite 13 13 + 40: 37(ivec2) SpecConstantComposite 13 13 + 41: 14(int) Constant 2 + 42: TypeArray 37(ivec2) 41 + 44: TypeVector 6(float) 2 + 48: TypeArray 44(fvec2) 41 + 4(main): 2 Function None 3 + 5: Label + 10: 8(bool) FOrdNotEqual 7 9 + 18: 6(float) Select 11 17 9 + 19: 6(float) ConvertSToF 13 + 20: 12(int) ConvertFToS 7 + 24: 6(float) FMul 7 7 + 27: 6(float) ConvertSToF 13 + 28: 6(float) FAdd 7 27 + 29: 6(float) FNegate 7 + 32: 8(bool) FOrdGreaterThan 7 7 + 34: 8(bool) FOrdNotEqual 7 7 + 43: 42 CompositeConstruct 39 40 + 45: 44(fvec2) CompositeConstruct 7 7 + 46: 44(fvec2) CompositeConstruct 7 7 + 47: 44(fvec2) CompositeConstruct 7 7 + 49: 48 CompositeConstruct 46 47 + Return + FunctionEnd diff --git a/Test/baseResults/vulkan.frag.out b/Test/baseResults/vulkan.frag.out index b5b9d91a..fe8b045b 100644 --- a/Test/baseResults/vulkan.frag.out +++ b/Test/baseResults/vulkan.frag.out @@ -31,7 +31,9 @@ ERROR: 0:66: 'non-opaque uniforms outside a block' : not allowed when using GLSL ERROR: 0:67: 'subroutine' : not allowed when generating SPIR-V ERROR: 0:67: 'uniform' : no qualifiers allowed for function return ERROR: 0:69: 'non-opaque uniforms outside a block' : not allowed when using GLSL for Vulkan -ERROR: 31 compilation errors. No code generated. +ERROR: 0:73: 'texture' : no matching overloaded function found +ERROR: 0:74: 'imageStore' : no matching overloaded function found +ERROR: 33 compilation errors. No code generated. diff --git a/Test/es-link1.frag b/Test/es-link1.frag new file mode 100644 index 00000000..fe4da41d --- /dev/null +++ b/Test/es-link1.frag @@ -0,0 +1,8 @@ +#version 100 + +mediump vec4 calculateColor(); + +void main() +{ + gl_FragColor = calculateColor(); +} diff --git a/Test/es-link2.frag b/Test/es-link2.frag new file mode 100644 index 00000000..e7b5a477 --- /dev/null +++ b/Test/es-link2.frag @@ -0,0 +1,8 @@ +#version 100 + +varying mediump vec4 varyingColor; + +mediump vec4 calculateColor() +{ + return varyingColor * 0.5; +} diff --git a/Test/hlsl.assoc.frag b/Test/hlsl.assoc.frag new file mode 100644 index 00000000..8ce1050c --- /dev/null +++ b/Test/hlsl.assoc.frag @@ -0,0 +1,11 @@ +float4 PixelShaderFunction( + float4 a1, + float4 a2, + float4 a3, + float4 a4, + float4 a5 + ) : COLOR0 +{ + a1 = a2 = a3 = a4 = a5; + return a1 + a2 + a3 + a4 + a5; +} diff --git a/Test/hlsl.attribute.frag b/Test/hlsl.attribute.frag new file mode 100644 index 00000000..25c72d46 --- /dev/null +++ b/Test/hlsl.attribute.frag @@ -0,0 +1,13 @@ +float4 PixelShaderFunction(float4 input) : COLOR0 +{ + [unroll]; + []; + [][][]; + [unroll(4)]; + [allow_uav_condition]; + [unroll(4)] [allow_uav_condition]; + [ loop ]; + [fastopt]; + [branch] if (0); + [flatten]; +} diff --git a/Test/hlsl.cast.frag b/Test/hlsl.cast.frag new file mode 100644 index 00000000..c8dc8212 --- /dev/null +++ b/Test/hlsl.cast.frag @@ -0,0 +1,4 @@ +float4 PixelShaderFunction(float4 input) : COLOR0 +{ + return (float4)input + (int4)input + (float4)1.198; +} diff --git a/Test/hlsl.doLoop.frag b/Test/hlsl.doLoop.frag new file mode 100644 index 00000000..546b2c2c --- /dev/null +++ b/Test/hlsl.doLoop.frag @@ -0,0 +1,6 @@ +float4 PixelShaderFunction(float4 input) : COLOR0 +{ + [unroll] do {} while (false); + [unroll] do {;} while (false); + do { return input; } while (input == input); +} diff --git a/Test/hlsl.float1.frag b/Test/hlsl.float1.frag new file mode 100644 index 00000000..5000dced --- /dev/null +++ b/Test/hlsl.float1.frag @@ -0,0 +1,7 @@ +float1 f1 = float1(1.0); +float scalar = 2.0; + +float1 ShaderFunction(float1 inFloat1, float inScalar) : COLOR0 +{ + return f1 * scalar + inFloat1 * inScalar; +} diff --git a/Test/hlsl.float4.frag b/Test/hlsl.float4.frag new file mode 100644 index 00000000..8ed4eab1 --- /dev/null +++ b/Test/hlsl.float4.frag @@ -0,0 +1,6 @@ +float4 AmbientColor = float4(1, 0.5, 0, 1); + +float4 ShaderFunction(float4 input) : COLOR0 +{ + return input * AmbientColor; +} diff --git a/Test/hlsl.forLoop.frag b/Test/hlsl.forLoop.frag new file mode 100644 index 00000000..9109de79 --- /dev/null +++ b/Test/hlsl.forLoop.frag @@ -0,0 +1,8 @@ +float4 PixelShaderFunction(float4 input) : COLOR0 +{ + for (;;) ; + for (++input; ; ) ; + [unroll] for (; input != input; ) {} + for (; input != input; ) { return -input; } + for (--input; input != input; input += 2) { return -input; } +} diff --git a/Test/hlsl.frag b/Test/hlsl.frag new file mode 100644 index 00000000..1620ed58 --- /dev/null +++ b/Test/hlsl.frag @@ -0,0 +1,12 @@ +float4 AmbientColor = float4(1, 0.5, 0, 1); +float AmbientIntensity = 0.1; + +float4 PixelShaderFunction(float4 input) : COLOR0 +{ + return input * AmbientIntensity + AmbientColor; + return input * input + input * input; + return input + input * input + input; + return ++input * -+-+--input; + return input++ + ++input; + return sin(input); +} diff --git a/Test/hlsl.if.frag b/Test/hlsl.if.frag new file mode 100644 index 00000000..1f0dde71 --- /dev/null +++ b/Test/hlsl.if.frag @@ -0,0 +1,28 @@ +float4 PixelShaderFunction(float4 input) : COLOR0 +{ + if (input == input) + return input; + + if (input == input) + return input; + else + return -input; + + if (input == input) + ; + + if (input == input) + ; + else + ; + + [flatten] if (input == input) { + return input; + } + + if (input == input) { + return input; + } else { + return -input; + } +} diff --git a/Test/hlsl.intrinsics.frag b/Test/hlsl.intrinsics.frag new file mode 100644 index 00000000..563ce225 --- /dev/null +++ b/Test/hlsl.intrinsics.frag @@ -0,0 +1,353 @@ +float PixelShaderFunction(float inF0, float inF1, float inF2) +{ + all(inF0); + abs(inF0); + acos(inF0); + any(inF0); + asin(inF0); + atan(inF0); + atan2(inF0, inF1); + ceil(inF0); + clamp(inF0, inF1, inF2); + cos(inF0); + cosh(inF0); + countbits(7); + ddx(inF0); + ddx_coarse(inF0); + ddx_fine(inF0); + ddy(inF0); + ddy_coarse(inF0); + ddy_fine(inF0); + degrees(inF0); + // EvaluateAttributeAtCentroid(inF0); + // EvaluateAttributeAtSample(inF0, 0); + // TODO: EvaluateAttributeSnapped(inF0, int2(1,2)); + exp(inF0); + exp2(inF0); + firstbithigh(7); + firstbitlow(7); + floor(inF0); + // TODO: fma(inD0, inD1, inD2); + fmod(inF0, inF1); + frac(inF0); + frexp(inF0, inF1); + fwidth(inF0); + isinf(inF0); + isnan(inF0); + ldexp(inF0, inF1); + log(inF0); + log2(inF0); + max(inF0, inF1); + min(inF0, inF1); + // TODO: mul(inF0, inF1); + pow(inF0, inF1); + radians(inF0); + reversebits(2); + round(inF0); + rsqrt(inF0); + sign(inF0); + sin(inF0); + sinh(inF0); + smoothstep(inF0, inF1, inF2); + sqrt(inF0); + step(inF0, inF1); + tan(inF0); + tanh(inF0); + // TODO: sampler intrinsics, when we can declare the types. + trunc(inF0); + + return 0.0; +} + +float1 PixelShaderFunction(float1 inF0, float1 inF1, float1 inF2) +{ + // TODO: ... add when float1 prototypes are generated + return 0.0; +} + +float2 PixelShaderFunction(float2 inF0, float2 inF1, float2 inF2) +{ + all(inF0); + abs(inF0); + acos(inF0); + any(inF0); + asin(inF0); + atan(inF0); + atan2(inF0, inF1); + ceil(inF0); + clamp(inF0, inF1, inF2); + cos(inF0); + cosh(inF0); + countbits(int2(7,3)); + ddx(inF0); + ddx_coarse(inF0); + ddx_fine(inF0); + ddy(inF0); + ddy_coarse(inF0); + ddy_fine(inF0); + degrees(inF0); + distance(inF0, inF1); + dot(inF0, inF1); + // EvaluateAttributeAtCentroid(inF0); + // EvaluateAttributeAtSample(inF0, 0); + // TODO: EvaluateAttributeSnapped(inF0, int2(1,2)); + exp(inF0); + exp2(inF0); + faceforward(inF0, inF1, inF2); + firstbithigh(7); + firstbitlow(7); + floor(inF0); + // TODO: fma(inD0, inD1, inD2); + fmod(inF0, inF1); + frac(inF0); + frexp(inF0, inF1); + fwidth(inF0); + isinf(inF0); + isnan(inF0); + ldexp(inF0, inF1); + length(inF0); + log(inF0); + log2(inF0); + max(inF0, inF1); + min(inF0, inF1); + // TODO: mul(inF0, inF1); + normalize(inF0); + pow(inF0, inF1); + radians(inF0); + reflect(inF0, inF1); + refract(inF0, inF1, 2.0); + reversebits(int2(1,2)); + round(inF0); + rsqrt(inF0); + sign(inF0); + sin(inF0); + sinh(inF0); + smoothstep(inF0, inF1, inF2); + sqrt(inF0); + step(inF0, inF1); + tan(inF0); + tanh(inF0); + // TODO: sampler intrinsics, when we can declare the types. + trunc(inF0); + + // TODO: ... add when float1 prototypes are generated + return float2(1,2); +} + +float3 PixelShaderFunction(float3 inF0, float3 inF1, float3 inF2) +{ + all(inF0); + abs(inF0); + acos(inF0); + any(inF0); + asin(inF0); + atan(inF0); + atan2(inF0, inF1); + ceil(inF0); + clamp(inF0, inF1, inF2); + cos(inF0); + cosh(inF0); + countbits(int3(7,3,5)); + cross(inF0, inF1); + ddx(inF0); + ddx_coarse(inF0); + ddx_fine(inF0); + ddy(inF0); + ddy_coarse(inF0); + ddy_fine(inF0); + degrees(inF0); + distance(inF0, inF1); + dot(inF0, inF1); + // EvaluateAttributeAtCentroid(inF0); + // EvaluateAttributeAtSample(inF0, 0); + // TODO: EvaluateAttributeSnapped(inF0, int2(1,2)); + exp(inF0); + exp2(inF0); + faceforward(inF0, inF1, inF2); + firstbithigh(7); + firstbitlow(7); + floor(inF0); + // TODO: fma(inD0, inD1, inD2); + fmod(inF0, inF1); + frac(inF0); + frexp(inF0, inF1); + fwidth(inF0); + isinf(inF0); + isnan(inF0); + ldexp(inF0, inF1); + length(inF0); + log(inF0); + log2(inF0); + max(inF0, inF1); + min(inF0, inF1); + // TODO: mul(inF0, inF1); + normalize(inF0); + pow(inF0, inF1); + radians(inF0); + reflect(inF0, inF1); + refract(inF0, inF1, 2.0); + reversebits(int3(1,2,3)); + round(inF0); + rsqrt(inF0); + sign(inF0); + sin(inF0); + sinh(inF0); + smoothstep(inF0, inF1, inF2); + sqrt(inF0); + step(inF0, inF1); + tan(inF0); + tanh(inF0); + // TODO: sampler intrinsics, when we can declare the types. + trunc(inF0); + + // TODO: ... add when float1 prototypes are generated + return float3(1,2,3); +} + +float4 PixelShaderFunction(float4 inF0, float4 inF1, float4 inF2) +{ + all(inF0); + abs(inF0); + acos(inF0); + any(inF0); + asin(inF0); + atan(inF0); + atan2(inF0, inF1); + ceil(inF0); + clamp(inF0, inF1, inF2); + cos(inF0); + cosh(inF0); + countbits(int4(7,3,5,2)); + ddx(inF0); + ddx_coarse(inF0); + ddx_fine(inF0); + ddy(inF0); + ddy_coarse(inF0); + ddy_fine(inF0); + degrees(inF0); + distance(inF0, inF1); + dot(inF0, inF1); + // EvaluateAttributeAtCentroid(inF0); + // EvaluateAttributeAtSample(inF0, 0); + // TODO: EvaluateAttributeSnapped(inF0, int2(1,2)); + exp(inF0); + exp2(inF0); + faceforward(inF0, inF1, inF2); + firstbithigh(7); + firstbitlow(7); + floor(inF0); + // TODO: fma(inD0, inD1, inD2); + fmod(inF0, inF1); + frac(inF0); + frexp(inF0, inF1); + fwidth(inF0); + isinf(inF0); + isnan(inF0); + ldexp(inF0, inF1); + length(inF0); + log(inF0); + log2(inF0); + max(inF0, inF1); + min(inF0, inF1); + // TODO: mul(inF0, inF1); + normalize(inF0); + pow(inF0, inF1); + radians(inF0); + reflect(inF0, inF1); + refract(inF0, inF1, 2.0); + reversebits(int4(1,2,3,4)); + round(inF0); + rsqrt(inF0); + sign(inF0); + sin(inF0); + sinh(inF0); + smoothstep(inF0, inF1, inF2); + sqrt(inF0); + step(inF0, inF1); + tan(inF0); + tanh(inF0); + // TODO: sampler intrinsics, when we can declare the types. + trunc(inF0); + + // TODO: ... add when float1 prototypes are generated + return float4(1,2,3,4); +} + +// TODO: FXC doesn't accept this with (), but glslang doesn't accept it without. +#define MATFNS() \ + all(inF0); \ + abs(inF0); \ + acos(inF0); \ + any(inF0); \ + asin(inF0); \ + atan(inF0); \ + atan2(inF0, inF1); \ + ceil(inF0); \ + clamp(inF0, inF1, inF2); \ + cos(inF0); \ + cosh(inF0); \ + ddx(inF0); \ + ddx_coarse(inF0); \ + ddx_fine(inF0); \ + ddy(inF0); \ + ddy_coarse(inF0); \ + ddy_fine(inF0); \ + degrees(inF0); \ + determinant(inF0); \ + exp(inF0); \ + exp2(inF0); \ + firstbithigh(7); \ + firstbitlow(7); \ + floor(inF0); \ + fmod(inF0, inF1); \ + frac(inF0); \ + frexp(inF0, inF1); \ + fwidth(inF0); \ + ldexp(inF0, inF1); \ + log(inF0); \ + log2(inF0); \ + max(inF0, inF1); \ + min(inF0, inF1); \ + pow(inF0, inF1); \ + radians(inF0); \ + round(inF0); \ + rsqrt(inF0); \ + sign(inF0); \ + sin(inF0); \ + sinh(inF0); \ + smoothstep(inF0, inF1, inF2); \ + sqrt(inF0); \ + step(inF0, inF1); \ + tan(inF0); \ + tanh(inF0); \ + transpose(inF0); \ + trunc(inF0); + +// TODO: turn on non-square matrix tests when protos are available. + +float2x2 PixelShaderFunction(float2x2 inF0, float2x2 inF1, float2x2 inF2) +{ + // TODO: FXC doesn't accept this with (), but glslang doesn't accept it without. + MATFNS() + + // TODO: ... add when float1 prototypes are generated + return float2x2(2,2,2,2); +} + +float3x3 PixelShaderFunction(float3x3 inF0, float3x3 inF1, float3x3 inF2) +{ + // TODO: FXC doesn't accept this with (), but glslang doesn't accept it without. + MATFNS() + + // TODO: ... add when float1 prototypes are generated + return float3x3(3,3,3,3,3,3,3,3,3); +} + +float4x4 PixelShaderFunction(float4x4 inF0, float4x4 inF1, float4x4 inF2) +{ + // TODO: FXC doesn't accept this with (), but glslang doesn't accept it without. + MATFNS() + + // TODO: ... add when float1 prototypes are generated + return float4x4(4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4); +} diff --git a/Test/hlsl.intrinsics.negative.frag b/Test/hlsl.intrinsics.negative.frag new file mode 100644 index 00000000..b93f104d --- /dev/null +++ b/Test/hlsl.intrinsics.negative.frag @@ -0,0 +1,137 @@ +float PixelShaderFunction(float inF0, float inF1, float inF2, int inI0) +{ + // AllMemoryBarrier(); // TODO: expected error: invalid in fragment stage + // AllMemoryBarrierWithGroupSync(); // TODO: expected error: invalid in fragment stage + asdouble(inF0, inF1); // expected error: only integer inputs + CheckAccessFullyMapped(3.0); // expected error: only valid on integers + countbits(inF0); // expected error: only integer inputs + cross(inF0, inF1); // expected error: only on float3 inputs + D3DCOLORtoUBYTE4(inF0); // expected error: only on float4 inputs + determinant(inF0); // expected error: only valid on mats + // DeviceMemoryBarrierWithGroupSync(); // TODO: expected error: only valid in compute stage + f16tof32(inF0); // expected error: only integer inputs + firstbithigh(inF0); // expected error: only integer inputs + firstbitlow(inF0); // expected error: only integer inputs + fma(inF0, inF1, inF2); // expected error: only double inputs + // InterlockedAdd(inI0, inI0, 3); // expected error: last parameter is out TODO: accepted even though marked as out in proto generator + // InterlockedAnd(inI0, inI0, 3); // expected error: last parameter is out TODO: accepted even though marked as out i // InterlockedMax(inI0, inI0, 3); // expected error: last parameter is out TODO: accepted even though marked as out in proto generator + // InterlockedMin(inI0, inI0, 3); // expected error: last parameter is out TODO: accepted even though marked as out in proto generator + // InterlockedOor(inI0, inI0, 3); // expected error: last parameter is out TODO: accepted even though marked as out in proto generator + // InterlockedXor(inI0, inI0, 3); // expected error: last parameter is out TODO: accepted even though marked as out in proto generator + // GroupMemoryBarrier(); // TODO: expected error: invalid in fragment stage + // GroupMemoryBarrierWithGroupSync(); // TODO: expected error: invalid in fragment stage + length(inF0); // expected error: invalid on scalars + msad4(inF0, float2(0), float4(0)); // expected error: only integer inputs + normalize(inF0); // expected error: invalid on scalars + reflect(inF0, inF1); // expected error: invalid on scalars + refract(inF0, inF1, inF2); // expected error: invalid on scalars + refract(float2(0), float2(0), float2(0)); // expected error: last parameter only scalar + reversebits(inF0); // expected error: only integer inputs + transpose(inF0); // expected error: only valid on mats + + return 0.0; +} + +float1 PixelShaderFunction(float1 inF0, float1 inF1, float1 inF2, int1 inI0) +{ + // TODO: ... add when float1 prototypes are generated + + GetRenderTargetSamplePosition(inF0); // expected error: only integer inputs + + return 0.0; +} + +float2 PixelShaderFunction(float2 inF0, float2 inF1, float2 inF2, int2 inI0) +{ + asdouble(inF0, inF1); // expected error: only integer inputs + CheckAccessFullyMapped(inF0); // expected error: only valid on scalars + countbits(inF0); // expected error: only integer inputs + cross(inF0, inF1); // expected error: only on float3 inputs + D3DCOLORtoUBYTE4(inF0); // expected error: only on float4 inputs + determinant(inF0); // expected error: only valid on mats + f16tof32(inF0); // expected error: only integer inputs + firstbithigh(inF0); // expected error: only integer inputs + firstbitlow(inF0); // expected error: only integer inputs + fma(inF0, inF1, inF2); // expected error: only double inputs + reversebits(inF0); // expected error: only integer inputs + transpose(inF0); // expected error: only valid on mats + + return float2(1,2); +} + +float3 PixelShaderFunction(float3 inF0, float3 inF1, float3 inF2, int3 inI0) +{ + CheckAccessFullyMapped(inF0); // expected error: only valid on scalars + countbits(inF0); // expected error: only integer inputs + D3DCOLORtoUBYTE4(inF0); // expected error: only on float4 inputs + determinant(inF0); // expected error: only valid on mats + f16tof32(inF0); // expected error: only integer inputs + firstbithigh(inF0); // expected error: only integer inputs + firstbitlow(inF0); // expected error: only integer inputs + fma(inF0, inF1, inF2); // expected error: only double inputs + reversebits(inF0); // expected error: only integer inputs + transpose(inF0); // expected error: only valid on mats + + + return float3(1,2,3); +} + +float4 PixelShaderFunction(float4 inF0, float4 inF1, float4 inF2, int4 inI0) +{ + CheckAccessFullyMapped(inF0); // expected error: only valid on scalars + countbits(inF0); // expected error: only integer inputs + cross(inF0, inF1); // expected error: only on float3 inputs + determinant(inF0); // expected error: only valid on mats + f16tof32(inF0); // expected error: only integer inputs + firstbithigh(inF0); // expected error: only integer inputs + firstbitlow(inF0); // expected error: only integer inputs + fma(inF0, inF1, inF2); // expected error: only double inputs + reversebits(inF0); // expected error: only integer inputs + transpose(inF0); // expected error: only valid on mats + + return float4(1,2,3,4); +} + +// TODO: FXC doesn't accept this with (), but glslang doesn't accept it without. +#define MATFNS() \ + countbits(inF0); \ + D3DCOLORtoUBYTE4(inF0); \ + cross(inF0, inF1); \ + f16tof32(inF0); \ + firstbithigh(inF0); \ + firstbitlow(inF0); \ + fma(inF0, inF1, inF2); \ + reversebits(inF0); \ + length(inF0); \ + noise(inF0); \ + normalize(inF0); \ + reflect(inF0, inF1); \ + refract(inF0, inF1, 1.0); \ + reversebits(inF0); \ + + +// TODO: turn on non-square matrix tests when protos are available. + +float2x2 PixelShaderFunction(float2x2 inF0, float2x2 inF1, float2x2 inF2) +{ + // TODO: FXC doesn't accept this with (), but glslang doesn't accept it without. + MATFNS() + + return float2x2(2,2,2,2); +} + +float3x3 PixelShaderFunction(float3x3 inF0, float3x3 inF1, float3x3 inF2) +{ + // TODO: FXC doesn't accept this with (), but glslang doesn't accept it without. + MATFNS() + + return float3x3(3,3,3,3,3,3,3,3,3); +} + +float4x4 PixelShaderFunction(float4x4 inF0, float4x4 inF1, float4x4 inF2) +{ + // TODO: FXC doesn't accept this with (), but glslang doesn't accept it without. + MATFNS() + + return float4x4(4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4); +} diff --git a/Test/hlsl.intrinsics.negative.vert b/Test/hlsl.intrinsics.negative.vert new file mode 100644 index 00000000..ee2a29d5 --- /dev/null +++ b/Test/hlsl.intrinsics.negative.vert @@ -0,0 +1,196 @@ +float VertexShaderFunction(float inF0, float inF1, float inF2, int inI0) +{ + // AllMemoryBarrier(); // invalid in fragment stage TODO: parser currently crashes on empty arg list + // AllMemoryBarrierWithGroupSync(); // invalid in fragment stage TODO: parser currently crashes on empty arg list + asdouble(inF0, inF1); // expected error: only integer inputs + CheckAccessFullyMapped(3.0); // expected error: only valid on integers + CheckAccessFullyMapped(3); // expected error: only valid in pixel & compute stages + clip(inF0); // expected error: only valid in pixel & compute stages + countbits(inF0); // expected error: only integer inputs + cross(inF0, inF1); // expected error: only on float3 inputs + D3DCOLORtoUBYTE4(inF0); // expected error: only on float4 inputs + // DeviceMemoryBarrier(); // TODO: expected error: only valid in pixel & compute stages + // DeviceMemoryBarrierWithGroupSync(); // TODO: expected error: only valid in compute stage + ddx(inF0); // expected error: only valid in pixel & compute stages + ddx_coarse(inF0); // expected error: only valid in pixel & compute stages + ddx_fine(inF0); // expected error: only valid in pixel & compute stages + ddy(inF0); // expected error: only valid in pixel & compute stages + ddy_coarse(inF0); // expected error: only valid in pixel & compute stages + ddy_fine(inF0); // expected error: only valid in pixel & compute stages + determinant(inF0); // expected error: only valid on mats + EvaluateAttributeAtCentroid(inF0); // expected error: only valid in pixel stage + EvaluateAttributeAtSample(inF0, 2); // expected error: only valid in pixel stage + EvaluateAttributeSnapped(inF0, int2(2)); // expected error: only valid in pixel stage + f16tof32(inF0); // expected error: only integer inputs + firstbithigh(inF0); // expected error: only integer inputs + firstbitlow(inF0); // expected error: only integer inputs + fma(inF0, inF1, inF2); // expected error: only double inputs + // InterlockedAdd(inI0, inI0, 3); // expected error: last parameter is out TODO: accepted even though marked as out in proto generator + // InterlockedAnd(inI0, inI0, 3); // expected error: last parameter is out TODO: accepted even though marked as out i // InterlockedMax(inI0, inI0, 3); // expected error: last parameter is out TODO: accepted even though marked as out in proto generator + // InterlockedMin(inI0, inI0, 3); // expected error: last parameter is out TODO: accepted even though marked as out in proto generator + // InterlockedOor(inI0, inI0, 3); // expected error: last parameter is out TODO: accepted even though marked as out in proto generator + // InterlockedXor(inI0, inI0, 3); // expected error: last parameter is out TODO: accepted even though marked as out in proto generator + // GroupMemoryBarrier(); // TODO: expected error: only valid in compute stage + // GroupMemoryBarrierWithGroupSync(); // TODO: expected error: only valid in compute stage + length(inF0); // expect error: invalid on scalars + msad4(inF0, float2(0), float4(0)); // expected error: only integer inputs + normalize(inF0); // expect error: invalid on scalars + reflect(inF0, inF1); // expect error: invalid on scalars + refract(inF0, inF1, inF2); // expect error: invalid on scalars + refract(float2(0), float2(0), float2(0)); // expected error: last parameter only scalar + reversebits(inF0); // expected error: only integer inputs + transpose(inF0); // expect error: only valid on mats + + // TODO: texture intrinsics, when we can declare samplers. + + return 0.0; +} + +float1 VertexShaderFunction(float1 inF0, float1 inF1, float1 inF2, int1 inI0) +{ + // TODO: ... add when float1 prototypes are generated + + GetRenderTargetSamplePosition(inF0); // expected error: only integer inputs + + return 0.0; +} + +float2 VertexShaderFunction(float2 inF0, float2 inF1, float2 inF2, int2 inI0) +{ + asdouble(inF0, inF1); // expected error: only integer inputs + CheckAccessFullyMapped(inF0); // expect error: only valid on scalars + countbits(inF0); // expected error: only integer inputs + cross(inF0, inF1); // expected error: only on float3 inputs + D3DCOLORtoUBYTE4(inF0); // expected error: only on float4 inputs + ddx(inF0); // only valid in pixel & compute stages + ddx_coarse(inF0); // only valid in pixel & compute stages + ddx_fine(inF0); // only valid in pixel & compute stages + ddy(inF0); // only valid in pixel & compute stages + ddy_coarse(inF0); // only valid in pixel & compute stages + ddy_fine(inF0); // only valid in pixel & compute stages + determinant(inF0); // expect error: only valid on mats + EvaluateAttributeAtCentroid(inF0); // expected error: only valid in pixel stage + EvaluateAttributeAtSample(inF0, 2); // expected error: only valid in pixel stage + EvaluateAttributeSnapped(inF0, int2(2)); // expected error: only valid in pixel stage + f16tof32(inF0); // expected error: only integer inputs + firstbithigh(inF0); // expected error: only integer inputs + firstbitlow(inF0); // expected error: only integer inputs + fma(inF0, inF1, inF2); // expected error: only double inputs + noise(inF0); // expected error: only valid in pixel stage + reversebits(inF0); // expected error: only integer inputs + transpose(inF0); // expect error: only valid on mats + + // TODO: texture intrinsics, when we can declare samplers. + + return float2(1,2); +} + +float3 VertexShaderFunction(float3 inF0, float3 inF1, float3 inF2, int3 inI0) +{ + CheckAccessFullyMapped(inF0); // expect error: only valid on scalars + countbits(inF0); // expected error: only integer inputs + ddx(inF0); // only valid in pixel & compute stages + ddx_coarse(inF0); // only valid in pixel & compute stages + ddx_fine(inF0); // only valid in pixel & compute stages + ddy(inF0); // only valid in pixel & compute stages + ddy_coarse(inF0); // only valid in pixel & compute stages + ddy_fine(inF0); // only valid in pixel & compute stages + D3DCOLORtoUBYTE4(inF0); // expected error: only on float4 inputs + determinant(inF0); // expect error: only valid on mats + EvaluateAttributeAtCentroid(inF0); // expected error: only valid in pixel stage + EvaluateAttributeAtSample(inF0, 2); // expected error: only valid in pixel stage + EvaluateAttributeSnapped(inF0, int2(2)); // expected error: only valid in pixel stage + f16tof32(inF0); // expected error: only integer inputs + firstbithigh(inF0); // expected error: only integer inputs + firstbitlow(inF0); // expected error: only integer inputs + fma(inF0, inF1, inF2); // expected error: only double inputs + noise(inF0); // expected error: only valid in pixel stage + reversebits(inF0); // expected error: only integer inputs + transpose(inF0); // expect error: only valid on mats + + // TODO: texture intrinsics, when we can declare samplers. + + return float3(1,2,3); +} + +float4 VertexShaderFunction(float4 inF0, float4 inF1, float4 inF2, int4 inI0) +{ + CheckAccessFullyMapped(inF0); // expect error: only valid on scalars + countbits(inF0); // expected error: only integer inputs + cross(inF0, inF1); // expected error: only on float3 inputs + determinant(inF0); // expect error: only valid on mats + ddx(inF0); // only valid in pixel & compute stages + ddx_coarse(inF0); // only valid in pixel & compute stages + ddx_fine(inF0); // only valid in pixel & compute stages + ddy(inF0); // only valid in pixel & compute stages + ddy_coarse(inF0); // only valid in pixel & compute stages + ddy_fine(inF0); // only valid in pixel & compute stages + EvaluateAttributeAtCentroid(inF0); // expected error: only valid in pixel stage + EvaluateAttributeAtSample(inF0, 2); // expected error: only valid in pixel stage + EvaluateAttributeSnapped(inF0, int2(2)); // expected error: only valid in pixel stage + f16tof32(inF0); // expected error: only integer inputs + firstbithigh(inF0); // expected error: only integer inputs + firstbitlow(inF0); // expected error: only integer inputs + fma(inF0, inF1, inF2); // expected error: only double inputs + noise(inF0); // expected error: only valid in pixel stage + reversebits(inF0); // expected error: only integer inputs + transpose(inF0); // expect error: only valid on mats + + // TODO: texture intrinsics, when we can declare samplers. + + return float4(1,2,3,4); +} + +// TODO: FXC doesn't accept this with (), but glslang doesn't accept it without. +#define MATFNS() \ + countbits(inF0); \ + cross(inF0, inF1); \ + D3DCOLORtoUBYTE4(inF0); \ + ddx(inF0); \ + ddx_coarse(inF0); \ + ddx_fine(inF0); \ + ddy(inF0); \ + ddy_coarse(inF0); \ + ddy_fine(inF0); \ + EvaluateAttributeAtCentroid(inF0); \ + EvaluateAttributeAtSample(inF0, 2); \ + EvaluateAttributeSnapped(inF0, int2(2)); \ + f16tof32(inF0); \ + firstbithigh(inF0); \ + firstbitlow(inF0); \ + fma(inF0, inF1, inF2); \ + noise(inF0); \ + reversebits(inF0); \ + length(inF0); \ + noise(inF0); \ + normalize(inF0); \ + reflect(inF0, inF1); \ + refract(inF0, inF1, 1.0); \ + reversebits(inF0); \ + + +// TODO: turn on non-square matrix tests when protos are available. + +float2x2 VertexShaderFunction(float2x2 inF0, float2x2 inF1, float2x2 inF2) +{ + // TODO: FXC doesn't accept this with (), but glslang doesn't accept it without. + MATFNS() + + return float2x2(2,2,2,2); +} + +float3x3 VertexShaderFunction(float3x3 inF0, float3x3 inF1, float3x3 inF2) +{ + // TODO: FXC doesn't accept this with (), but glslang doesn't accept it without. + MATFNS() + + return float3x3(3,3,3,3,3,3,3,3,3); +} + +float4x4 VertexShaderFunction(float4x4 inF0, float4x4 inF1, float4x4 inF2) +{ + // TODO: FXC doesn't accept this with (), but glslang doesn't accept it without. + MATFNS() + + return float4x4(4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4); +} diff --git a/Test/hlsl.intrinsics.vert b/Test/hlsl.intrinsics.vert new file mode 100644 index 00000000..efafb4ac --- /dev/null +++ b/Test/hlsl.intrinsics.vert @@ -0,0 +1,323 @@ +float VertexShaderFunction(float inF0, float inF1, float inF2) +{ + all(inF0); + abs(inF0); + acos(inF0); + any(inF0); + asin(inF0); + atan(inF0); + atan2(inF0, inF1); + ceil(inF0); + clamp(inF0, inF1, inF2); + cos(inF0); + cosh(inF0); + countbits(7); + degrees(inF0); + // EvaluateAttributeAtCentroid(inF0); + // EvaluateAttributeAtSample(inF0, 0); + // TODO: EvaluateAttributeSnapped(inF0, int2(1,2)); + exp(inF0); + exp2(inF0); + firstbithigh(7); + firstbitlow(7); + floor(inF0); + // TODO: fma(inD0, inD1, inD2); + fmod(inF0, inF1); + frac(inF0); + frexp(inF0, inF1); + fwidth(inF0); + isinf(inF0); + isnan(inF0); + ldexp(inF0, inF1); + log(inF0); + log2(inF0); + max(inF0, inF1); + min(inF0, inF1); + // TODO: mul(inF0, inF1); + pow(inF0, inF1); + radians(inF0); + reversebits(2); + round(inF0); + rsqrt(inF0); + sign(inF0); + sin(inF0); + sinh(inF0); + smoothstep(inF0, inF1, inF2); + sqrt(inF0); + step(inF0, inF1); + tan(inF0); + tanh(inF0); + // TODO: sampler intrinsics, when we can declare the types. + trunc(inF0); + + return 0.0; +} + +float1 VertexShaderFunction(float1 inF0, float1 inF1, float1 inF2) +{ + // TODO: ... add when float1 prototypes are generated + return 0.0; +} + +float2 VertexShaderFunction(float2 inF0, float2 inF1, float2 inF2) +{ + all(inF0); + abs(inF0); + acos(inF0); + any(inF0); + asin(inF0); + atan(inF0); + atan2(inF0, inF1); + ceil(inF0); + clamp(inF0, inF1, inF2); + cos(inF0); + cosh(inF0); + countbits(int2(7,3)); + degrees(inF0); + distance(inF0, inF1); + dot(inF0, inF1); + // EvaluateAttributeAtCentroid(inF0); + // EvaluateAttributeAtSample(inF0, 0); + // TODO: EvaluateAttributeSnapped(inF0, int2(1,2)); + exp(inF0); + exp2(inF0); + faceforward(inF0, inF1, inF2); + firstbithigh(7); + firstbitlow(7); + floor(inF0); + // TODO: fma(inD0, inD1, inD2); + fmod(inF0, inF1); + frac(inF0); + frexp(inF0, inF1); + fwidth(inF0); + isinf(inF0); + isnan(inF0); + ldexp(inF0, inF1); + length(inF0); + log(inF0); + log2(inF0); + max(inF0, inF1); + min(inF0, inF1); + // TODO: mul(inF0, inF1); + normalize(inF0); + pow(inF0, inF1); + radians(inF0); + reflect(inF0, inF1); + refract(inF0, inF1, 2.0); + reversebits(int2(1,2)); + round(inF0); + rsqrt(inF0); + sign(inF0); + sin(inF0); + sinh(inF0); + smoothstep(inF0, inF1, inF2); + sqrt(inF0); + step(inF0, inF1); + tan(inF0); + tanh(inF0); + // TODO: sampler intrinsics, when we can declare the types. + trunc(inF0); + + // TODO: ... add when float1 prototypes are generated + return float2(1,2); +} + +float3 VertexShaderFunction(float3 inF0, float3 inF1, float3 inF2) +{ + all(inF0); + abs(inF0); + acos(inF0); + any(inF0); + asin(inF0); + atan(inF0); + atan2(inF0, inF1); + ceil(inF0); + clamp(inF0, inF1, inF2); + cos(inF0); + cosh(inF0); + countbits(int3(7,3,5)); + cross(inF0, inF1); + degrees(inF0); + distance(inF0, inF1); + dot(inF0, inF1); + // EvaluateAttributeAtCentroid(inF0); + // EvaluateAttributeAtSample(inF0, 0); + // TODO: EvaluateAttributeSnapped(inF0, int2(1,2)); + exp(inF0); + exp2(inF0); + faceforward(inF0, inF1, inF2); + firstbithigh(7); + firstbitlow(7); + floor(inF0); + // TODO: fma(inD0, inD1, inD2); + fmod(inF0, inF1); + frac(inF0); + frexp(inF0, inF1); + fwidth(inF0); + isinf(inF0); + isnan(inF0); + ldexp(inF0, inF1); + length(inF0); + log(inF0); + log2(inF0); + max(inF0, inF1); + min(inF0, inF1); + // TODO: mul(inF0, inF1); + normalize(inF0); + pow(inF0, inF1); + radians(inF0); + reflect(inF0, inF1); + refract(inF0, inF1, 2.0); + reversebits(int3(1,2,3)); + round(inF0); + rsqrt(inF0); + sign(inF0); + sin(inF0); + sinh(inF0); + smoothstep(inF0, inF1, inF2); + sqrt(inF0); + step(inF0, inF1); + tan(inF0); + tanh(inF0); + // TODO: sampler intrinsics, when we can declare the types. + trunc(inF0); + + // TODO: ... add when float1 prototypes are generated + return float3(1,2,3); +} + +float4 VertexShaderFunction(float4 inF0, float4 inF1, float4 inF2) +{ + all(inF0); + abs(inF0); + acos(inF0); + any(inF0); + asin(inF0); + atan(inF0); + atan2(inF0, inF1); + ceil(inF0); + clamp(inF0, inF1, inF2); + cos(inF0); + cosh(inF0); + countbits(int4(7,3,5,2)); + degrees(inF0); + distance(inF0, inF1); + dot(inF0, inF1); + // EvaluateAttributeAtCentroid(inF0); + // EvaluateAttributeAtSample(inF0, 0); + // TODO: EvaluateAttributeSnapped(inF0, int2(1,2)); + exp(inF0); + exp2(inF0); + faceforward(inF0, inF1, inF2); + firstbithigh(7); + firstbitlow(7); + floor(inF0); + // TODO: fma(inD0, inD1, inD2); + fmod(inF0, inF1); + frac(inF0); + frexp(inF0, inF1); + fwidth(inF0); + isinf(inF0); + isnan(inF0); + ldexp(inF0, inF1); + length(inF0); + log(inF0); + log2(inF0); + max(inF0, inF1); + min(inF0, inF1); + // TODO: mul(inF0, inF1); + normalize(inF0); + pow(inF0, inF1); + radians(inF0); + reflect(inF0, inF1); + refract(inF0, inF1, 2.0); + reversebits(int4(1,2,3,4)); + round(inF0); + rsqrt(inF0); + sign(inF0); + sin(inF0); + sinh(inF0); + smoothstep(inF0, inF1, inF2); + sqrt(inF0); + step(inF0, inF1); + tan(inF0); + tanh(inF0); + // TODO: sampler intrinsics, when we can declare the types. + trunc(inF0); + + // TODO: ... add when float1 prototypes are generated + return float4(1,2,3,4); +} + +// TODO: FXC doesn't accept this with (), but glslang doesn't accept it without. +#define MATFNS() \ + all(inF0); \ + abs(inF0); \ + acos(inF0); \ + any(inF0); \ + asin(inF0); \ + atan(inF0); \ + atan2(inF0, inF1); \ + ceil(inF0); \ + clamp(inF0, inF1, inF2); \ + cos(inF0); \ + cosh(inF0); \ + degrees(inF0); \ + determinant(inF0); \ + exp(inF0); \ + exp2(inF0); \ + firstbithigh(7); \ + firstbitlow(7); \ + floor(inF0); \ + fmod(inF0, inF1); \ + frac(inF0); \ + frexp(inF0, inF1); \ + fwidth(inF0); \ + ldexp(inF0, inF1); \ + log(inF0); \ + log2(inF0); \ + max(inF0, inF1); \ + min(inF0, inF1); \ + pow(inF0, inF1); \ + radians(inF0); \ + round(inF0); \ + rsqrt(inF0); \ + sign(inF0); \ + sin(inF0); \ + sinh(inF0); \ + smoothstep(inF0, inF1, inF2); \ + sqrt(inF0); \ + step(inF0, inF1); \ + tan(inF0); \ + tanh(inF0); \ + transpose(inF0); \ + trunc(inF0); + +// TODO: turn on non-square matrix tests when protos are available. + +float2x2 VertexShaderFunction(float2x2 inF0, float2x2 inF1, float2x2 inF2) +{ + // TODO: FXC doesn't accept this with (), but glslang doesn't accept it without. + MATFNS(); + + // TODO: ... add when float1 prototypes are generated + return float2x2(2,2,2,2); +} + +float3x3 VertexShaderFunction(float3x3 inF0, float3x3 inF1, float3x3 inF2) +{ + // TODO: FXC doesn't accept this with (), but glslang doesn't accept it without. + MATFNS(); + + // TODO: ... add when float1 prototypes are generated + return float3x3(3,3,3,3,3,3,3,3,3); +} + +float4x4 VertexShaderFunction(float4x4 inF0, float4x4 inF1, float4x4 inF2) +{ + // TODO: FXC doesn't accept this with (), but glslang doesn't accept it without. + MATFNS(); + + // TODO: ... add when float1 prototypes are generated + return float4x4(4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4); +} diff --git a/Test/hlsl.matType.frag b/Test/hlsl.matType.frag new file mode 100644 index 00000000..36d71e3b --- /dev/null +++ b/Test/hlsl.matType.frag @@ -0,0 +1,10 @@ +float1 f1 = float1(1.0); +float1x1 fmat11; +float4x1 fmat41; +float1x2 fmat12; +double2x3 dmat23; +int4x4 int44; + +float1 ShaderFunction(float1 inFloat1, float inScalar) : COLOR0 +{ +} diff --git a/Test/hlsl.max.frag b/Test/hlsl.max.frag new file mode 100644 index 00000000..6d1ea0b1 --- /dev/null +++ b/Test/hlsl.max.frag @@ -0,0 +1,4 @@ +float4 PixelShaderFunction(float4 input1, float4 input2) : COLOR0 +{ + return max(input1, input2); +} diff --git a/Test/hlsl.precedence.frag b/Test/hlsl.precedence.frag new file mode 100644 index 00000000..eae0435e --- /dev/null +++ b/Test/hlsl.precedence.frag @@ -0,0 +1,9 @@ +float4 PixelShaderFunction( + float4 a1, + float4 a2, + float4 a3, + float4 a4 + ) : COLOR0 +{ + return a1 + a2 * a3 + a4; +} diff --git a/Test/hlsl.precedence2.frag b/Test/hlsl.precedence2.frag new file mode 100644 index 00000000..0d3f583a --- /dev/null +++ b/Test/hlsl.precedence2.frag @@ -0,0 +1,9 @@ +int PixelShaderFunction( + int a1, + int a2, + int a3, + int a4 + ) : COLOR0 +{ + return (a1 * a2 + a3 << a4) + (a1 << a2 + a3 * a4); +} diff --git a/Test/hlsl.sin.frag b/Test/hlsl.sin.frag new file mode 100644 index 00000000..edf087de --- /dev/null +++ b/Test/hlsl.sin.frag @@ -0,0 +1,4 @@ +float4 PixelShaderFunction(float4 input) : COLOR0 +{ + return sin(input); +} diff --git a/Test/hlsl.whileLoop.frag b/Test/hlsl.whileLoop.frag new file mode 100644 index 00000000..f282375d --- /dev/null +++ b/Test/hlsl.whileLoop.frag @@ -0,0 +1,7 @@ +float4 PixelShaderFunction(float4 input) : COLOR0 +{ + while (input != input) { return input; } + while (false) ; + [unroll] while (false) { } + while ((false)) { } +} diff --git a/Test/negativeArraySize.comp b/Test/negativeArraySize.comp new file mode 100644 index 00000000..20636c0a --- /dev/null +++ b/Test/negativeArraySize.comp @@ -0,0 +1,10 @@ +#version 310 es + +#ifdef GL_ES +precision mediump float; +#endif + +void main() +{ + float f[-2]; // cannot declare arrays with negative size +} diff --git a/Test/nonVulkan.frag b/Test/nonVulkan.frag index c8cf4674..425e8402 100644 --- a/Test/nonVulkan.frag +++ b/Test/nonVulkan.frag @@ -2,4 +2,8 @@ layout(constant_id = 17) const int arraySize = 12; // ERROR layout(input_attachment_index = 1) int foo; // ERROR -layout(push_constant) uniform ubn { int a; } ubi; // ERROR \ No newline at end of file +layout(push_constant) uniform ubn { int a; } ubi; // ERROR + +#ifdef VULKAN +#error VULKAN should not be defined +#endif diff --git a/Test/precise.tesc b/Test/precise.tesc new file mode 100644 index 00000000..c541540c --- /dev/null +++ b/Test/precise.tesc @@ -0,0 +1,109 @@ +#version 450 +#extension GL_EXT_tessellation_shader : require +#extension GL_EXT_gpu_shader5 : require + +float minimal() { + precise float result = 5.0; + float a = 10.0; + float b = 20.0; + float c = 30.0; + float d = 40.0; + result = a * b + c * d; // c * d, a * b and rvalue1 + rvalue2 should be 'noContraction'. + return result; +} + +void continuous_assignment() { + precise float result = 5.0; + float a = 10.0; + float b = 20.0; + result = a = b + 4; // b + 4 should be 'noContraction'. +} + +void convert() { + precise double result; + float a = 10.0; + float b = 20.0; + b = a + b; // a + b should be 'noContraction'. + result = double(b); // convert operation should not be 'noContraction'. +} + +float loop_for() { + precise float r1 = 5.0; + precise float r2 = 10.0; + int a = 10; + int b = 20; + int c = 30; + for (int i = 0; i < a; i++) { + r1 += 3.12 + b + i; // 'noContration', this make i++ also 'noContraction' + c += 1; // 'noContration' + } + a += 1; // a + 1 should not be 'noContraction'. + r2 = c; // The calculation of c should be 'noContration'. + return float(r1 + r2); // conversion should not be 'noContration'. +} + +void loop_array(void) { + precise float result; + + int x = 22; + int y = 33; + + float a0[3]; + result += float(x) + float(y); // x + y should be 'noContraction' also result + rvalue. + + for (int i = 0; i < 3; ++i) { + // a's dereference + 2 should be 'noContraction'. + result += a0[i] + 2; + // result + 1 and 3 - rvalue should be 'noContraction'. + a0[i] = 3 - result++; + } +} + +void loop_while() { + precise float result = 5.0; + int a = 10; + int b = 20; + while (result < 10) { + result += 3.12 + b; // result + 3.12 should be 'noContraction'. + } + result = a + b + 5; // b + 5 should not be 'noCtraction' because all operands are integers. + result = 11.1; +} + +float fma_not_decorated() { + precise float result; + float a = 1.0; + float b = 2.0; + float c = 3.0; + b = b + c; // b + c should be decorated with 'noContraction' + result = fma(a, b, c); // fma() should not be decorated with 'noContradtion' + return result; +} + +precise float precise_return_exp_func() { + float a = 1.0; + float b = 2.0; + return a + b; // the ADD operation should be 'noContraction' +} + +precise float precise_return_val_func() { + float a = 1.0; + float b = 2.0; + float result = a + b; // the ADD operation should be 'noContraction' + return result; +} + +float precise_func_parameter(float b, precise out float c) { + float a = 0.5; + c = a + b; // noContration + return a - b; // Not noContraction +} + +mat3 matrix (mat2x3 a, mat3x2 b) { + mat2x3 c = mat2x3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0); + precise mat3 result; + result = (a + c) * b; // should be noContraction + return result; +} + +void main(){} diff --git a/Test/precise_struct_block.vert b/Test/precise_struct_block.vert new file mode 100644 index 00000000..279b4b09 --- /dev/null +++ b/Test/precise_struct_block.vert @@ -0,0 +1,89 @@ +#version 450 + +struct T { + float f1; + float f2; +}; + +out B1 {precise T s; float x;} partial_precise_block; +precise out B2 {T s; float x;} all_precise_block; + +float struct_member() { + float a = 1.0; + float b = 2.0; + float c = 3.0; + float d = 4.0; + + precise float result; + + T S, S2, S3; + + S2.f1 = a + 0.2; // NoContraction + S2.f2 = b + 0.2; // NOT NoContraction + S3.f1 = a + b; // NOT NoContraction + S = S2; // "precise" propagated through parent object nodes + result = S.f1 + 0.1; // the ADD operation should be NoContraction + + return result; +} + +float complex_array_struct() { + precise float result; + struct T1 { + float t1_array[3]; + float t1_scalar; + }; + struct T2 { + T1 t1a[5]; + T1 t1b[6]; + T1 t1c[7]; + }; + struct T3 {float f; T2 t2; vec4 v; int p;}; + T3 t3[10]; + for(int i=0; i<10; i++) { + t3[i].f = i / 3.0; // Not NoContraction + t3[i].v = vec4(i * 1.5); // NoContraction + t3[i].p = i + 1; + for(int j=0; j<5; j++) { + for(int k = 0; k<3; k++) { + t3[i].t2.t1a[j].t1_array[k] = i * j + k; // Not NoContraction + } + t3[i].t2.t1a[j].t1_scalar = j * 2.0 / i; // Not NoContration + } + + for(int j=0; j<6; j++) { + for(int k = 0; k<3; k++) { + t3[i].t2.t1b[j].t1_array[k] = i * j + k; // Not NoContraction + } + t3[i].t2.t1b[j].t1_scalar = j * 2.0 / i; // NoContraction + } + + for(int j=0; j<6; j++) { + for(int k = 0; k<3; k++) { + t3[i].t2.t1c[j].t1_array[k] = i * j + k; // Not NoContraction because all operands are integers + } + t3[i].t2.t1c[j].t1_scalar = j * 2.0 / i; // Not NoContraction + } + } + int i = 2; + result = t3[5].t2.t1c[6].t1_array[1] + + t3[2].t2.t1b[1].t1_scalar + + t3[i - 1].v.xy.x; // NoContraction + return result; +} + +float out_block() { + float a = 0.1; + float b = 0.2; + partial_precise_block.s.f1 = a + b; // NoContraction + partial_precise_block.s.f2 = a - b; // NoContraction + partial_precise_block.x = a * b; // Not NoContraction + + all_precise_block.s.f1 = a + b + 1.0; // NoContraction + all_precise_block.s.f2 = a - b - 1.0; // NoContraction + all_precise_block.x = a * b * 2.0; // Also NoContraction + + return a + b; // Not NoContraction +} + +void main(){} diff --git a/Test/preprocessor.eof_missing.vert b/Test/preprocessor.eof_missing.vert new file mode 100644 index 00000000..91773148 --- /dev/null +++ b/Test/preprocessor.eof_missing.vert @@ -0,0 +1 @@ +noEOF \ No newline at end of file diff --git a/Test/reflection.vert b/Test/reflection.vert index 101f5ffc..be498225 100644 --- a/Test/reflection.vert +++ b/Test/reflection.vert @@ -94,6 +94,12 @@ struct deep3 { ivec3 v3; }; +in float attributeFloat; +layout(location = 2) in vec2 attributeFloat2; +in vec3 attributeFloat3; +in vec4 attributeFloat4; +in mat4 attributeMat4; + uniform deep3 deepA[2], deepB[2], deepC[3], deepD[2]; const bool control = true; @@ -167,4 +173,10 @@ void main() f += arrBl[2].foo + arrBl[0].foo; f += arrBl2[i].foo; + + f += attributeFloat; + f += attributeFloat2.x; + f += attributeFloat3.x; + f += attributeFloat4.x; + f += attributeMat4[0][1]; } diff --git a/Test/runtests b/Test/runtests index c324911c..d54fb580 100755 --- a/Test/runtests +++ b/Test/runtests @@ -14,7 +14,7 @@ $EXE -c > $TARGETDIR/test.conf diff -b $BASEDIR/test.conf $TARGETDIR/test.conf || HASERROR=1 $EXE -i -l $TARGETDIR/test.conf specExamples.vert > $TARGETDIR/specExamples.vert.out diff -b $BASEDIR/specExamples.vert.out $TARGETDIR || HASERROR=1 -$EXE 100Limits.vert 100.conf > $TARGETDIR/100LimitsConf.vert.out +$EXE -l 100Limits.vert 100.conf > $TARGETDIR/100LimitsConf.vert.out diff -b $BASEDIR/100LimitsConf.vert.out $TARGETDIR/100LimitsConf.vert.out || HASERROR=1 # @@ -55,6 +55,24 @@ while read t; do done < test-spirv-list rm -f comp.spv frag.spv geom.spv tesc.spv tese.spv vert.spv +# +# HLSL -> SPIR-V code generation tests +# +while read t; do + case $t in + \#*) + # Skip comment lines in the test list file. + ;; + *) + echo Running HLSL-to-SPIR-V $t... + b=`basename $t` + $EXE -D -e PixelShaderFunction -H -i $t > $TARGETDIR/$b.out + diff -b $BASEDIR/$b.out $TARGETDIR/$b.out || HASERROR=1 + ;; + esac +done < test-hlsl-spirv-list +rm -f comp.spv frag.spv geom.spv tesc.spv tese.spv vert.spv + # # Preprocessor tests # @@ -78,6 +96,7 @@ function runBulkTest { runBulkTest mains1.frag mains2.frag noMain1.geom noMain2.geom runBulkTest noMain.vert mains.frag runBulkTest link1.frag link2.frag link3.frag +runBulkTest es-link1.frag es-link2.frag runBulkTest recurse1.vert recurse1.frag recurse2.frag runBulkTest 300link.frag runBulkTest 300link2.frag diff --git a/Test/spv.int64.frag b/Test/spv.int64.frag new file mode 100644 index 00000000..527bfeff --- /dev/null +++ b/Test/spv.int64.frag @@ -0,0 +1,228 @@ +#version 450 + +#extension GL_ARB_gpu_shader_int64: enable + +layout(binding = 0) uniform Uniforms +{ + uint index; +}; + +layout(std140, binding = 1) uniform Block +{ + i64vec3 i64v; + uint64_t u64; +} block; + +void main() +{ +} + +void literal() +{ + const int64_t i64Const[3] = + { + -0x1111111111111111l, // Hex + -1l, // Dec + 040000000000l, // Oct + }; + + int64_t i64 = i64Const[index]; + + const uint64_t u64Const[] = + { + 0xFFFFFFFFFFFFFFFFul, // Hex + 4294967296UL, // Dec + 077777777777ul, // Oct + }; + + uint64_t u64 = u64Const[index]; +} + +void typeCast() +{ + bvec2 bv; + ivec2 iv; + uvec2 uv; + vec2 fv; + dvec2 dv; + + i64vec2 i64v; + u64vec2 u64v; + + i64v = i64vec2(bv); // bool -> int64 + u64v = u64vec2(bv); // bool -> uint64 + + i64v = iv; // int -> int64 + iv = ivec2(i64v); // int64 -> int + + u64v = uv; // uint -> uint64 + uv = uvec2(u64v); // uint64 -> uint + + fv = vec2(i64v); // int64 -> float + dv = i64v; // int64 -> double + + fv = vec2(u64v); // uint64 -> float + dv = u64v; // uint64 -> double + + i64v = i64vec2(fv); // float -> int64 + i64v = i64vec2(dv); // double -> int64 + + u64v = u64vec2(fv); // float -> uint64 + u64v = u64vec2(dv); // double -> uint64 + + bv = bvec2(i64v); // int64 -> bool + bv = bvec2(u64v); // uint64 -> bool + + u64v = i64v; // int64 -> uint64 + i64v = i64vec2(u64v); // uint64 -> int64 + + uv = uvec2(i64v); // int64 -> uint + i64v = i64vec2(uv); // uint -> int64 + iv = ivec2(u64v); // uint64 -> int + u64v = iv; // int -> uint64 +} + +void operators() +{ + u64vec3 u64v; + int64_t i64; + uvec3 uv; + int i; + bool b; + + // Unary + u64v++; + i64--; + ++i64; + --u64v; + + u64v = ~u64v; + + i64 = +i64; + u64v = -u64v; + + // Arithmetic + i64 += i64; + u64v -= u64v; + i64 *= i; + u64v /= uv; + u64v %= i; + + u64v = u64v + uv; + i64 = i64 - i; + u64v = u64v * uv; + i64 = i64 * i; + i64 = i64 % i; + + // Shift + u64v <<= i; + i64 >>= uv.y; + + i64 = i64 << u64v.z; + u64v = u64v << i64; + + // Relational + b = (u64v.x != i64); + b = (i64 == u64v.x); + b = (u64v.x > uv.y); + b = (i64 < i); + b = (u64v.y >= uv.x); + b = (i64 <= i); + + // Bitwise + u64v |= i; + i64 = i64 | i; + i64 &= i; + u64v = u64v & uv; + u64v ^= i64; + u64v = u64v ^ i64; +} + +void builtinFuncs() +{ + i64vec2 i64v; + u64vec3 u64v; + dvec3 dv; + bvec3 bv; + + int64_t i64; + uint64_t u64; + + // abs() + i64v = abs(i64v); + + // sign() + i64 = sign(i64); + + // min() + i64v = min(i64v, i64); + i64v = min(i64v, i64vec2(-1)); + u64v = min(u64v, u64); + u64v = min(u64v, u64vec3(0)); + + // max() + i64v = max(i64v, i64); + i64v = max(i64v, i64vec2(-1)); + u64v = max(u64v, u64); + u64v = max(u64v, u64vec3(0)); + + // clamp() + i64v = clamp(i64v, -i64, i64); + i64v = clamp(i64v, -i64v, i64v); + u64v = clamp(u64v, -u64, u64); + u64v = clamp(u64v, -u64v, u64v); + + // mix() + i64 = mix(i64v.x, i64v.y, true); + i64v = mix(i64vec2(i64), i64vec2(-i64), bvec2(false)); + u64 = mix(u64v.x, u64v.y, true); + u64v = mix(u64vec3(u64), u64vec3(-u64), bvec3(false)); + + // doubleBitsToInt64() + i64v = doubleBitsToInt64(dv.xy); + + // doubleBitsToUint64() + u64v.x = doubleBitsToUint64(dv.z); + + // int64BitsToDouble() + dv.xy = int64BitsToDouble(i64v); + + // uint64BitsToDouble() + dv = uint64BitsToDouble(u64v); + + // packInt2x32() + i64 = packInt2x32(ivec2(1, 2)); + + // unpackInt2x32() + ivec2 iv = unpackInt2x32(i64); + + // packUint2x32() + u64 = packUint2x32(uvec2(2, 3)); + + // unpackUint2x32() + uvec2 uv = unpackUint2x32(u64); + + // lessThan() + bv = lessThan(u64v, u64vec3(u64)); + bv.xy = lessThan(i64v, i64vec2(i64)); + + // lessThanEqual() + bv = lessThanEqual(u64v, u64vec3(u64)); + bv.xy = lessThanEqual(i64v, i64vec2(i64)); + + // greaterThan() + bv = greaterThan(u64v, u64vec3(u64)); + bv.xy = greaterThan(i64v, i64vec2(i64)); + + // greaterThanEqual() + bv = greaterThanEqual(u64v, u64vec3(u64)); + bv.xy = greaterThanEqual(i64v, i64vec2(i64)); + + // equal() + bv = equal(u64v, u64vec3(u64)); + bv.xy = equal(i64v, i64vec2(i64)); + + // notEqual() + bv = notEqual(u64v, u64vec3(u64)); + bv.xy = notEqual(i64v, i64vec2(i64)); +} \ No newline at end of file diff --git a/Test/spv.matrix.frag b/Test/spv.matrix.frag index c62e9669..10a52566 100644 --- a/Test/spv.matrix.frag +++ b/Test/spv.matrix.frag @@ -1,4 +1,4 @@ -#version 140 +#version 420 in mat3x4 m1; in mat3x4 m2; @@ -11,6 +11,7 @@ out vec4 color; void main() { mat3x4 sum34; + dmat3x4 dm; vec3 sum3; vec4 sum4; @@ -22,6 +23,8 @@ void main() sum34 += f / m1; sum34 += f; sum34 -= f; + dm = dmat3x4(sum34); + sum34 = mat3x4(dm); sum3 = v4 * m2; sum4 = m2 * v3; @@ -33,10 +36,8 @@ void main() color = sum4; -//spv if (m1 != sum34) - ++sum34; -// else - --sum34; + ++sum34; + --sum34; sum34 += mat3x4(f); sum34 += mat3x4(v3, f, v3, f, v3, f); diff --git a/Test/spv.precise.tesc b/Test/spv.precise.tesc new file mode 100644 index 00000000..35de26b8 --- /dev/null +++ b/Test/spv.precise.tesc @@ -0,0 +1,24 @@ +#version 310 es +#extension GL_EXT_tessellation_shader : require +#extension GL_EXT_gpu_shader5 : require + +layout(vertices = 3) out; + +layout(location = 0) in highp vec2 in_tc_position[]; +layout(location = 1) in highp float in_tc_tessParam[]; + +layout(location = 0) out highp vec2 in_te_position[]; + +precise gl_TessLevelOuter; + +void main (void) +{ + in_te_position[gl_InvocationID] = in_tc_position[gl_InvocationID]; + + gl_TessLevelInner[0] = 5.0; + gl_TessLevelInner[1] = 5.0; + + gl_TessLevelOuter[0] = 1.0 + 59.0 * 0.5 * (in_tc_tessParam[1] + in_tc_tessParam[2]); + gl_TessLevelOuter[1] = 1.0 + 59.0 * 0.5 * (in_tc_tessParam[2] + in_tc_tessParam[0]); + gl_TessLevelOuter[2] = 1.0 + 59.0 * 0.5 * (in_tc_tessParam[0] + in_tc_tessParam[1]); +} diff --git a/Test/spv.precise.tese b/Test/spv.precise.tese new file mode 100644 index 00000000..874ea840 --- /dev/null +++ b/Test/spv.precise.tese @@ -0,0 +1,36 @@ +#version 310 es +#extension GL_EXT_tessellation_shader : require +#extension GL_EXT_gpu_shader5 : require + +layout(triangles, equal_spacing) in; + +layout(location = 0) in highp vec2 in_te_position[]; + +layout(location = 0) out mediump vec4 in_f_color; + +precise gl_Position; + +void main(void) { + highp vec2 pos = gl_TessCoord.x * in_te_position[0] + + gl_TessCoord.y * in_te_position[1] + + gl_TessCoord.z * in_te_position[2]; + + highp float f = + sqrt(3.0 * min(gl_TessCoord.x, min(gl_TessCoord.y, gl_TessCoord.z))) * + 0.5 + + 0.5; + in_f_color = vec4(gl_TessCoord * f, 1.0); + + // Offset the position slightly, based on the parity of the bits in the float + // representation. + // This is done to detect possible small differences in edge vertex positions + // between patches. + uvec2 bits = floatBitsToUint(pos); + uint numBits = 0u; + for (uint i = 0u; i < 32u; i++) + numBits += + ((bits[0] << i) & 1u) + ((bits[1] << i) & 1u); + pos += float(numBits & 1u) * 0.04; + + gl_Position = vec4(pos, 0.0, 1.0); +} diff --git a/Test/spv.shaderBallot.comp b/Test/spv.shaderBallot.comp new file mode 100644 index 00000000..20059b1c --- /dev/null +++ b/Test/spv.shaderBallot.comp @@ -0,0 +1,59 @@ +#version 450 + +#extension GL_ARB_gpu_shader_int64: enable +#extension GL_ARB_shader_ballot: enable + +layout (local_size_x = 8, local_size_y = 8, local_size_z = 1) in; + +layout(binding = 0) buffer Buffers +{ + vec4 f4; + ivec4 i4; + uvec4 u4; +} data[4]; + +void main() +{ + uint invocation = (gl_SubGroupInvocationARB + gl_SubGroupSizeARB) % 4; + + uint64_t relMask = gl_SubGroupEqMaskARB + + gl_SubGroupGeMaskARB + + gl_SubGroupGtMaskARB + + gl_SubGroupLeMaskARB + + gl_SubGroupLtMaskARB; + + if (relMask == ballotARB(true)) + { + data[invocation].f4.x = readInvocationARB(data[0].f4.x, invocation); + data[invocation].f4.xy = readInvocationARB(data[1].f4.xy, invocation); + data[invocation].f4.xyz = readInvocationARB(data[2].f4.xyz, invocation); + data[invocation].f4 = readInvocationARB(data[3].f4, invocation); + + data[invocation].i4.x = readInvocationARB(data[0].i4.x, invocation); + data[invocation].i4.xy = readInvocationARB(data[1].i4.xy, invocation); + data[invocation].i4.xyz = readInvocationARB(data[2].i4.xyz, invocation); + data[invocation].i4 = readInvocationARB(data[3].i4, invocation); + + data[invocation].u4.x = readInvocationARB(data[0].u4.x, invocation); + data[invocation].u4.xy = readInvocationARB(data[1].u4.xy, invocation); + data[invocation].u4.xyz = readInvocationARB(data[2].u4.xyz, invocation); + data[invocation].u4 = readInvocationARB(data[3].u4, invocation); + } + else + { + data[invocation].f4.x = readFirstInvocationARB(data[0].f4.x); + data[invocation].f4.xy = readFirstInvocationARB(data[1].f4.xy); + data[invocation].f4.xyz = readFirstInvocationARB(data[2].f4.xyz); + data[invocation].f4 = readFirstInvocationARB(data[3].f4); + + data[invocation].i4.x = readFirstInvocationARB(data[0].i4.x); + data[invocation].i4.xy = readFirstInvocationARB(data[1].i4.xy); + data[invocation].i4.xyz = readFirstInvocationARB(data[2].i4.xyz); + data[invocation].i4 = readFirstInvocationARB(data[3].i4); + + data[invocation].u4.x = readFirstInvocationARB(data[0].u4.x); + data[invocation].u4.xy = readFirstInvocationARB(data[1].u4.xy); + data[invocation].u4.xyz = readFirstInvocationARB(data[2].u4.xyz); + data[invocation].u4 = readFirstInvocationARB(data[3].u4); + } +} \ No newline at end of file diff --git a/Test/spv.shaderGroupVote.comp b/Test/spv.shaderGroupVote.comp new file mode 100644 index 00000000..c0b1fe72 --- /dev/null +++ b/Test/spv.shaderGroupVote.comp @@ -0,0 +1,21 @@ +#version 450 + +#extension GL_ARB_shader_group_vote : enable + +layout(local_size_x = 4, local_size_y = 4) in; + +layout(std430, binding = 0) buffer Buffers +{ + bool b; +}; + +void main() +{ + bool b1 = b; + + b1 = anyInvocationARB(b1); + b1 = allInvocationsARB(b1); + b1 = allInvocationsEqualARB(b1); + + b = b1; +} diff --git a/Test/spv.specConstant.vert b/Test/spv.specConstant.vert index 0f9764d4..9813bf5f 100644 --- a/Test/spv.specConstant.vert +++ b/Test/spv.specConstant.vert @@ -8,6 +8,8 @@ layout(constant_id = 18) const float spFloat = 3.14; layout(constant_id = 19) const double spDouble = 3.1415926535897932384626433832795; layout(constant_id = 22) const uint scale = 2; +layout(constant_id = 24) gl_MaxImageUnits; + out vec4 color; out int size; @@ -41,3 +43,9 @@ void foo(vec4 p[arraySize]) color *= dupScale; color += float(spDupDouble / spDupFloat); } + +int builtin_spec_constant() +{ + int result = gl_MaxImageUnits; + return result; +} diff --git a/Test/spv.specConstantComposite.vert b/Test/spv.specConstantComposite.vert index 4450ddd6..d9d07a3e 100644 --- a/Test/spv.specConstantComposite.vert +++ b/Test/spv.specConstantComposite.vert @@ -7,7 +7,7 @@ layout(constant_id = 202) const double spec_double = 3.1415926535897932384626433832795; layout(constant_id = 203) const bool spec_bool = true; -const float cast_spec_float = float(spec_float); +// const float cast_spec_float = float(spec_float); // Flat struct struct flat_struct { @@ -26,35 +26,40 @@ struct nesting_struct { // Expect OpSpecConstantComposite // Flat struct initializer -const flat_struct spec_flat_struct_all_spec = {spec_int, spec_float, - spec_double, spec_bool}; -const flat_struct spec_flat_struct_partial_spec = {30, 30.14, spec_double, - spec_bool}; +//const flat_struct spec_flat_struct_all_spec = {spec_int, spec_float, +// spec_double, spec_bool}; +//const flat_struct spec_flat_struct_partial_spec = {30, 30.14, spec_double, +// spec_bool}; // Nesting struct initializer -const nesting_struct nesting_struct_ctor = { - {spec_int, spec_float, spec_double, false}, - vec4(0.1, 0.1, 0.1, 0.1), - spec_int}; +//const nesting_struct nesting_struct_ctor = { +// {spec_int, spec_float, spec_double, false}, +// vec4(0.1, 0.1, 0.1, 0.1), +// spec_int}; // Vector constructor -const vec4 spec_vec4_all_spec = - vec4(spec_float, spec_float, spec_float, spec_float); -const vec4 spec_vec4_partial_spec = - vec4(spec_float, spec_float, 300.14, 300.14); +//const vec4 spec_vec4_all_spec = +// vec4(spec_float, spec_float, spec_float, spec_float); +//const vec4 spec_vec4_partial_spec = +// vec4(spec_float, spec_float, 300.14, 300.14); +//const vec4 spec_vec4_from_one_scalar = vec4(spec_float); + +// Matrix constructor +//const mat2x3 spec_mat2x3 = mat2x3(spec_float, spec_float, spec_float, 1.1, 2.2, 3.3); +//const mat2x3 spec_mat2x3_from_one_scalar = mat2x3(spec_float); // Struct nesting constructor -const nesting_struct spec_nesting_struct_all_spec = { - spec_flat_struct_all_spec, spec_vec4_all_spec, spec_int}; -const nesting_struct spec_nesting_struct_partial_spec = { - spec_flat_struct_partial_spec, spec_vec4_partial_spec, 3000}; +//const nesting_struct spec_nesting_struct_all_spec = { +// spec_flat_struct_all_spec, spec_vec4_all_spec, spec_int}; +//const nesting_struct spec_nesting_struct_partial_spec = { +// spec_flat_struct_partial_spec, spec_vec4_partial_spec, 3000}; -const float spec_float_array[5] = {spec_float, spec_float, 1.0, 2.0, 3.0}; -const int spec_int_array[5] = {spec_int, spec_int, 1, 2, 30}; +//const float spec_float_array[5] = {spec_float, spec_float, 1.0, 2.0, 3.0}; +//const int spec_int_array[5] = {spec_int, spec_int, 1, 2, 30}; // global_vec4_array_with_spec_length is not a spec constant, but its array // size is. When calling global_vec4_array_with_spec_length.length(), A -// TIntermSymbol Node shoule be returned, instead of a TIntermConstantUnion +// TIntermSymbol Node should be returned, instead of a TIntermConstantUnion // node which represents a known constant value. in vec4 global_vec4_array_with_spec_length[spec_int]; @@ -65,18 +70,18 @@ void refer_primary_spec_const() { } void refer_composite_spec_const() { - color += spec_vec4_all_spec; - color -= spec_vec4_partial_spec; + //color += spec_vec4_all_spec; + //color -= spec_vec4_partial_spec; } void refer_copmosite_dot_dereference() { - color *= spec_nesting_struct_all_spec.i; - color += spec_vec4_all_spec.x; + //color *= spec_nesting_struct_all_spec.i; + //color += spec_vec4_all_spec.x; } void refer_composite_bracket_dereference() { - color -= spec_float_array[1]; - color /= spec_int_array[spec_int_array[spec_int]]; + //color -= spec_float_array[1]; + //color /= spec_int_array[spec_int_array[spec_int]]; } int refer_spec_const_array_length() { @@ -85,9 +90,9 @@ int refer_spec_const_array_length() { } void declare_spec_const_in_func() { - const nesting_struct spec_const_declared_in_func = { - spec_flat_struct_partial_spec, spec_vec4_partial_spec, 10}; - color /= spec_const_declared_in_func.i; + //const nesting_struct spec_const_declared_in_func = { + // spec_flat_struct_partial_spec, spec_vec4_partial_spec, 10}; + //color /= spec_const_declared_in_func.i; } void main() {} diff --git a/Test/spv.specConstantOperations.vert b/Test/spv.specConstantOperations.vert new file mode 100644 index 00000000..b5e46ad4 --- /dev/null +++ b/Test/spv.specConstantOperations.vert @@ -0,0 +1,110 @@ +#version 450 + +layout(constant_id = 200) const float sp_float = 3.1415926; +layout(constant_id = 201) const int sp_int = 10; +layout(constant_id = 202) const uint sp_uint = 100; +layout(constant_id = 203) const int sp_sint = -10; + + +// +// Scalars +// + +// uint/int <-> bool conversion +const bool bool_from_int = bool(sp_int); +const bool bool_from_uint = bool(sp_uint); +const int int_from_bool = int(bool_from_int); +const uint uint_from_bool = uint(bool_from_int); + +// uint <-> int +const uint sp_uint_from_sint = uint(sp_sint); +const int sp_sint_from_uint = int(sp_uint); + +// Negate and Not +const int negate_int = -sp_int; +const int not_int = ~sp_int; + +// Add and Subtract +const int sp_int_add_two = sp_int + 2; +const int sp_int_add_two_sub_three = sp_int + 2 - 3; +const int sp_int_add_two_sub_four = sp_int_add_two - 4; + +// Mul, Div and Rem +const int sp_sint_mul_two = sp_sint * 2; +const uint sp_uint_mul_two = sp_uint * 2; +const int sp_sint_mul_two_div_five = sp_sint_mul_two / 5; +const uint sp_uint_mul_two_div_five = sp_uint_mul_two / 5; +const int sp_sint_rem_four = sp_sint % 4; +const uint sp_uint_rem_four = sp_uint % 4; +const int sp_sint_mul_three_div_five = sp_sint * 3 / 5; + +// Shift +const int sp_sint_shift_right_arithmetic = sp_sint >> 10; +const uint sp_uint_shift_right_arithmetic = sp_uint >> 20; +const int sp_sint_shift_left = sp_sint << 1; +const uint sp_uint_shift_left = sp_uint << 2; + +// Bitwise And, Or, Xor +const int sp_sint_or_256 = sp_sint | 0x100; +const uint sp_uint_xor_512 = sp_uint ^ 0x200; + +/* // Scalar comparison */ +const bool sp_int_lt_sp_sint = sp_int < sp_sint; +const bool sp_uint_equal_sp_uint = sp_uint == sp_uint; +const bool sp_int_gt_sp_sint = sp_int > sp_sint; + +// +// Vectors +// +const ivec4 iv = ivec4(20, 30, sp_int, sp_int); +const uvec4 uv = uvec4(sp_uint, sp_uint, -1, -2); +//const vec4 fv = vec4(sp_float, 1.25, sp_float, 1.25); + +// uint/int <-> bool conversion +const bvec4 bv_from_iv = bvec4(iv); +const bvec4 bv_from_uv = bvec4(uv); +const ivec4 iv_from_bv = ivec4(bv_from_iv); +const uvec4 uv_from_bv = uvec4(bv_from_iv); + +// uint <-> int +const uvec4 uv_from_iv = uvec4(iv); +const ivec4 iv_from_uv = ivec4(uv); + +// Negate and Not +const ivec4 not_iv = ~iv; +const ivec4 negate_iv = -iv; + +// Add and Subtract +const ivec4 iv_add_two = iv + 2; +const ivec4 iv_add_two_sub_three = iv + 2 - 3; +const ivec4 iv_add_two_sub_four = iv_add_two_sub_three - 4; + +// Mul, Div and Rem +const ivec4 iv_mul_two = iv * 2; +const ivec4 iv_mul_two_div_five = iv_mul_two / 5; +const ivec4 iv_rem_four = iv % 4; + +// Shift +const ivec4 iv_shift_right_arithmetic = iv >> 10; +const ivec4 iv_shift_left = iv << 2; + +// Bitwise And, Or, Xor +const ivec4 iv_or_1024 = iv | 0x400; +const uvec4 uv_xor_2048 = uv ^ 0x800; + +// Swizzles +const int iv_x = iv.x; +const ivec2 iv_yx = iv.yx; +const ivec3 iv_zyx = iv.zyx; +const ivec4 iv_yzxw = iv.yzxw; + +int non_const_array_size_from_spec_const() { + int array[sp_int + 2]; + for (int i = 0; i < sp_int + 2; i++) { + array[i] = 1023; + } + return array[sp_int + 1]; +} + +void main() {} + diff --git a/Test/test-hlsl-spirv-list b/Test/test-hlsl-spirv-list new file mode 100644 index 00000000..d98a3cb4 --- /dev/null +++ b/Test/test-hlsl-spirv-list @@ -0,0 +1,4 @@ +# Test looping constructs. +# No tests yet for making sure break and continue from a nested loop +# goes to the innermost target. +hlsl.frag diff --git a/Test/test-preprocessor-list b/Test/test-preprocessor-list index 80d4b225..bd7e963b 100644 --- a/Test/test-preprocessor-list +++ b/Test/test-preprocessor-list @@ -13,3 +13,4 @@ preprocessor.simple.vert preprocessor.success_if_parse_would_fail.vert preprocessor.defined.vert preprocessor.many.endif.vert +preprocessor.eof_missing.vert diff --git a/Test/test-spirv-list b/Test/test-spirv-list index 4534132f..03f4432e 100644 --- a/Test/test-spirv-list +++ b/Test/test-spirv-list @@ -53,6 +53,7 @@ spv.forwardFun.frag spv.functionCall.frag spv.functionSemantics.frag spv.interpOps.frag +spv.int64.frag spv.layoutNested.vert spv.length.frag spv.localAggregates.frag @@ -71,6 +72,8 @@ spv.intOps.vert spv.precision.frag spv.prepost.frag spv.qualifiers.vert +spv.shaderBallot.comp +spv.shaderGroupVote.comp spv.shiftOps.frag spv.simpleFunctionCall.frag spv.simpleMat.vert @@ -103,6 +106,9 @@ spv.subpass.frag spv.specConstant.vert spv.specConstant.comp spv.specConstantComposite.vert +spv.specConstantOperations.vert +spv.precise.tese +spv.precise.tesc # GLSL-level semantics vulkan.frag vulkan.vert diff --git a/Test/testlist b/Test/testlist index d60fbca4..dd682b2d 100644 --- a/Test/testlist +++ b/Test/testlist @@ -128,4 +128,7 @@ varyingArrayIndirect.frag voidFunction.frag whileLoop.frag nonVulkan.frag +negativeArraySize.comp spv.atomic.comp +precise.tesc +precise_struct_block.vert diff --git a/Test/vulkan.ast.vert b/Test/vulkan.ast.vert new file mode 100644 index 00000000..c5a6a42c --- /dev/null +++ b/Test/vulkan.ast.vert @@ -0,0 +1,42 @@ +#version 450 + +layout(constant_id = 200) const float scf1 = 1.0; +layout(constant_id = 201) const bool scbt = true; +layout(constant_id = 202) const int sci2 = 2; + +void main() +{ + bool(scf1); // not a spec-const + bool(scbt); // spec-const + bool(sci2); // spec-const + + float(scf1); // not a spec-const + float(scbt); // not a spec-const + float(sci2); // not a spec-const + + int(scf1); // not a spec-const + int(scbt); // spec-const + int(sci2); // spec-const + + scf1 * scf1; // not a spec-const + scbt || scbt; // spec-const + sci2 * sci2; // spec-const + scf1 + sci2; // implicit conversion not a spec-const + + -scf1; // not a spec-const + !scbt; // spec-const + -sci2; // spec-const + + scf1 > scf1; // not a spec-const + sci2 > sci2; // spec-const + + scf1 != scf1; // not a spec-const + scbt != scbt; // spec-const + sci2 != sci2; // spec-const + + ivec2(sci2, sci2); // spec-const + ivec2[2](ivec2(sci2, sci2), ivec2(sci2, sci2)); // not a spec-const + + vec2(scf1, scf1); // not spec-const + vec2[2](vec2(scf1, scf1), vec2(scf1, scf1)); // not a spec-const +} diff --git a/Test/vulkan.frag b/Test/vulkan.frag index b96647c7..0148507f 100644 --- a/Test/vulkan.frag +++ b/Test/vulkan.frag @@ -67,3 +67,9 @@ subroutine int fooS; // ERROR, not in SPV subroutine int fooSub(); // ERROR, not in SPV uniform vec4 dv4; // ERROR, no default uniforms + +void fooTex() +{ + texture(t2d, vec2(1.0)); // ERROR, need a sampler, not a pure texture + imageStore(t2d, ivec2(4, 5), vec4(1.2)); // ERROR, need an image, not a pure texture +} \ No newline at end of file diff --git a/Test/vulkan.vert b/Test/vulkan.vert index ad33a53b..b234c75b 100644 --- a/Test/vulkan.vert +++ b/Test/vulkan.vert @@ -37,3 +37,11 @@ void foo() } layout(set = 1, push_constant) uniform badpc { int a; } badpcI; // ERROR, no descriptor set with push_constant + +#ifndef VULKAN +#error VULKAN should be defined +#endif + +#if VULKAN != 100 +#error VULKAN should be 100 +#endif diff --git a/glslang/CMakeLists.txt b/glslang/CMakeLists.txt index 28f4742c..f431cc11 100644 --- a/glslang/CMakeLists.txt +++ b/glslang/CMakeLists.txt @@ -1,5 +1,3 @@ -cmake_minimum_required(VERSION 2.8) - if(WIN32) add_subdirectory(OSDependent/Windows) elseif(UNIX) @@ -35,6 +33,7 @@ set(SOURCES MachineIndependent/preprocessor/PpScanner.cpp MachineIndependent/preprocessor/PpSymbols.cpp MachineIndependent/preprocessor/PpTokens.cpp + MachineIndependent/propagateNoContraction.cpp GenericCodeGen/CodeGen.cpp GenericCodeGen/Link.cpp) @@ -63,6 +62,8 @@ set(HEADERS MachineIndependent/ScanContext.h MachineIndependent/SymbolTable.h MachineIndependent/Versions.h + MachineIndependent/parseVersions.h + MachineIndependent/propagateNoContraction.h MachineIndependent/preprocessor/PpContext.h MachineIndependent/preprocessor/PpTokens.h) @@ -76,6 +77,7 @@ set(HEADERS # set(BISON_GLSLParser_OUTPUT_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/MachineIndependent/glslang_tab.cpp) add_library(glslang STATIC ${BISON_GLSLParser_OUTPUT_SOURCE} ${SOURCES} ${HEADERS}) +set_property(TARGET glslang PROPERTY FOLDER glslang) if(WIN32) source_group("Public" REGULAR_EXPRESSION "Public/*") diff --git a/glslang/Include/BaseTypes.h b/glslang/Include/BaseTypes.h index 5a57664f..2c275772 100644 --- a/glslang/Include/BaseTypes.h +++ b/glslang/Include/BaseTypes.h @@ -48,6 +48,8 @@ enum TBasicType { EbtDouble, EbtInt, EbtUint, + EbtInt64, + EbtUint64, EbtBool, EbtAtomicUint, EbtSampler, @@ -128,6 +130,13 @@ enum TBuiltInVariable { EbvLocalInvocationId, EbvGlobalInvocationId, EbvLocalInvocationIndex, + EbvSubGroupSize, + EbvSubGroupInvocation, + EbvSubGroupEqMask, + EbvSubGroupGeMask, + EbvSubGroupGtMask, + EbvSubGroupLeMask, + EbvSubGroupLtMask, EbvVertexId, EbvInstanceId, EbvVertexIndex, @@ -221,6 +230,13 @@ __inline const char* GetBuiltInVariableString(TBuiltInVariable v) case EbvLocalInvocationId: return "LocalInvocationID"; case EbvGlobalInvocationId: return "GlobalInvocationID"; case EbvLocalInvocationIndex: return "LocalInvocationIndex"; + case EbvSubGroupSize: return "SubGroupSize"; + case EbvSubGroupInvocation: return "SubGroupInvocation"; + case EbvSubGroupEqMask: return "SubGroupEqMask"; + case EbvSubGroupGeMask: return "SubGroupGeMask"; + case EbvSubGroupGtMask: return "SubGroupGtMask"; + case EbvSubGroupLeMask: return "SubGroupLeMask"; + case EbvSubGroupLtMask: return "SubGroupLtMask"; case EbvVertexId: return "VertexId"; case EbvInstanceId: return "InstanceId"; case EbvVertexIndex: return "VertexIndex"; diff --git a/glslang/Include/Common.h b/glslang/Include/Common.h index 2872fac8..05c8447f 100644 --- a/glslang/Include/Common.h +++ b/glslang/Include/Common.h @@ -51,7 +51,7 @@ #define UINT_PTR uintptr_t #endif -#ifdef __ANDROID__ +#if defined(__ANDROID__) || _MSC_VER < 1700 #include namespace std { template @@ -62,6 +62,18 @@ std::string to_string(const T& val) { } } #endif + +#if defined(_MSC_VER) && _MSC_VER < 1700 +inline long long int strtoll (const char* str, char** endptr, int base) +{ + return _strtoi64(str, endptr, base); +} +inline long long int atoll (const char* str) +{ + return strtoll(str, NULL, 10); +} +#endif + /* windows only pragma */ #ifdef _MSC_VER #pragma warning(disable : 4786) // Don't warn about too long identifiers diff --git a/glslang/Include/ConstantUnion.h b/glslang/Include/ConstantUnion.h index c53870d9..8ee2c84c 100644 --- a/glslang/Include/ConstantUnion.h +++ b/glslang/Include/ConstantUnion.h @@ -57,6 +57,18 @@ public: type = EbtUint; } + void setI64Const(long long i64) + { + i64Const = i64; + type = EbtInt64; + } + + void setU64Const(unsigned long long u64) + { + u64Const = u64; + type = EbtUint64; + } + void setDConst(double d) { dConst = d; @@ -69,10 +81,12 @@ public: type = EbtBool; } - int getIConst() const { return iConst; } - unsigned int getUConst() const { return uConst; } - double getDConst() const { return dConst; } - bool getBConst() const { return bConst; } + int getIConst() const { return iConst; } + unsigned int getUConst() const { return uConst; } + long long getI64Const() const { return i64Const; } + unsigned long long getU64Const() const { return u64Const; } + double getDConst() const { return dConst; } + bool getBConst() const { return bConst; } bool operator==(const int i) const { @@ -82,7 +96,7 @@ public: return false; } - bool operator==(unsigned const int u) const + bool operator==(const unsigned int u) const { if (u == uConst) return true; @@ -90,6 +104,22 @@ public: return false; } + bool operator==(const long long i64) const + { + if (i64 == i64Const) + return true; + + return false; + } + + bool operator==(const unsigned long long u64) const + { + if (u64 == u64Const) + return true; + + return false; + } + bool operator==(const double d) const { if (d == dConst) @@ -121,6 +151,16 @@ public: if (constant.uConst == uConst) return true; + break; + case EbtInt64: + if (constant.i64Const == i64Const) + return true; + + break; + case EbtUint64: + if (constant.u64Const == u64Const) + return true; + break; case EbtDouble: if (constant.dConst == dConst) @@ -149,6 +189,16 @@ public: return !operator==(u); } + bool operator!=(const long long i) const + { + return !operator==(i); + } + + bool operator!=(const unsigned long long u) const + { + return !operator==(u); + } + bool operator!=(const float f) const { return !operator==(f); @@ -177,6 +227,16 @@ public: if (uConst > constant.uConst) return true; + return false; + case EbtInt64: + if (i64Const > constant.i64Const) + return true; + + return false; + case EbtUint64: + if (u64Const > constant.u64Const) + return true; + return false; case EbtDouble: if (dConst > constant.dConst) @@ -202,6 +262,16 @@ public: if (uConst < constant.uConst) return true; + return false; + case EbtInt64: + if (i64Const < constant.i64Const) + return true; + + return false; + case EbtUint64: + if (u64Const < constant.u64Const) + return true; + return false; case EbtDouble: if (dConst < constant.dConst) @@ -220,7 +290,9 @@ public: assert(type == constant.type); switch (type) { case EbtInt: returnValue.setIConst(iConst + constant.iConst); break; + case EbtInt64: returnValue.setI64Const(i64Const + constant.i64Const); break; case EbtUint: returnValue.setUConst(uConst + constant.uConst); break; + case EbtUint64: returnValue.setU64Const(u64Const + constant.u64Const); break; case EbtDouble: returnValue.setDConst(dConst + constant.dConst); break; default: assert(false && "Default missing"); } @@ -234,7 +306,9 @@ public: assert(type == constant.type); switch (type) { case EbtInt: returnValue.setIConst(iConst - constant.iConst); break; + case EbtInt64: returnValue.setI64Const(i64Const - constant.i64Const); break; case EbtUint: returnValue.setUConst(uConst - constant.uConst); break; + case EbtUint64: returnValue.setU64Const(u64Const - constant.u64Const); break; case EbtDouble: returnValue.setDConst(dConst - constant.dConst); break; default: assert(false && "Default missing"); } @@ -248,7 +322,9 @@ public: assert(type == constant.type); switch (type) { case EbtInt: returnValue.setIConst(iConst * constant.iConst); break; + case EbtInt64: returnValue.setI64Const(i64Const * constant.i64Const); break; case EbtUint: returnValue.setUConst(uConst * constant.uConst); break; + case EbtUint64: returnValue.setU64Const(u64Const * constant.u64Const); break; case EbtDouble: returnValue.setDConst(dConst * constant.dConst); break; default: assert(false && "Default missing"); } @@ -261,8 +337,10 @@ public: TConstUnion returnValue; assert(type == constant.type); switch (type) { - case EbtInt: returnValue.setIConst(iConst % constant.iConst); break; + case EbtInt: returnValue.setIConst(iConst % constant.iConst); break; + case EbtInt64: returnValue.setI64Const(i64Const % constant.i64Const); break; case EbtUint: returnValue.setUConst(uConst % constant.uConst); break; + case EbtUint64: returnValue.setU64Const(u64Const % constant.u64Const); break; default: assert(false && "Default missing"); } @@ -275,16 +353,38 @@ public: switch (type) { case EbtInt: switch (constant.type) { - case EbtInt: returnValue.setIConst(iConst >> constant.iConst); break; - case EbtUint: returnValue.setIConst(iConst >> constant.uConst); break; - default: assert(false && "Default missing"); + case EbtInt: returnValue.setIConst(iConst >> constant.iConst); break; + case EbtUint: returnValue.setIConst(iConst >> constant.uConst); break; + case EbtInt64: returnValue.setIConst(iConst >> constant.i64Const); break; + case EbtUint64: returnValue.setIConst(iConst >> constant.u64Const); break; + default: assert(false && "Default missing"); } break; case EbtUint: switch (constant.type) { - case EbtInt: returnValue.setUConst(uConst >> constant.iConst); break; - case EbtUint: returnValue.setUConst(uConst >> constant.uConst); break; - default: assert(false && "Default missing"); + case EbtInt: returnValue.setUConst(uConst >> constant.iConst); break; + case EbtUint: returnValue.setUConst(uConst >> constant.uConst); break; + case EbtInt64: returnValue.setUConst(uConst >> constant.i64Const); break; + case EbtUint64: returnValue.setUConst(uConst >> constant.u64Const); break; + default: assert(false && "Default missing"); + } + break; + case EbtInt64: + switch (constant.type) { + case EbtInt: returnValue.setI64Const(i64Const >> constant.iConst); break; + case EbtUint: returnValue.setI64Const(i64Const >> constant.uConst); break; + case EbtInt64: returnValue.setI64Const(i64Const >> constant.i64Const); break; + case EbtUint64: returnValue.setI64Const(i64Const >> constant.u64Const); break; + default: assert(false && "Default missing"); + } + break; + case EbtUint64: + switch (constant.type) { + case EbtInt: returnValue.setU64Const(u64Const >> constant.iConst); break; + case EbtUint: returnValue.setU64Const(u64Const >> constant.uConst); break; + case EbtInt64: returnValue.setU64Const(u64Const >> constant.i64Const); break; + case EbtUint64: returnValue.setU64Const(u64Const >> constant.u64Const); break; + default: assert(false && "Default missing"); } break; default: assert(false && "Default missing"); @@ -299,16 +399,38 @@ public: switch (type) { case EbtInt: switch (constant.type) { - case EbtInt: returnValue.setIConst(iConst << constant.iConst); break; - case EbtUint: returnValue.setIConst(iConst << constant.uConst); break; - default: assert(false && "Default missing"); + case EbtInt: returnValue.setIConst(iConst << constant.iConst); break; + case EbtUint: returnValue.setIConst(iConst << constant.uConst); break; + case EbtInt64: returnValue.setIConst(iConst << constant.i64Const); break; + case EbtUint64: returnValue.setIConst(iConst << constant.u64Const); break; + default: assert(false && "Default missing"); } break; case EbtUint: switch (constant.type) { - case EbtInt: returnValue.setUConst(uConst << constant.iConst); break; - case EbtUint: returnValue.setUConst(uConst << constant.uConst); break; - default: assert(false && "Default missing"); + case EbtInt: returnValue.setUConst(uConst << constant.iConst); break; + case EbtUint: returnValue.setUConst(uConst << constant.uConst); break; + case EbtInt64: returnValue.setUConst(uConst << constant.i64Const); break; + case EbtUint64: returnValue.setUConst(uConst << constant.u64Const); break; + default: assert(false && "Default missing"); + } + break; + case EbtInt64: + switch (constant.type) { + case EbtInt: returnValue.setI64Const(i64Const << constant.iConst); break; + case EbtUint: returnValue.setI64Const(i64Const << constant.uConst); break; + case EbtInt64: returnValue.setI64Const(i64Const << constant.i64Const); break; + case EbtUint64: returnValue.setI64Const(i64Const << constant.u64Const); break; + default: assert(false && "Default missing"); + } + break; + case EbtUint64: + switch (constant.type) { + case EbtInt: returnValue.setU64Const(u64Const << constant.iConst); break; + case EbtUint: returnValue.setU64Const(u64Const << constant.uConst); break; + case EbtInt64: returnValue.setU64Const(u64Const << constant.i64Const); break; + case EbtUint64: returnValue.setU64Const(u64Const << constant.u64Const); break; + default: assert(false && "Default missing"); } break; default: assert(false && "Default missing"); @@ -324,6 +446,8 @@ public: switch (type) { case EbtInt: returnValue.setIConst(iConst & constant.iConst); break; case EbtUint: returnValue.setUConst(uConst & constant.uConst); break; + case EbtInt64: returnValue.setI64Const(i64Const & constant.i64Const); break; + case EbtUint64: returnValue.setU64Const(u64Const & constant.u64Const); break; default: assert(false && "Default missing"); } @@ -337,6 +461,8 @@ public: switch (type) { case EbtInt: returnValue.setIConst(iConst | constant.iConst); break; case EbtUint: returnValue.setUConst(uConst | constant.uConst); break; + case EbtInt64: returnValue.setI64Const(i64Const | constant.i64Const); break; + case EbtUint64: returnValue.setU64Const(u64Const | constant.u64Const); break; default: assert(false && "Default missing"); } @@ -350,6 +476,8 @@ public: switch (type) { case EbtInt: returnValue.setIConst(iConst ^ constant.iConst); break; case EbtUint: returnValue.setUConst(uConst ^ constant.uConst); break; + case EbtInt64: returnValue.setI64Const(i64Const ^ constant.i64Const); break; + case EbtUint64: returnValue.setU64Const(u64Const ^ constant.u64Const); break; default: assert(false && "Default missing"); } @@ -362,6 +490,8 @@ public: switch (type) { case EbtInt: returnValue.setIConst(~iConst); break; case EbtUint: returnValue.setUConst(~uConst); break; + case EbtInt64: returnValue.setI64Const(~i64Const); break; + case EbtUint64: returnValue.setU64Const(~u64Const); break; default: assert(false && "Default missing"); } @@ -396,10 +526,12 @@ public: private: union { - int iConst; // used for ivec, scalar ints - unsigned int uConst; // used for uvec, scalar uints - bool bConst; // used for bvec, scalar bools - double dConst; // used for vec, dvec, mat, dmat, scalar floats and doubles + int iConst; // used for ivec, scalar ints + unsigned int uConst; // used for uvec, scalar uints + long long i64Const; // used for i64vec, scalar int64s + unsigned long long u64Const; // used for u64vec, scalar uint64s + bool bConst; // used for bvec, scalar bools + double dConst; // used for vec, dvec, mat, dmat, scalar floats and doubles }; TBasicType type; diff --git a/glslang/Include/InfoSink.h b/glslang/Include/InfoSink.h index a321ebcc..5862e5d8 100644 --- a/glslang/Include/InfoSink.h +++ b/glslang/Include/InfoSink.h @@ -92,7 +92,7 @@ public: case EPrefixInternalError: append("INTERNAL ERROR: "); break; case EPrefixUnimplemented: append("UNIMPLEMENTED: "); break; case EPrefixNote: append("NOTE: "); break; - default: append("UNKOWN ERROR: "); break; + default: append("UNKNOWN ERROR: "); break; } } void location(const TSourceLoc& loc) { diff --git a/glslang/Include/PoolAlloc.h b/glslang/Include/PoolAlloc.h index de41053f..c3bebc63 100644 --- a/glslang/Include/PoolAlloc.h +++ b/glslang/Include/PoolAlloc.h @@ -95,7 +95,7 @@ public: void checkAllocList() const; - // Return total size needed to accomodate user buffer of 'size', + // Return total size needed to accommodate user buffer of 'size', // plus our tracking data. inline static size_t allocationSize(size_t size) { return size + 2 * guardBlockSize + headerSize(); @@ -241,8 +241,8 @@ protected: int numCalls; // just an interesting statistic size_t totalBytes; // just an interesting statistic private: - TPoolAllocator& operator=(const TPoolAllocator&); // dont allow assignment operator - TPoolAllocator(const TPoolAllocator&); // dont allow default copy constructor + TPoolAllocator& operator=(const TPoolAllocator&); // don't allow assignment operator + TPoolAllocator(const TPoolAllocator&); // don't allow default copy constructor }; diff --git a/glslang/Include/Types.h b/glslang/Include/Types.h index bff7e9a9..c4933e07 100644 --- a/glslang/Include/Types.h +++ b/glslang/Include/Types.h @@ -182,6 +182,8 @@ struct TSampler { // misnomer now; includes images, textures without sampler, case EbtFloat: break; case EbtInt: s.append("i"); break; case EbtUint: s.append("u"); break; + case EbtInt64: s.append("i64"); break; + case EbtUint64: s.append("u64"); break; default: break; // some compilers want this } if (image) { @@ -388,6 +390,7 @@ public: { precision = EpqNone; invariant = false; + noContraction = false; makeTemporary(); } @@ -427,7 +430,8 @@ public: TStorageQualifier storage : 6; TBuiltInVariable builtIn : 8; TPrecisionQualifier precision : 3; - bool invariant : 1; + bool invariant : 1; // require canonical treatment for cross-shader invariance + bool noContraction: 1; // prevent contraction and reassociation, e.g., for 'precise' keyword, and expressions it affects bool centroid : 1; bool smooth : 1; bool flat : 1; @@ -999,9 +1003,9 @@ public: qualifier.storage = EvqGlobal; } - void init(const TSourceLoc& loc, bool global = false) + void init(const TSourceLoc& l, bool global = false) { - initType(loc); + initType(l); sampler.clear(); initQualifiers(global); shaderQualifiers.init(); @@ -1040,8 +1044,8 @@ public: // for "empty" type (no args) or simple scalar/vector/matrix explicit TType(TBasicType t = EbtVoid, TStorageQualifier q = EvqTemporary, int vs = 1, int mc = 0, int mr = 0) : - basicType(t), vectorSize(vs), matrixCols(mc), matrixRows(mr), arraySizes(nullptr), - structure(nullptr), fieldName(nullptr), typeName(nullptr) + basicType(t), vectorSize(vs), matrixCols(mc), matrixRows(mr), vector1(false), + arraySizes(nullptr), structure(nullptr), fieldName(nullptr), typeName(nullptr) { sampler.clear(); qualifier.clear(); @@ -1049,8 +1053,8 @@ public: } // for explicit precision qualifier TType(TBasicType t, TStorageQualifier q, TPrecisionQualifier p, int vs = 1, int mc = 0, int mr = 0) : - basicType(t), vectorSize(vs), matrixCols(mc), matrixRows(mr), arraySizes(nullptr), - structure(nullptr), fieldName(nullptr), typeName(nullptr) + basicType(t), vectorSize(vs), matrixCols(mc), matrixRows(mr), vector1(false), + arraySizes(nullptr), structure(nullptr), fieldName(nullptr), typeName(nullptr) { sampler.clear(); qualifier.clear(); @@ -1060,8 +1064,9 @@ public: } // for turning a TPublicType into a TType, using a shallow copy explicit TType(const TPublicType& p) : - basicType(p.basicType), vectorSize(p.vectorSize), matrixCols(p.matrixCols), matrixRows(p.matrixRows), arraySizes(p.arraySizes), - structure(nullptr), fieldName(nullptr), typeName(nullptr) + basicType(p.basicType), + vectorSize(p.vectorSize), matrixCols(p.matrixCols), matrixRows(p.matrixRows), vector1(false), + arraySizes(p.arraySizes), structure(nullptr), fieldName(nullptr), typeName(nullptr) { if (basicType == EbtSampler) sampler = p.sampler; @@ -1096,19 +1101,25 @@ public: // do a vector/matrix dereference shallowCopy(type); if (matrixCols > 0) { + // dereference from matrix to vector if (rowMajor) vectorSize = matrixCols; else vectorSize = matrixRows; matrixCols = 0; matrixRows = 0; - } else if (vectorSize > 1) + if (vectorSize == 1) + vector1 = true; + } else if (isVector()) { + // dereference from vector to scalar vectorSize = 1; + vector1 = false; + } } } // for making structures, ... TType(TTypeList* userDef, const TString& n) : - basicType(EbtStruct), vectorSize(1), matrixCols(0), matrixRows(0), + basicType(EbtStruct), vectorSize(1), matrixCols(0), matrixRows(0), vector1(false), arraySizes(nullptr), structure(userDef), fieldName(nullptr) { sampler.clear(); @@ -1117,7 +1128,7 @@ public: } // For interface blocks TType(TTypeList* userDef, const TString& n, const TQualifier& q) : - basicType(EbtBlock), vectorSize(1), matrixCols(0), matrixRows(0), + basicType(EbtBlock), vectorSize(1), matrixCols(0), matrixRows(0), vector1(false), qualifier(q), arraySizes(nullptr), structure(userDef), fieldName(nullptr) { sampler.clear(); @@ -1136,6 +1147,7 @@ public: vectorSize = copyOf.vectorSize; matrixCols = copyOf.matrixCols; matrixRows = copyOf.matrixRows; + vector1 = copyOf.vector1; arraySizes = copyOf.arraySizes; // copying the pointer only, not the contents structure = copyOf.structure; fieldName = copyOf.fieldName; @@ -1176,6 +1188,8 @@ public: return newType; } + void makeVector() { vector1 = true; } + // Merge type from parent, where a parentType is at the beginning of a declaration, // establishing some characteristics for all subsequent names, while this type // is on the individual names. @@ -1186,6 +1200,7 @@ public: vectorSize = parentType.vectorSize; matrixCols = parentType.matrixCols; matrixRows = parentType.matrixRows; + vector1 = false; // TPublicType is only GLSL which so far has no vec1 qualifier = parentType.qualifier; sampler = parentType.sampler; if (parentType.arraySizes) @@ -1219,7 +1234,7 @@ public: virtual TQualifier& getQualifier() { return qualifier; } virtual const TQualifier& getQualifier() const { return qualifier; } - virtual int getVectorSize() const { return vectorSize; } + virtual int getVectorSize() const { return vectorSize; } // returns 1 for either scalar or vector of size 1, valid for both virtual int getMatrixCols() const { return matrixCols; } virtual int getMatrixRows() const { return matrixRows; } virtual int getOuterArraySize() const { return arraySizes->getOuterSize(); } @@ -1230,14 +1245,15 @@ public: virtual const TArraySizes* getArraySizes() const { return arraySizes; } virtual TArraySizes& getArraySizes() { assert(arraySizes != nullptr); return *arraySizes; } - virtual bool isScalar() const { return vectorSize == 1 && ! isStruct() && ! isArray(); } - virtual bool isVector() const { return vectorSize > 1; } + virtual bool isScalar() const { return ! isVector() && ! isMatrix() && ! isStruct() && ! isArray(); } + virtual bool isVector() const { return vectorSize > 1 || vector1; } virtual bool isMatrix() const { return matrixCols ? true : false; } virtual bool isArray() const { return arraySizes != nullptr; } virtual bool isExplicitlySizedArray() const { return isArray() && getOuterArraySize() != UnsizedArraySize; } virtual bool isImplicitlySizedArray() const { return isArray() && getOuterArraySize() == UnsizedArraySize && qualifier.storage != EvqBuffer; } virtual bool isRuntimeSizedArray() const { return isArray() && getOuterArraySize() == UnsizedArraySize && qualifier.storage == EvqBuffer; } virtual bool isStruct() const { return structure != nullptr; } + virtual bool isFloatingDomain() const { return basicType == EbtFloat || basicType == EbtDouble; } // "Image" is a superset of "Subpass" virtual bool isImage() const { return basicType == EbtSampler && getSampler().isImage(); } @@ -1319,6 +1335,8 @@ public: case EbtDouble: case EbtInt: case EbtUint: + case EbtInt64: + case EbtUint64: case EbtBool: return true; default: @@ -1409,6 +1427,8 @@ public: case EbtDouble: return "double"; case EbtInt: return "int"; case EbtUint: return "uint"; + case EbtInt64: return "int64_t"; + case EbtUint64: return "uint64_t"; case EbtBool: return "bool"; case EbtAtomicUint: return "atomic_uint"; case EbtSampler: return "sampler/image"; @@ -1473,6 +1493,8 @@ public: if (qualifier.invariant) p += snprintf(p, end - p, "invariant "); + if (qualifier.noContraction) + p += snprintf(p, end - p, "noContraction "); if (qualifier.centroid) p += snprintf(p, end - p, "centroid "); if (qualifier.smooth) @@ -1498,7 +1520,7 @@ public: if (qualifier.specConstant) p += snprintf(p, end - p, "specialization-constant "); p += snprintf(p, end - p, "%s ", getStorageQualifierString()); - if (arraySizes) { + if (isArray()) { for(int i = 0; i < (int)arraySizes->getNumDims(); ++i) { int size = arraySizes->getDimSize(i); if (size == 0) @@ -1509,9 +1531,9 @@ public: } if (qualifier.precision != EpqNone) p += snprintf(p, end - p, "%s ", getPrecisionQualifierString()); - if (matrixCols > 0) + if (isMatrix()) p += snprintf(p, end - p, "%dX%d matrix of ", matrixCols, matrixRows); - else if (vectorSize > 1) + else if (isVector()) p += snprintf(p, end - p, "%d-component vector of ", vectorSize); *p = 0; @@ -1643,6 +1665,7 @@ public: vectorSize == right.vectorSize && matrixCols == right.matrixCols && matrixRows == right.matrixRows && + vector1 == right.vector1 && sameStructType(right); } @@ -1665,9 +1688,14 @@ protected: void buildMangledName(TString&); TBasicType basicType : 8; - int vectorSize : 4; + int vectorSize : 4; // 1 means either scalar or 1-component vector; see vector1 to disambiguate. int matrixCols : 4; int matrixRows : 4; + bool vector1 : 1; // Backward-compatible tracking of a 1-component vector distinguished from a scalar. + // GLSL 4.5 never has a 1-component vector; so this will always be false until such + // functionality is added. + // HLSL does have a 1-component vectors, so this will be true to disambiguate + // from a scalar. TSampler sampler; TQualifier qualifier; diff --git a/glslang/Include/intermediate.h b/glslang/Include/intermediate.h index ab177011..3b819de0 100644 --- a/glslang/Include/intermediate.h +++ b/glslang/Include/intermediate.h @@ -81,22 +81,44 @@ enum TOperator { EOpConvUintToBool, EOpConvFloatToBool, EOpConvDoubleToBool, + EOpConvInt64ToBool, + EOpConvUint64ToBool, EOpConvBoolToFloat, EOpConvIntToFloat, EOpConvUintToFloat, EOpConvDoubleToFloat, + EOpConvInt64ToFloat, + EOpConvUint64ToFloat, EOpConvUintToInt, EOpConvFloatToInt, EOpConvBoolToInt, EOpConvDoubleToInt, + EOpConvInt64ToInt, + EOpConvUint64ToInt, EOpConvIntToUint, EOpConvFloatToUint, EOpConvBoolToUint, EOpConvDoubleToUint, + EOpConvInt64ToUint, + EOpConvUint64ToUint, EOpConvIntToDouble, EOpConvUintToDouble, EOpConvFloatToDouble, EOpConvBoolToDouble, + EOpConvInt64ToDouble, + EOpConvUint64ToDouble, + EOpConvBoolToInt64, + EOpConvIntToInt64, + EOpConvUintToInt64, + EOpConvFloatToInt64, + EOpConvDoubleToInt64, + EOpConvUint64ToInt64, + EOpConvBoolToUint64, + EOpConvIntToUint64, + EOpConvUintToUint64, + EOpConvFloatToUint64, + EOpConvDoubleToUint64, + EOpConvInt64ToUint64, // // binary operations @@ -194,6 +216,10 @@ enum TOperator { EOpFloatBitsToUint, EOpIntBitsToFloat, EOpUintBitsToFloat, + EOpDoubleBitsToInt64, + EOpDoubleBitsToUint64, + EOpInt64BitsToDouble, + EOpUint64BitsToDouble, EOpPackSnorm2x16, EOpUnpackSnorm2x16, EOpPackUnorm2x16, @@ -206,6 +232,10 @@ enum TOperator { EOpUnpackHalf2x16, EOpPackDouble2x32, EOpUnpackDouble2x32, + EOpPackInt2x32, + EOpUnpackInt2x32, + EOpPackUint2x32, + EOpUnpackUint2x32, EOpLength, EOpDistance, @@ -253,6 +283,14 @@ enum TOperator { EOpMemoryBarrierShared, // compute only EOpGroupMemoryBarrier, // compute only + EOpBallot, + EOpReadInvocation, + EOpReadFirstInvocation, + + EOpAnyInvocation, + EOpAllInvocations, + EOpAllInvocationsEqual, + EOpAtomicAdd, EOpAtomicMin, EOpAtomicMax, @@ -287,6 +325,8 @@ enum TOperator { EOpConstructGuardStart, EOpConstructInt, // these first scalar forms also identify what implicit conversion is needed EOpConstructUint, + EOpConstructInt64, + EOpConstructUint64, EOpConstructBool, EOpConstructFloat, EOpConstructDouble, @@ -305,6 +345,12 @@ enum TOperator { EOpConstructUVec2, EOpConstructUVec3, EOpConstructUVec4, + EOpConstructI64Vec2, + EOpConstructI64Vec3, + EOpConstructI64Vec4, + EOpConstructU64Vec2, + EOpConstructU64Vec3, + EOpConstructU64Vec4, EOpConstructMat2x2, EOpConstructMat2x3, EOpConstructMat2x4, @@ -956,6 +1002,11 @@ enum TVisit // If you only want post-visits, explicitly turn off preVisit (and inVisit) // and turn on postVisit. // +// In general, for the visit*() methods, return true from interior nodes +// to have the traversal continue on to children. +// +// If you process children yourself, or don't want them processed, return false. +// class TIntermTraverser { public: POOL_ALLOCATOR_NEW_DELETE(glslang::GetThreadPoolAllocator()) diff --git a/glslang/MachineIndependent/Constant.cpp b/glslang/MachineIndependent/Constant.cpp index db2f70da..03033bce 100644 --- a/glslang/MachineIndependent/Constant.cpp +++ b/glslang/MachineIndependent/Constant.cpp @@ -194,6 +194,22 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TIntermTyped* right } else newConstArray[i].setUConst(leftUnionArray[i].getUConst() / rightUnionArray[i].getUConst()); break; + + case EbtInt64: + if (rightUnionArray[i] == 0) + newConstArray[i].setI64Const(0x7FFFFFFFFFFFFFFFll); + else if (rightUnionArray[i].getI64Const() == -1 && leftUnionArray[i].getI64Const() == (long long)0x8000000000000000) + newConstArray[i].setI64Const(0x8000000000000000); + else + newConstArray[i].setI64Const(leftUnionArray[i].getI64Const() / rightUnionArray[i].getI64Const()); + break; + + case EbtUint64: + if (rightUnionArray[i] == 0) { + newConstArray[i].setU64Const(0xFFFFFFFFFFFFFFFFull); + } else + newConstArray[i].setU64Const(leftUnionArray[i].getU64Const() / rightUnionArray[i].getU64Const()); + break; default: return 0; } @@ -419,6 +435,8 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TType& returnType) case EbtFloat: newConstArray[i].setDConst(-unionArray[i].getDConst()); break; case EbtInt: newConstArray[i].setIConst(-unionArray[i].getIConst()); break; case EbtUint: newConstArray[i].setUConst(static_cast(-static_cast(unionArray[i].getUConst()))); break; + case EbtInt64: newConstArray[i].setI64Const(-unionArray[i].getI64Const()); break; + case EbtUint64: newConstArray[i].setU64Const(static_cast(-static_cast(unionArray[i].getU64Const()))); break; default: return 0; } @@ -566,6 +584,8 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TType& returnType) case EOpFloatBitsToUint: case EOpIntBitsToFloat: case EOpUintBitsToFloat: + case EOpDoubleBitsToInt64: + case EOpDoubleBitsToUint64: default: return 0; @@ -651,7 +671,10 @@ TIntermTyped* TIntermediate::fold(TIntermAggregate* aggrNode) bool isFloatingPoint = children[0]->getAsTyped()->getBasicType() == EbtFloat || children[0]->getAsTyped()->getBasicType() == EbtDouble; - bool isSigned = children[0]->getAsTyped()->getBasicType() == EbtInt; + bool isSigned = children[0]->getAsTyped()->getBasicType() == EbtInt || + children[0]->getAsTyped()->getBasicType() == EbtInt64; + bool isInt64 = children[0]->getAsTyped()->getBasicType() == EbtInt64 || + children[0]->getAsTyped()->getBasicType() == EbtUint64; if (componentwise) { for (int comp = 0; comp < objectSize; comp++) { @@ -674,29 +697,52 @@ TIntermTyped* TIntermediate::fold(TIntermAggregate* aggrNode) case EOpMin: if (isFloatingPoint) newConstArray[comp].setDConst(std::min(childConstUnions[0][arg0comp].getDConst(), childConstUnions[1][arg1comp].getDConst())); - else if (isSigned) - newConstArray[comp].setIConst(std::min(childConstUnions[0][arg0comp].getIConst(), childConstUnions[1][arg1comp].getIConst())); - else - newConstArray[comp].setUConst(std::min(childConstUnions[0][arg0comp].getUConst(), childConstUnions[1][arg1comp].getUConst())); + else if (isSigned) { + if (isInt64) + newConstArray[comp].setI64Const(std::min(childConstUnions[0][arg0comp].getI64Const(), childConstUnions[1][arg1comp].getI64Const())); + else + newConstArray[comp].setIConst(std::min(childConstUnions[0][arg0comp].getIConst(), childConstUnions[1][arg1comp].getIConst())); + } else { + if (isInt64) + newConstArray[comp].setU64Const(std::min(childConstUnions[0][arg0comp].getU64Const(), childConstUnions[1][arg1comp].getU64Const())); + else + newConstArray[comp].setUConst(std::min(childConstUnions[0][arg0comp].getUConst(), childConstUnions[1][arg1comp].getUConst())); + } break; case EOpMax: if (isFloatingPoint) newConstArray[comp].setDConst(std::max(childConstUnions[0][arg0comp].getDConst(), childConstUnions[1][arg1comp].getDConst())); - else if (isSigned) - newConstArray[comp].setIConst(std::max(childConstUnions[0][arg0comp].getIConst(), childConstUnions[1][arg1comp].getIConst())); - else - newConstArray[comp].setUConst(std::max(childConstUnions[0][arg0comp].getUConst(), childConstUnions[1][arg1comp].getUConst())); + else if (isSigned) { + if (isInt64) + newConstArray[comp].setI64Const(std::max(childConstUnions[0][arg0comp].getI64Const(), childConstUnions[1][arg1comp].getI64Const())); + else + newConstArray[comp].setIConst(std::max(childConstUnions[0][arg0comp].getIConst(), childConstUnions[1][arg1comp].getIConst())); + } else { + if (isInt64) + newConstArray[comp].setU64Const(std::max(childConstUnions[0][arg0comp].getU64Const(), childConstUnions[1][arg1comp].getU64Const())); + else + newConstArray[comp].setUConst(std::max(childConstUnions[0][arg0comp].getUConst(), childConstUnions[1][arg1comp].getUConst())); + } break; case EOpClamp: if (isFloatingPoint) - newConstArray[comp].setDConst(std::min(std::max(childConstUnions[0][arg0comp].getDConst(), childConstUnions[1][arg1comp].getDConst()), + newConstArray[comp].setDConst(std::min(std::max(childConstUnions[0][arg0comp].getDConst(), childConstUnions[1][arg1comp].getDConst()), childConstUnions[2][arg2comp].getDConst())); - else if (isSigned) - newConstArray[comp].setIConst(std::min(std::max(childConstUnions[0][arg0comp].getIConst(), childConstUnions[1][arg1comp].getIConst()), - childConstUnions[2][arg2comp].getIConst())); - else - newConstArray[comp].setUConst(std::min(std::max(childConstUnions[0][arg0comp].getUConst(), childConstUnions[1][arg1comp].getUConst()), - childConstUnions[2][arg2comp].getUConst())); + else if (isSigned) { + if (isInt64) + newConstArray[comp].setI64Const(std::min(std::max(childConstUnions[0][arg0comp].getI64Const(), childConstUnions[1][arg1comp].getI64Const()), + childConstUnions[2][arg2comp].getI64Const())); + else + newConstArray[comp].setIConst(std::min(std::max(childConstUnions[0][arg0comp].getIConst(), childConstUnions[1][arg1comp].getIConst()), + childConstUnions[2][arg2comp].getIConst())); + } else { + if (isInt64) + newConstArray[comp].setU64Const(std::min(std::max(childConstUnions[0][arg0comp].getU64Const(), childConstUnions[1][arg1comp].getU64Const()), + childConstUnions[2][arg2comp].getU64Const())); + else + newConstArray[comp].setUConst(std::min(std::max(childConstUnions[0][arg0comp].getUConst(), childConstUnions[1][arg1comp].getUConst()), + childConstUnions[2][arg2comp].getUConst())); + } break; case EOpLessThan: newConstArray[comp].setBConst(childConstUnions[0][arg0comp] < childConstUnions[1][arg1comp]); diff --git a/glslang/MachineIndependent/Initialize.cpp b/glslang/MachineIndependent/Initialize.cpp index 2e094f02..6a9fb201 100644 --- a/glslang/MachineIndependent/Initialize.cpp +++ b/glslang/MachineIndependent/Initialize.cpp @@ -1,6 +1,6 @@ // //Copyright (C) 2002-2005 3Dlabs Inc. Ltd. -//Copyright (C) 2012-2015 LunarG, Inc. +//Copyright (C) 2012-2016 LunarG, Inc. //Copyright (C) 2015-2016 Google, Inc. // //All rights reserved. @@ -43,9 +43,9 @@ // Where to put a built-in: // TBuiltIns::initialize(version,profile) context-independent textual built-ins; add them to the right string // TBuiltIns::initialize(resources,...) context-dependent textual built-ins; add them to the right string -// IdentifyBuiltIns(...,symbolTable) context-independent programmatic additions/mappings to the symbol table, +// TBuiltIns::identifyBuiltIns(...,symbolTable) context-independent programmatic additions/mappings to the symbol table, // including identifying what extensions are needed if a version does not allow a symbol -// IdentifyBuiltIns(...,symbolTable, resources) context-dependent programmatic additions/mappings to the symbol table, +// TBuiltIns::identifyBuiltIns(...,symbolTable, resources) context-dependent programmatic additions/mappings to the symbol table, // including identifying what extensions are needed if a version does not allow a symbol // @@ -68,6 +68,16 @@ inline bool IncludeLegacy(int version, EProfile profile, int spv) return profile != EEsProfile && (version <= 130 || (spv == 0 && ARBCompatibility) || profile == ECompatibilityProfile); } +// Construct TBuiltInParseables base class. This can be used for language-common constructs. +TBuiltInParseables::TBuiltInParseables() +{ +} + +// Destroy TBuiltInParseables. +TBuiltInParseables::~TBuiltInParseables() +{ +} + TBuiltIns::TBuiltIns() { // Set up textual representations for making all the permutations @@ -75,6 +85,8 @@ TBuiltIns::TBuiltIns() prefixes[EbtFloat] = ""; prefixes[EbtInt] = "i"; prefixes[EbtUint] = "u"; + prefixes[EbtInt64] = "i64"; + prefixes[EbtUint64] = "u64"; postfixes[2] = "2"; postfixes[3] = "3"; postfixes[4] = "4"; @@ -93,6 +105,7 @@ TBuiltIns::~TBuiltIns() { } + // // Add all context-independent built-in functions and variables that are present // for the given version and profile. Share common ones across stages, otherwise @@ -626,6 +639,169 @@ void TBuiltIns::initialize(int version, EProfile profile, int spv, int vulkan) "dmat2 inverse(dmat2);" "dmat3 inverse(dmat3);" "dmat4 inverse(dmat4);" + + "bvec2 lessThan(dvec2, dvec2);" + "bvec3 lessThan(dvec3, dvec3);" + "bvec4 lessThan(dvec4, dvec4);" + + "bvec2 lessThanEqual(dvec2, dvec2);" + "bvec3 lessThanEqual(dvec3, dvec3);" + "bvec4 lessThanEqual(dvec4, dvec4);" + + "bvec2 greaterThan(dvec2, dvec2);" + "bvec3 greaterThan(dvec3, dvec3);" + "bvec4 greaterThan(dvec4, dvec4);" + + "bvec2 greaterThanEqual(dvec2, dvec2);" + "bvec3 greaterThanEqual(dvec3, dvec3);" + "bvec4 greaterThanEqual(dvec4, dvec4);" + + "bvec2 equal(dvec2, dvec2);" + "bvec3 equal(dvec3, dvec3);" + "bvec4 equal(dvec4, dvec4);" + + "bvec2 notEqual(dvec2, dvec2);" + "bvec3 notEqual(dvec3, dvec3);" + "bvec4 notEqual(dvec4, dvec4);" + + "\n"); + } + + if (profile != EEsProfile && version >= 450) { + commonBuiltins.append( + + "int64_t abs(int64_t);" + "i64vec2 abs(i64vec2);" + "i64vec3 abs(i64vec3);" + "i64vec4 abs(i64vec4);" + + "int64_t sign(int64_t);" + "i64vec2 sign(i64vec2);" + "i64vec3 sign(i64vec3);" + "i64vec4 sign(i64vec4);" + + "int64_t min(int64_t, int64_t);" + "i64vec2 min(i64vec2, int64_t);" + "i64vec3 min(i64vec3, int64_t);" + "i64vec4 min(i64vec4, int64_t);" + "i64vec2 min(i64vec2, i64vec2);" + "i64vec3 min(i64vec3, i64vec3);" + "i64vec4 min(i64vec4, i64vec4);" + "uint64_t min(uint64_t, uint64_t);" + "u64vec2 min(u64vec2, uint64_t);" + "u64vec3 min(u64vec3, uint64_t);" + "u64vec4 min(u64vec4, uint64_t);" + "u64vec2 min(u64vec2, u64vec2);" + "u64vec3 min(u64vec3, u64vec3);" + "u64vec4 min(u64vec4, u64vec4);" + + "int64_t max(int64_t, int64_t);" + "i64vec2 max(i64vec2, int64_t);" + "i64vec3 max(i64vec3, int64_t);" + "i64vec4 max(i64vec4, int64_t);" + "i64vec2 max(i64vec2, i64vec2);" + "i64vec3 max(i64vec3, i64vec3);" + "i64vec4 max(i64vec4, i64vec4);" + "uint64_t max(uint64_t, uint64_t);" + "u64vec2 max(u64vec2, uint64_t);" + "u64vec3 max(u64vec3, uint64_t);" + "u64vec4 max(u64vec4, uint64_t);" + "u64vec2 max(u64vec2, u64vec2);" + "u64vec3 max(u64vec3, u64vec3);" + "u64vec4 max(u64vec4, u64vec4);" + + "int64_t clamp(int64_t, int64_t, int64_t);" + "i64vec2 clamp(i64vec2, int64_t, int64_t);" + "i64vec3 clamp(i64vec3, int64_t, int64_t);" + "i64vec4 clamp(i64vec4, int64_t, int64_t);" + "i64vec2 clamp(i64vec2, i64vec2, i64vec2);" + "i64vec3 clamp(i64vec3, i64vec3, i64vec3);" + "i64vec4 clamp(i64vec4, i64vec4, i64vec4);" + "uint64_t clamp(uint64_t, uint64_t, uint64_t);" + "u64vec2 clamp(u64vec2, uint64_t, uint64_t);" + "u64vec3 clamp(u64vec3, uint64_t, uint64_t);" + "u64vec4 clamp(u64vec4, uint64_t, uint64_t);" + "u64vec2 clamp(u64vec2, u64vec2, u64vec2);" + "u64vec3 clamp(u64vec3, u64vec3, u64vec3);" + "u64vec4 clamp(u64vec4, u64vec4, u64vec4);" + + "int64_t mix(int64_t, int64_t, bool);" + "i64vec2 mix(i64vec2, i64vec2, bvec2);" + "i64vec3 mix(i64vec3, i64vec3, bvec3);" + "i64vec4 mix(i64vec4, i64vec4, bvec4);" + "uint64_t mix(uint64_t, uint64_t, bool);" + "u64vec2 mix(u64vec2, u64vec2, bvec2);" + "u64vec3 mix(u64vec3, u64vec3, bvec3);" + "u64vec4 mix(u64vec4, u64vec4, bvec4);" + + "int64_t doubleBitsToInt64(double);" + "i64vec2 doubleBitsToInt64(dvec2);" + "i64vec3 doubleBitsToInt64(dvec3);" + "i64vec4 doubleBitsToInt64(dvec4);" + + "uint64_t doubleBitsToUint64(double);" + "u64vec2 doubleBitsToUint64(dvec2);" + "u64vec3 doubleBitsToUint64(dvec3);" + "u64vec4 doubleBitsToUint64(dvec4);" + + "double int64BitsToDouble(int64_t);" + "dvec2 int64BitsToDouble(i64vec2);" + "dvec3 int64BitsToDouble(i64vec3);" + "dvec4 int64BitsToDouble(i64vec4);" + + "double uint64BitsToDouble(uint64_t);" + "dvec2 uint64BitsToDouble(u64vec2);" + "dvec3 uint64BitsToDouble(u64vec3);" + "dvec4 uint64BitsToDouble(u64vec4);" + + "int64_t packInt2x32(ivec2);" + "uint64_t packUint2x32(uvec2);" + "ivec2 unpackInt2x32(int64_t);" + "uvec2 unpackUint2x32(uint64_t);" + + "bvec2 lessThan(i64vec2, i64vec2);" + "bvec3 lessThan(i64vec3, i64vec3);" + "bvec4 lessThan(i64vec4, i64vec4);" + "bvec2 lessThan(u64vec2, u64vec2);" + "bvec3 lessThan(u64vec3, u64vec3);" + "bvec4 lessThan(u64vec4, u64vec4);" + + "bvec2 lessThanEqual(i64vec2, i64vec2);" + "bvec3 lessThanEqual(i64vec3, i64vec3);" + "bvec4 lessThanEqual(i64vec4, i64vec4);" + "bvec2 lessThanEqual(u64vec2, u64vec2);" + "bvec3 lessThanEqual(u64vec3, u64vec3);" + "bvec4 lessThanEqual(u64vec4, u64vec4);" + + "bvec2 greaterThan(i64vec2, i64vec2);" + "bvec3 greaterThan(i64vec3, i64vec3);" + "bvec4 greaterThan(i64vec4, i64vec4);" + "bvec2 greaterThan(u64vec2, u64vec2);" + "bvec3 greaterThan(u64vec3, u64vec3);" + "bvec4 greaterThan(u64vec4, u64vec4);" + + "bvec2 greaterThanEqual(i64vec2, i64vec2);" + "bvec3 greaterThanEqual(i64vec3, i64vec3);" + "bvec4 greaterThanEqual(i64vec4, i64vec4);" + "bvec2 greaterThanEqual(u64vec2, u64vec2);" + "bvec3 greaterThanEqual(u64vec3, u64vec3);" + "bvec4 greaterThanEqual(u64vec4, u64vec4);" + + "bvec2 equal(i64vec2, i64vec2);" + "bvec3 equal(i64vec3, i64vec3);" + "bvec4 equal(i64vec4, i64vec4);" + "bvec2 equal(u64vec2, u64vec2);" + "bvec3 equal(u64vec3, u64vec3);" + "bvec4 equal(u64vec4, u64vec4);" + + "bvec2 notEqual(i64vec2, i64vec2);" + "bvec3 notEqual(i64vec3, i64vec3);" + "bvec4 notEqual(i64vec4, i64vec4);" + "bvec2 notEqual(u64vec2, u64vec2);" + "bvec3 notEqual(u64vec3, u64vec3);" + "bvec4 notEqual(u64vec4, u64vec4);" + + "\n" ); } @@ -637,16 +813,16 @@ void TBuiltIns::initialize(int version, EProfile profile, int spv, int vulkan) "uint atomicMin(coherent volatile inout uint, uint);" " int atomicMin(coherent volatile inout int, int);" - + "uint atomicMax(coherent volatile inout uint, uint);" " int atomicMax(coherent volatile inout int, int);" - + "uint atomicAnd(coherent volatile inout uint, uint);" " int atomicAnd(coherent volatile inout int, int);" - + "uint atomicOr (coherent volatile inout uint, uint);" " int atomicOr (coherent volatile inout int, int);" - + "uint atomicXor(coherent volatile inout uint, uint);" " int atomicXor(coherent volatile inout int, int);" @@ -1101,26 +1277,6 @@ void TBuiltIns::initialize(int version, EProfile profile, int spv, int vulkan) if ((profile == EEsProfile && version >= 310) || (profile != EEsProfile && version >= 400)) { commonBuiltins.append( - " uint uaddCarry( uint, uint, out uint carry);" - "uvec2 uaddCarry(uvec2, uvec2, out uvec2 carry);" - "uvec3 uaddCarry(uvec3, uvec3, out uvec3 carry);" - "uvec4 uaddCarry(uvec4, uvec4, out uvec4 carry);" - - " uint usubBorrow( uint, uint, out uint borrow);" - "uvec2 usubBorrow(uvec2, uvec2, out uvec2 borrow);" - "uvec3 usubBorrow(uvec3, uvec3, out uvec3 borrow);" - "uvec4 usubBorrow(uvec4, uvec4, out uvec4 borrow);" - - "void umulExtended( uint, uint, out uint, out uint lsb);" - "void umulExtended(uvec2, uvec2, out uvec2, out uvec2 lsb);" - "void umulExtended(uvec3, uvec3, out uvec3, out uvec3 lsb);" - "void umulExtended(uvec4, uvec4, out uvec4, out uvec4 lsb);" - - "void imulExtended( int, int, out int, out int lsb);" - "void imulExtended(ivec2, ivec2, out ivec2, out ivec2 lsb);" - "void imulExtended(ivec3, ivec3, out ivec3, out ivec3 lsb);" - "void imulExtended(ivec4, ivec4, out ivec4, out ivec4 lsb);" - " int bitfieldExtract( int, int, int);" "ivec2 bitfieldExtract(ivec2, int, int);" "ivec3 bitfieldExtract(ivec3, int, int);" @@ -1141,6 +1297,41 @@ void TBuiltIns::initialize(int version, EProfile profile, int spv, int vulkan) "uvec3 bitfieldInsert(uvec3 base, uvec3, int, int);" "uvec4 bitfieldInsert(uvec4 base, uvec4, int, int);" + "lowp int findLSB( int);" + "lowp ivec2 findLSB(ivec2);" + "lowp ivec3 findLSB(ivec3);" + "lowp ivec4 findLSB(ivec4);" + + "lowp int findLSB( uint);" + "lowp ivec2 findLSB(uvec2);" + "lowp ivec3 findLSB(uvec3);" + "lowp ivec4 findLSB(uvec4);" + + "\n"); + } + + if (profile != EEsProfile && version >= 400) { + commonBuiltins.append( + " uint uaddCarry( uint, uint, out uint carry);" + "uvec2 uaddCarry(uvec2, uvec2, out uvec2 carry);" + "uvec3 uaddCarry(uvec3, uvec3, out uvec3 carry);" + "uvec4 uaddCarry(uvec4, uvec4, out uvec4 carry);" + + " uint usubBorrow( uint, uint, out uint borrow);" + "uvec2 usubBorrow(uvec2, uvec2, out uvec2 borrow);" + "uvec3 usubBorrow(uvec3, uvec3, out uvec3 borrow);" + "uvec4 usubBorrow(uvec4, uvec4, out uvec4 borrow);" + + "void umulExtended( uint, uint, out uint, out uint lsb);" + "void umulExtended(uvec2, uvec2, out uvec2, out uvec2 lsb);" + "void umulExtended(uvec3, uvec3, out uvec3, out uvec3 lsb);" + "void umulExtended(uvec4, uvec4, out uvec4, out uvec4 lsb);" + + "void imulExtended( int, int, out int, out int lsb);" + "void imulExtended(ivec2, ivec2, out ivec2, out ivec2 lsb);" + "void imulExtended(ivec3, ivec3, out ivec3, out ivec3 lsb);" + "void imulExtended(ivec4, ivec4, out ivec4, out ivec4 lsb);" + " int bitfieldReverse( int);" "ivec2 bitfieldReverse(ivec2);" "ivec3 bitfieldReverse(ivec3);" @@ -1161,16 +1352,6 @@ void TBuiltIns::initialize(int version, EProfile profile, int spv, int vulkan) "ivec3 bitCount(uvec3);" "ivec4 bitCount(uvec4);" - " int findLSB( int);" - "ivec2 findLSB(ivec2);" - "ivec3 findLSB(ivec3);" - "ivec4 findLSB(ivec4);" - - " int findLSB( uint);" - "ivec2 findLSB(uvec2);" - "ivec3 findLSB(uvec3);" - "ivec4 findLSB(uvec4);" - " int findMSB( int);" "ivec2 findMSB(ivec2);" "ivec3 findMSB(ivec3);" @@ -1180,10 +1361,113 @@ void TBuiltIns::initialize(int version, EProfile profile, int spv, int vulkan) "ivec2 findMSB(uvec2);" "ivec3 findMSB(uvec3);" "ivec4 findMSB(uvec4);" + + "\n"); + } + + if (profile == EEsProfile && version >= 310) { + commonBuiltins.append( + "highp uint uaddCarry(highp uint, highp uint, out lowp uint carry);" + "highp uvec2 uaddCarry(highp uvec2, highp uvec2, out lowp uvec2 carry);" + "highp uvec3 uaddCarry(highp uvec3, highp uvec3, out lowp uvec3 carry);" + "highp uvec4 uaddCarry(highp uvec4, highp uvec4, out lowp uvec4 carry);" + + "highp uint usubBorrow(highp uint, highp uint, out lowp uint borrow);" + "highp uvec2 usubBorrow(highp uvec2, highp uvec2, out lowp uvec2 borrow);" + "highp uvec3 usubBorrow(highp uvec3, highp uvec3, out lowp uvec3 borrow);" + "highp uvec4 usubBorrow(highp uvec4, highp uvec4, out lowp uvec4 borrow);" + + "void umulExtended(highp uint, highp uint, highp out uint, out highp uint lsb);" + "void umulExtended(highp uvec2, highp uvec2, highp out uvec2, out highp uvec2 lsb);" + "void umulExtended(highp uvec3, highp uvec3, highp out uvec3, out highp uvec3 lsb);" + "void umulExtended(highp uvec4, highp uvec4, highp out uvec4, out highp uvec4 lsb);" + + "void imulExtended(highp int, highp int, highp out int, out highp int lsb);" + "void imulExtended(highp ivec2, highp ivec2, highp out ivec2, out highp ivec2 lsb);" + "void imulExtended(highp ivec3, highp ivec3, highp out ivec3, out highp ivec3 lsb);" + "void imulExtended(highp ivec4, highp ivec4, highp out ivec4, out highp ivec4 lsb);" + + "highp int bitfieldReverse(highp int);" + "highp ivec2 bitfieldReverse(highp ivec2);" + "highp ivec3 bitfieldReverse(highp ivec3);" + "highp ivec4 bitfieldReverse(highp ivec4);" + + "highp uint bitfieldReverse(highp uint);" + "highp uvec2 bitfieldReverse(highp uvec2);" + "highp uvec3 bitfieldReverse(highp uvec3);" + "highp uvec4 bitfieldReverse(highp uvec4);" + + "lowp int bitCount( int);" + "lowp ivec2 bitCount(ivec2);" + "lowp ivec3 bitCount(ivec3);" + "lowp ivec4 bitCount(ivec4);" + + "lowp int bitCount( uint);" + "lowp ivec2 bitCount(uvec2);" + "lowp ivec3 bitCount(uvec3);" + "lowp ivec4 bitCount(uvec4);" + + "lowp int findMSB(highp int);" + "lowp ivec2 findMSB(highp ivec2);" + "lowp ivec3 findMSB(highp ivec3);" + "lowp ivec4 findMSB(highp ivec4);" + + "lowp int findMSB(highp uint);" + "lowp ivec2 findMSB(highp uvec2);" + "lowp ivec3 findMSB(highp uvec3);" + "lowp ivec4 findMSB(highp uvec4);" "\n"); } + // GL_ARB_shader_ballot + if (profile != EEsProfile && version >= 450) { + commonBuiltins.append( + "uint64_t ballotARB(bool);" + + "float readInvocationARB(float, uint);" + "vec2 readInvocationARB(vec2, uint);" + "vec3 readInvocationARB(vec3, uint);" + "vec4 readInvocationARB(vec4, uint);" + + "int readInvocationARB(int, uint);" + "ivec2 readInvocationARB(ivec2, uint);" + "ivec3 readInvocationARB(ivec3, uint);" + "ivec4 readInvocationARB(ivec4, uint);" + + "uint readInvocationARB(uint, uint);" + "uvec2 readInvocationARB(uvec2, uint);" + "uvec3 readInvocationARB(uvec3, uint);" + "uvec4 readInvocationARB(uvec4, uint);" + + "float readFirstInvocationARB(float);" + "vec2 readFirstInvocationARB(vec2);" + "vec3 readFirstInvocationARB(vec3);" + "vec4 readFirstInvocationARB(vec4);" + + "int readFirstInvocationARB(int);" + "ivec2 readFirstInvocationARB(ivec2);" + "ivec3 readFirstInvocationARB(ivec3);" + "ivec4 readFirstInvocationARB(ivec4);" + + "uint readFirstInvocationARB(uint);" + "uvec2 readFirstInvocationARB(uvec2);" + "uvec3 readFirstInvocationARB(uvec3);" + "uvec4 readFirstInvocationARB(uvec4);" + + "\n"); + } + + // GL_ARB_shader_group_vote + if (profile != EEsProfile && version >= 430) { + commonBuiltins.append( + "bool anyInvocationARB(bool);" + "bool allInvocationsARB(bool);" + "bool allInvocationsEqualARB(bool);" + + "\n"); + } + //============================================================================ // // Prototypes for built-in functions seen by vertex shaders only. @@ -1288,7 +1572,7 @@ void TBuiltIns::initialize(int version, EProfile profile, int spv, int vulkan) stageBuiltins[EShLangTessControl].append( "void barrier();" ); - if ((profile != EEsProfile && version >= 430) || esBarrier) + if ((profile != EEsProfile && version >= 420) || esBarrier) stageBuiltins[EShLangCompute].append( "void barrier();" ); @@ -1296,7 +1580,7 @@ void TBuiltIns::initialize(int version, EProfile profile, int spv, int vulkan) commonBuiltins.append( "void memoryBarrier();" ); - if ((profile != EEsProfile && version >= 430) || esBarrier) { + if ((profile != EEsProfile && version >= 420) || esBarrier) { commonBuiltins.append( "void memoryBarrierAtomicCounter();" "void memoryBarrierBuffer();" @@ -1587,17 +1871,17 @@ void TBuiltIns::initialize(int version, EProfile profile, int spv, int vulkan) // //============================================================================ - if ((profile != EEsProfile && version >= 430) || + if ((profile != EEsProfile && version >= 420) || (profile == EEsProfile && version >= 310)) { stageBuiltins[EShLangCompute].append( - "in uvec3 gl_NumWorkGroups;" - "const uvec3 gl_WorkGroupSize = uvec3(1,1,1);" + "in highp uvec3 gl_NumWorkGroups;" + "const highp uvec3 gl_WorkGroupSize = uvec3(1,1,1);" - "in uvec3 gl_WorkGroupID;" - "in uvec3 gl_LocalInvocationID;" + "in highp uvec3 gl_WorkGroupID;" + "in highp uvec3 gl_LocalInvocationID;" - "in uvec3 gl_GlobalInvocationID;" - "in uint gl_LocalInvocationIndex;" + "in highp uvec3 gl_GlobalInvocationID;" + "in highp uint gl_LocalInvocationIndex;" "\n"); } @@ -1708,7 +1992,7 @@ void TBuiltIns::initialize(int version, EProfile profile, int spv, int vulkan) stageBuiltins[EShLangVertex].append( "int gl_InstanceID;" // needs qualifier fixed later ); - if (spv > 0 && version >= 140) + if (vulkan > 0 && version >= 140) stageBuiltins[EShLangVertex].append( "in int gl_VertexIndex;" "in int gl_InstanceIndex;" @@ -1733,7 +2017,7 @@ void TBuiltIns::initialize(int version, EProfile profile, int spv, int vulkan) "in highp int gl_VertexID;" // needs qualifier fixed later "in highp int gl_InstanceID;" // needs qualifier fixed later ); - if (spv > 0) + if (vulkan > 0) stageBuiltins[EShLangVertex].append( "in highp int gl_VertexIndex;" "in highp int gl_InstanceIndex;" @@ -1835,12 +2119,12 @@ void TBuiltIns::initialize(int version, EProfile profile, int spv, int vulkan) "in highp int gl_InvocationID;" "\n" "out gl_PerVertex {" - "vec4 gl_Position;" - "float gl_PointSize;" + "highp vec4 gl_Position;" + "highp float gl_PointSize;" "};" "\n" - "out int gl_PrimitiveID;" - "out int gl_Layer;" + "out highp int gl_PrimitiveID;" + "out highp int gl_Layer;" "\n" ); } @@ -1961,8 +2245,8 @@ void TBuiltIns::initialize(int version, EProfile profile, int spv, int vulkan) "patch in highp float gl_TessLevelInner[2];" "out gl_PerVertex {" - "vec4 gl_Position;" - "float gl_PointSize;" + "highp vec4 gl_Position;" + "highp float gl_PointSize;" ); stageBuiltins[EShLangTessEvaluation].append( "};" @@ -2091,6 +2375,21 @@ void TBuiltIns::initialize(int version, EProfile profile, int spv, int vulkan) if (version >= 130) add2ndGenerationSamplingImaging(version, profile, spv, vulkan); + // GL_ARB_shader_ballot + if (profile != EEsProfile && version >= 450) { + commonBuiltins.append( + "uniform uint gl_SubGroupSizeARB;" + + "in uint gl_SubGroupInvocationARB;" + "in uint64_t gl_SubGroupEqMaskARB;" + "in uint64_t gl_SubGroupGeMaskARB;" + "in uint64_t gl_SubGroupGtMaskARB;" + "in uint64_t gl_SubGroupLeMaskARB;" + "in uint64_t gl_SubGroupLtMaskARB;" + + "\n"); + } + //printf("%s\n", commonBuiltins.c_str()); //printf("%s\n", stageBuiltins[EShLangFragment].c_str()); } @@ -2303,6 +2602,8 @@ void TBuiltIns::addImageFunctions(TSampler sampler, TString& typeName, int versi if (sampler.ms) imageParams.append(", int"); + if (profile == EEsProfile) + commonBuiltins.append("highp "); commonBuiltins.append(prefixes[sampler.type]); commonBuiltins.append("vec4 imageLoad(readonly volatile coherent "); commonBuiltins.append(imageParams); @@ -2326,7 +2627,7 @@ void TBuiltIns::addImageFunctions(TSampler sampler, TString& typeName, int versi if ( profile != EEsProfile || (profile == EEsProfile && version >= 310)) { if (sampler.type == EbtInt || sampler.type == EbtUint) { - const char* dataType = sampler.type == EbtInt ? "int" : "uint"; + const char* dataType = sampler.type == EbtInt ? "highp int" : "highp uint"; const int numBuiltins = 7; @@ -3120,7 +3421,7 @@ void TBuiltIns::initialize(const TBuiltInResource &resources, int version, EProf // compute - if ((profile == EEsProfile && version >= 310) || (profile != EEsProfile && version >= 430)) { + if ((profile == EEsProfile && version >= 310) || (profile != EEsProfile && version >= 420)) { snprintf(builtInConstant, maxSize, "const ivec3 gl_MaxComputeWorkGroupCount = ivec3(%d,%d,%d);", resources.maxComputeWorkGroupCountX, resources.maxComputeWorkGroupCountY, resources.maxComputeWorkGroupCountZ); @@ -3235,7 +3536,7 @@ static void BuiltInVariable(const char* blockName, const char* name, TBuiltInVar // 3) Tag extension-related symbols added to their base version with their extensions, so // that if an early version has the extension turned off, there is an error reported on use. // -void IdentifyBuiltIns(int version, EProfile profile, int spv, int vulkan, EShLanguage language, TSymbolTable& symbolTable) +void TBuiltIns::identifyBuiltIns(int version, EProfile profile, int spv, int vulkan, EShLanguage language, TSymbolTable& symbolTable) { // // Tag built-in variables and functions with additional qualifier and extension information @@ -3251,7 +3552,7 @@ void IdentifyBuiltIns(int version, EProfile profile, int spv, int vulkan, EShLan switch(language) { case EShLangVertex: - if (profile != EEsProfile && version >= 440) { + if (profile != EEsProfile) { symbolTable.setVariableExtensions("gl_BaseVertexARB", 1, &E_GL_ARB_shader_draw_parameters); symbolTable.setVariableExtensions("gl_BaseInstanceARB", 1, &E_GL_ARB_shader_draw_parameters); symbolTable.setVariableExtensions("gl_DrawIDARB", 1, &E_GL_ARB_shader_draw_parameters); @@ -3261,6 +3562,32 @@ void IdentifyBuiltIns(int version, EProfile profile, int spv, int vulkan, EShLan BuiltInVariable("gl_DrawIDARB", EbvDrawId, symbolTable); } + if (profile != EEsProfile) { + symbolTable.setVariableExtensions("gl_SubGroupSizeARB", 1, &E_GL_ARB_shader_ballot); + symbolTable.setVariableExtensions("gl_SubGroupInvocationARB", 1, &E_GL_ARB_shader_ballot); + symbolTable.setVariableExtensions("gl_SubGroupEqMaskARB", 1, &E_GL_ARB_shader_ballot); + symbolTable.setVariableExtensions("gl_SubGroupGeMaskARB", 1, &E_GL_ARB_shader_ballot); + symbolTable.setVariableExtensions("gl_SubGroupGtMaskARB", 1, &E_GL_ARB_shader_ballot); + symbolTable.setVariableExtensions("gl_SubGroupLeMaskARB", 1, &E_GL_ARB_shader_ballot); + symbolTable.setVariableExtensions("gl_SubGroupLtMaskARB", 1, &E_GL_ARB_shader_ballot); + + symbolTable.setFunctionExtensions("ballotARB", 1, &E_GL_ARB_shader_ballot); + symbolTable.setFunctionExtensions("readInvocationARB", 1, &E_GL_ARB_shader_ballot); + symbolTable.setFunctionExtensions("readFirstInvocationARB", 1, &E_GL_ARB_shader_ballot); + + BuiltInVariable("gl_SubGroupSizeARB", EbvSubGroupSize, symbolTable); + BuiltInVariable("gl_SubGroupInvocationARB", EbvSubGroupInvocation, symbolTable); + BuiltInVariable("gl_SubGroupEqMaskARB", EbvSubGroupEqMask, symbolTable); + BuiltInVariable("gl_SubGroupGeMaskARB", EbvSubGroupGeMask, symbolTable); + BuiltInVariable("gl_SubGroupGtMaskARB", EbvSubGroupGtMask, symbolTable); + BuiltInVariable("gl_SubGroupLeMaskARB", EbvSubGroupLeMask, symbolTable); + BuiltInVariable("gl_SubGroupLtMaskARB", EbvSubGroupLtMask, symbolTable); + + symbolTable.setFunctionExtensions("anyInvocationARB", 1, &E_GL_ARB_shader_group_vote); + symbolTable.setFunctionExtensions("allInvocationsARB", 1, &E_GL_ARB_shader_group_vote); + symbolTable.setFunctionExtensions("allInvocationsEqualARB", 1, &E_GL_ARB_shader_group_vote); + } + // Compatibility variables, vertex only if (spv == 0) { BuiltInVariable("gl_Color", EbvColor, symbolTable); @@ -3569,6 +3896,30 @@ void IdentifyBuiltIns(int version, EProfile profile, int spv, int vulkan, EShLan BuiltInVariable("gl_LocalInvocationID", EbvLocalInvocationId, symbolTable); BuiltInVariable("gl_GlobalInvocationID", EbvGlobalInvocationId, symbolTable); BuiltInVariable("gl_LocalInvocationIndex", EbvLocalInvocationIndex, symbolTable); + + if (profile != EEsProfile && version < 430) { + symbolTable.setVariableExtensions("gl_NumWorkGroups", 1, &E_GL_ARB_compute_shader); + symbolTable.setVariableExtensions("gl_WorkGroupSize", 1, &E_GL_ARB_compute_shader); + symbolTable.setVariableExtensions("gl_WorkGroupID", 1, &E_GL_ARB_compute_shader); + symbolTable.setVariableExtensions("gl_LocalInvocationID", 1, &E_GL_ARB_compute_shader); + symbolTable.setVariableExtensions("gl_GlobalInvocationID", 1, &E_GL_ARB_compute_shader); + symbolTable.setVariableExtensions("gl_LocalInvocationIndex", 1, &E_GL_ARB_compute_shader); + + symbolTable.setVariableExtensions("gl_MaxComputeWorkGroupCount", 1, &E_GL_ARB_compute_shader); + symbolTable.setVariableExtensions("gl_MaxComputeWorkGroupSize", 1, &E_GL_ARB_compute_shader); + symbolTable.setVariableExtensions("gl_MaxComputeUniformComponents", 1, &E_GL_ARB_compute_shader); + symbolTable.setVariableExtensions("gl_MaxComputeTextureImageUnits", 1, &E_GL_ARB_compute_shader); + symbolTable.setVariableExtensions("gl_MaxComputeImageUniforms", 1, &E_GL_ARB_compute_shader); + symbolTable.setVariableExtensions("gl_MaxComputeAtomicCounters", 1, &E_GL_ARB_compute_shader); + symbolTable.setVariableExtensions("gl_MaxComputeAtomicCounterBuffers", 1, &E_GL_ARB_compute_shader); + + symbolTable.setFunctionExtensions("barrier", 1, &E_GL_ARB_compute_shader); + symbolTable.setFunctionExtensions("memoryBarrierAtomicCounter", 1, &E_GL_ARB_compute_shader); + symbolTable.setFunctionExtensions("memoryBarrierBuffer", 1, &E_GL_ARB_compute_shader); + symbolTable.setFunctionExtensions("memoryBarrierImage", 1, &E_GL_ARB_compute_shader); + symbolTable.setFunctionExtensions("memoryBarrierShared", 1, &E_GL_ARB_compute_shader); + symbolTable.setFunctionExtensions("groupMemoryBarrier", 1, &E_GL_ARB_compute_shader); + } break; default: @@ -3650,6 +4001,10 @@ void IdentifyBuiltIns(int version, EProfile profile, int spv, int vulkan, EShLan symbolTable.relateToOperator("floatBitsToUint", EOpFloatBitsToUint); symbolTable.relateToOperator("intBitsToFloat", EOpIntBitsToFloat); symbolTable.relateToOperator("uintBitsToFloat", EOpUintBitsToFloat); + symbolTable.relateToOperator("doubleBitsToInt64", EOpDoubleBitsToInt64); + symbolTable.relateToOperator("doubleBitsToUint64", EOpDoubleBitsToUint64); + symbolTable.relateToOperator("int64BitsToDouble", EOpInt64BitsToDouble); + symbolTable.relateToOperator("uint64BitsToDouble", EOpUint64BitsToDouble); symbolTable.relateToOperator("packSnorm2x16", EOpPackSnorm2x16); symbolTable.relateToOperator("unpackSnorm2x16", EOpUnpackSnorm2x16); @@ -3667,6 +4022,11 @@ void IdentifyBuiltIns(int version, EProfile profile, int spv, int vulkan, EShLan symbolTable.relateToOperator("packHalf2x16", EOpPackHalf2x16); symbolTable.relateToOperator("unpackHalf2x16", EOpUnpackHalf2x16); + symbolTable.relateToOperator("packInt2x32", EOpPackInt2x32); + symbolTable.relateToOperator("unpackInt2x32", EOpUnpackInt2x32); + symbolTable.relateToOperator("packUint2x32", EOpPackUint2x32); + symbolTable.relateToOperator("unpackUint2x32", EOpUnpackUint2x32); + symbolTable.relateToOperator("length", EOpLength); symbolTable.relateToOperator("distance", EOpDistance); symbolTable.relateToOperator("dot", EOpDot); @@ -3811,8 +4171,7 @@ void IdentifyBuiltIns(int version, EProfile profile, int spv, int vulkan, EShLan symbolTable.relateToOperator("shadow2DProjLod", EOpTextureProjLod); } - if (profile != EEsProfile) - { + if (profile != EEsProfile) { symbolTable.relateToOperator("sparseTextureARB", EOpSparseTexture); symbolTable.relateToOperator("sparseTextureLodARB", EOpSparseTextureLod); symbolTable.relateToOperator("sparseTextureOffsetARB", EOpSparseTextureOffset); @@ -3835,6 +4194,14 @@ void IdentifyBuiltIns(int version, EProfile profile, int spv, int vulkan, EShLan symbolTable.relateToOperator("textureOffsetClampARB", EOpTextureOffsetClamp); symbolTable.relateToOperator("textureGradClampARB", EOpTextureGradClamp); symbolTable.relateToOperator("textureGradOffsetClampARB", EOpTextureGradOffsetClamp); + + symbolTable.relateToOperator("ballotARB", EOpBallot); + symbolTable.relateToOperator("readInvocationARB", EOpReadInvocation); + symbolTable.relateToOperator("readFirstInvocationARB", EOpReadFirstInvocation); + + symbolTable.relateToOperator("anyInvocationARB", EOpAnyInvocation); + symbolTable.relateToOperator("allInvocationsARB", EOpAllInvocations); + symbolTable.relateToOperator("allInvocationsEqualARB", EOpAllInvocationsEqual); } } @@ -3871,8 +4238,8 @@ void IdentifyBuiltIns(int version, EProfile profile, int spv, int vulkan, EShLan break; case EShLangCompute: - symbolTable.relateToOperator("memoryBarrierShared", EOpMemoryBarrierShared); - symbolTable.relateToOperator("groupMemoryBarrier", EOpGroupMemoryBarrier); + symbolTable.relateToOperator("memoryBarrierShared", EOpMemoryBarrierShared); + symbolTable.relateToOperator("groupMemoryBarrier", EOpGroupMemoryBarrier); break; default: @@ -3889,7 +4256,7 @@ void IdentifyBuiltIns(int version, EProfile profile, int spv, int vulkan, EShLan // 2) Tag extension-related symbols added to their base version with their extensions, so // that if an early version has the extension turned off, there is an error reported on use. // -void IdentifyBuiltIns(int version, EProfile profile, int spv, int /*vulkan*/, EShLanguage language, TSymbolTable& symbolTable, const TBuiltInResource &resources) +void TBuiltIns::identifyBuiltIns(int version, EProfile profile, int spv, int /*vulkan*/, EShLanguage language, TSymbolTable& symbolTable, const TBuiltInResource &resources) { if (profile != EEsProfile && version >= 430 && version < 440) { symbolTable.setVariableExtensions("gl_MaxTransformFeedbackBuffers", 1, &E_GL_ARB_enhanced_layouts); diff --git a/glslang/MachineIndependent/Initialize.h b/glslang/MachineIndependent/Initialize.h index ab21a2f9..40551cdd 100644 --- a/glslang/MachineIndependent/Initialize.h +++ b/glslang/MachineIndependent/Initialize.h @@ -1,6 +1,6 @@ // //Copyright (C) 2002-2005 3Dlabs Inc. Ltd. -//Copyright (C) 2013 LunarG, Inc. +//Copyright (C) 2013-2016 LunarG, Inc. // //All rights reserved. // @@ -49,20 +49,48 @@ namespace glslang { // This is made to hold parseable strings for almost all the built-in // functions and variables for one specific combination of version // and profile. (Some still need to be added programmatically.) +// This is a base class for language-specific derivations, which +// can be used for language independent builtins. // // The strings are organized by // commonBuiltins: intersection of all stages' built-ins, processed just once // stageBuiltins[]: anything a stage needs that's not in commonBuiltins // -class TBuiltIns { +class TBuiltInParseables { +public: + POOL_ALLOCATOR_NEW_DELETE(GetThreadPoolAllocator()) + TBuiltInParseables(); + virtual ~TBuiltInParseables(); + virtual void initialize(int version, EProfile, int spv, int vulkan) = 0; + virtual void initialize(const TBuiltInResource& resources, int version, EProfile, int spv, int vulkan, EShLanguage) = 0; + virtual const TString& getCommonString() const { return commonBuiltins; } + virtual const TString& getStageString(EShLanguage language) const { return stageBuiltins[language]; } + + virtual void identifyBuiltIns(int version, EProfile profile, int spv, int vulkan, EShLanguage language, TSymbolTable& symbolTable) = 0; + + virtual void identifyBuiltIns(int version, EProfile profile, int spv, int /*vulkan*/, EShLanguage language, TSymbolTable& symbolTable, const TBuiltInResource &resources) = 0; + +protected: + TString commonBuiltins; + TString stageBuiltins[EShLangCount]; +}; + +// +// This is a GLSL specific derivation of TBuiltInParseables. To present a stable +// interface and match other similar code, it is called TBuiltIns, rather +// than TBuiltInParseablesGlsl. +// +class TBuiltIns : public TBuiltInParseables { public: POOL_ALLOCATOR_NEW_DELETE(GetThreadPoolAllocator()) TBuiltIns(); virtual ~TBuiltIns(); void initialize(int version, EProfile, int spv, int vulkan); void initialize(const TBuiltInResource& resources, int version, EProfile, int spv, int vulkan, EShLanguage); - const TString& getCommonString() const { return commonBuiltins; } - const TString& getStageString(EShLanguage language) const { return stageBuiltins[language]; } + + void identifyBuiltIns(int version, EProfile profile, int spv, int vulkan, EShLanguage language, TSymbolTable& symbolTable); + + void identifyBuiltIns(int version, EProfile profile, int spv, int /*vulkan*/, EShLanguage language, TSymbolTable& symbolTable, const TBuiltInResource &resources); protected: void add2ndGenerationSamplingImaging(int version, EProfile profile, int spv, int vulkan); @@ -72,9 +100,6 @@ protected: void addSamplingFunctions(TSampler, TString& typeName, int version, EProfile profile); void addGatherFunctions(TSampler, TString& typeName, int version, EProfile profile); - TString commonBuiltins; - TString stageBuiltins[EShLangCount]; - // Helpers for making textual representations of the permutations // of texturing/imaging functions. const char* postfixes[5]; @@ -82,8 +107,6 @@ protected: int dimMap[EsdNumDims]; }; -void IdentifyBuiltIns(int version, EProfile profile, int spv, int vulkan, EShLanguage, TSymbolTable&); -void IdentifyBuiltIns(int version, EProfile profile, int spv, int vulkan, EShLanguage, TSymbolTable&, const TBuiltInResource &resources); } // end namespace glslang diff --git a/glslang/MachineIndependent/IntermTraverse.cpp b/glslang/MachineIndependent/IntermTraverse.cpp index 44743eaf..b910f473 100644 --- a/glslang/MachineIndependent/IntermTraverse.cpp +++ b/glslang/MachineIndependent/IntermTraverse.cpp @@ -115,7 +115,7 @@ void TIntermBinary::traverse(TIntermTraverser *it) // // Visit the node after the children, if requested and the traversal - // hasn't been cancelled yet. + // hasn't been canceled yet. // if (visit && it->postVisit) it->visitBinary(EvPostVisit, this); diff --git a/glslang/MachineIndependent/Intermediate.cpp b/glslang/MachineIndependent/Intermediate.cpp index 777de2d6..02681ac5 100644 --- a/glslang/MachineIndependent/Intermediate.cpp +++ b/glslang/MachineIndependent/Intermediate.cpp @@ -42,6 +42,7 @@ #include "localintermediate.h" #include "RemoveTree.h" #include "SymbolTable.h" +#include "propagateNoContraction.h" #include @@ -145,10 +146,12 @@ TIntermTyped* TIntermediate::addBinaryMath(TOperator op, TIntermTyped* left, TIn // If either is a specialization constant, while the other is // a constant (or specialization constant), the result is still - // a specialization constant. + // a specialization constant, if the operation is an allowed + // specialization-constant operation. if (( left->getType().getQualifier().isSpecConstant() && right->getType().getQualifier().isConstant()) || (right->getType().getQualifier().isSpecConstant() && left->getType().getQualifier().isConstant())) - node->getWritableType().getQualifier().makeSpecConstant(); + if (isSpecializationOperation(*node)) + node->getWritableType().getQualifier().makeSpecConstant(); return node; } @@ -245,6 +248,8 @@ TIntermTyped* TIntermediate::addUnaryMath(TOperator op, TIntermTyped* child, TSo switch (op) { case EOpConstructInt: newType = EbtInt; break; case EOpConstructUint: newType = EbtUint; break; + case EOpConstructInt64: newType = EbtInt64; break; + case EOpConstructUint64: newType = EbtUint64; break; case EOpConstructBool: newType = EbtBool; break; case EOpConstructFloat: newType = EbtFloat; break; case EOpConstructDouble: newType = EbtDouble; break; @@ -267,6 +272,8 @@ TIntermTyped* TIntermediate::addUnaryMath(TOperator op, TIntermTyped* child, TSo switch (op) { case EOpConstructInt: case EOpConstructUint: + case EOpConstructInt64: + case EOpConstructUint64: case EOpConstructBool: case EOpConstructFloat: case EOpConstructDouble: @@ -292,8 +299,9 @@ TIntermTyped* TIntermediate::addUnaryMath(TOperator op, TIntermTyped* child, TSo if (child->getAsConstantUnion()) return child->getAsConstantUnion()->fold(op, node->getType()); - // If it's a specialization constant, the result is too. - if (child->getType().getQualifier().isSpecConstant()) + // If it's a specialization constant, the result is too, + // if the operation is allowed for specialization constants. + if (child->getType().getQualifier().isSpecConstant() && isSpecializationOperation(*node)) node->getWritableType().getQualifier().makeSpecConstant(); return node; @@ -469,6 +477,12 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt case EOpConstructUint: promoteTo = EbtUint; break; + case EOpConstructInt64: + promoteTo = EbtInt64; + break; + case EOpConstructUint64: + promoteTo = EbtUint64; + break; // // List all the binary ops that can implicitly convert one operand to the other's type; @@ -495,6 +509,9 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt case EOpAnd: case EOpInclusiveOr: case EOpExclusiveOr: + case EOpAndAssign: + case EOpInclusiveOrAssign: + case EOpExclusiveOrAssign: case EOpFunctionCall: case EOpReturn: @@ -528,9 +545,13 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt case EOpLeftShiftAssign: case EOpRightShiftAssign: if ((type.getBasicType() == EbtInt || - type.getBasicType() == EbtUint) && + type.getBasicType() == EbtUint || + type.getBasicType() == EbtInt64 || + type.getBasicType() == EbtUint64) && (node->getType().getBasicType() == EbtInt || - node->getType().getBasicType() == EbtUint)) + node->getType().getBasicType() == EbtUint || + node->getType().getBasicType() == EbtInt64 || + node->getType().getBasicType() == EbtUint64)) return node; else @@ -564,6 +585,8 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt case EbtUint: newOp = EOpConvUintToDouble; break; case EbtBool: newOp = EOpConvBoolToDouble; break; case EbtFloat: newOp = EOpConvFloatToDouble; break; + case EbtInt64: newOp = EOpConvInt64ToDouble; break; + case EbtUint64: newOp = EOpConvUint64ToDouble; break; default: return 0; } @@ -574,6 +597,8 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt case EbtUint: newOp = EOpConvUintToFloat; break; case EbtBool: newOp = EOpConvBoolToFloat; break; case EbtDouble: newOp = EOpConvDoubleToFloat; break; + case EbtInt64: newOp = EOpConvInt64ToFloat; break; + case EbtUint64: newOp = EOpConvUint64ToFloat; break; default: return 0; } @@ -584,6 +609,8 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt case EbtUint: newOp = EOpConvUintToBool; break; case EbtFloat: newOp = EOpConvFloatToBool; break; case EbtDouble: newOp = EOpConvDoubleToBool; break; + case EbtInt64: newOp = EOpConvInt64ToBool; break; + case EbtUint64: newOp = EOpConvUint64ToBool; break; default: return 0; } @@ -594,6 +621,8 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt case EbtBool: newOp = EOpConvBoolToInt; break; case EbtFloat: newOp = EOpConvFloatToInt; break; case EbtDouble: newOp = EOpConvDoubleToInt; break; + case EbtInt64: newOp = EOpConvInt64ToInt; break; + case EbtUint64: newOp = EOpConvUint64ToInt; break; default: return 0; } @@ -604,6 +633,32 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt case EbtBool: newOp = EOpConvBoolToUint; break; case EbtFloat: newOp = EOpConvFloatToUint; break; case EbtDouble: newOp = EOpConvDoubleToUint; break; + case EbtInt64: newOp = EOpConvInt64ToUint; break; + case EbtUint64: newOp = EOpConvUint64ToUint; break; + default: + return 0; + } + break; + case EbtInt64: + switch (node->getBasicType()) { + case EbtInt: newOp = EOpConvIntToInt64; break; + case EbtUint: newOp = EOpConvUintToInt64; break; + case EbtBool: newOp = EOpConvBoolToInt64; break; + case EbtFloat: newOp = EOpConvFloatToInt64; break; + case EbtDouble: newOp = EOpConvDoubleToInt64; break; + case EbtUint64: newOp = EOpConvUint64ToInt64; break; + default: + return 0; + } + break; + case EbtUint64: + switch (node->getBasicType()) { + case EbtInt: newOp = EOpConvIntToUint64; break; + case EbtUint: newOp = EOpConvUintToUint64; break; + case EbtBool: newOp = EOpConvBoolToUint64; break; + case EbtFloat: newOp = EOpConvFloatToUint64; break; + case EbtDouble: newOp = EOpConvDoubleToUint64; break; + case EbtInt64: newOp = EOpConvInt64ToUint64; break; default: return 0; } @@ -619,8 +674,8 @@ TIntermTyped* TIntermediate::addConversion(TOperator op, const TType& type, TInt // TODO: it seems that some unary folding operations should occur here, but are not - // Propagate specialization-constant-ness. - if (node->getType().getQualifier().isSpecConstant()) + // Propagate specialization-constant-ness, if allowed + if (node->getType().getQualifier().isSpecConstant() && isSpecializationOperation(*newNode)) newNode->getWritableType().getQualifier().makeSpecConstant(); return newNode; @@ -640,6 +695,8 @@ bool TIntermediate::canImplicitlyPromote(TBasicType from, TBasicType to) const switch (from) { case EbtInt: case EbtUint: + case EbtInt64: + case EbtUint64: case EbtFloat: case EbtDouble: return true; @@ -671,6 +728,24 @@ bool TIntermediate::canImplicitlyPromote(TBasicType from, TBasicType to) const default: return false; } + case EbtUint64: + switch (from) { + case EbtInt: + case EbtUint: + case EbtInt64: + case EbtUint64: + return true; + default: + return false; + } + case EbtInt64: + switch (from) { + case EbtInt: + case EbtInt64: + return true; + default: + return false; + } default: return false; } @@ -847,6 +922,7 @@ TIntermTyped* TIntermediate::addSelection(TIntermTyped* cond, TIntermTyped* true TIntermConstantUnion* TIntermediate::addConstantUnion(const TConstUnionArray& unionArray, const TType& t, const TSourceLoc& loc, bool literal) const { TIntermConstantUnion* node = new TIntermConstantUnion(unionArray, t); + node->getQualifier().storage = EvqConst; node->setLoc(loc); if (literal) node->setLiteral(); @@ -870,6 +946,22 @@ TIntermConstantUnion* TIntermediate::addConstantUnion(unsigned int u, const TSou return addConstantUnion(unionArray, TType(EbtUint, EvqConst), loc, literal); } +TIntermConstantUnion* TIntermediate::addConstantUnion(long long i64, const TSourceLoc& loc, bool literal) const +{ + TConstUnionArray unionArray(1); + unionArray[0].setI64Const(i64); + + return addConstantUnion(unionArray, TType(EbtInt64, EvqConst), loc, literal); +} + +TIntermConstantUnion* TIntermediate::addConstantUnion(unsigned long long u64, const TSourceLoc& loc, bool literal) const +{ + TConstUnionArray unionArray(1); + unionArray[0].setU64Const(u64); + + return addConstantUnion(unionArray, TType(EbtUint64, EvqConst), loc, literal); +} + TIntermConstantUnion* TIntermediate::addConstantUnion(bool b, const TSourceLoc& loc, bool literal) const { TConstUnionArray unionArray(1); @@ -936,7 +1028,7 @@ const TIntermTyped* TIntermediate::findLValueBase(const TIntermTyped* node, bool } // -// Create loop nodes. +// Create while and do-while loop nodes. // TIntermLoop* TIntermediate::addLoop(TIntermNode* body, TIntermTyped* test, TIntermTyped* terminal, bool testFirst, const TSourceLoc& loc) { @@ -946,6 +1038,22 @@ TIntermLoop* TIntermediate::addLoop(TIntermNode* body, TIntermTyped* test, TInte return node; } +// +// Create a for-loop sequence. +// +TIntermAggregate* TIntermediate::addForLoop(TIntermNode* body, TIntermNode* initializer, TIntermTyped* test, TIntermTyped* terminal, bool testFirst, const TSourceLoc& loc) +{ + TIntermLoop* node = new TIntermLoop(body, test, terminal, testFirst); + node->setLoc(loc); + + // make a sequence of the initializer and statement + TIntermAggregate* loopSequence = makeAggregate(initializer, loc); + loopSequence = growAggregate(loopSequence, node); + loopSequence->setOperator(EOpSequence); + + return loopSequence; +} + // // Add branches. // @@ -976,6 +1084,9 @@ bool TIntermediate::postProcess(TIntermNode* root, EShLanguage /*language*/) if (aggRoot && aggRoot->getOp() == EOpNull) aggRoot->setOperator(EOpSequence); + // Propagate 'noContraction' label in backward from 'precise' variables. + glslang::PropagateNoContraction(*this); + return true; } @@ -1065,6 +1176,118 @@ void TIntermediate::removeTree() RemoveAllTreeNodes(treeRoot); } +// +// Implement the part of KHR_vulkan_glsl that lists the set of operations +// that can result in a specialization constant operation. +// +// "5.x Specialization Constant Operations" +// +// Only some operations discussed in this section may be applied to a +// specialization constant and still yield a result that is as +// specialization constant. The operations allowed are listed below. +// When a specialization constant is operated on with one of these +// operators and with another constant or specialization constant, the +// result is implicitly a specialization constant. +// +// - int(), uint(), and bool() constructors for type conversions +// from any of the following types to any of the following types: +// * int +// * uint +// * bool +// - vector versions of the above conversion constructors +// - allowed implicit conversions of the above +// - swizzles (e.g., foo.yx) +// - The following when applied to integer or unsigned integer types: +// * unary negative ( - ) +// * binary operations ( + , - , * , / , % ) +// * shift ( <<, >> ) +// * bitwise operations ( & , | , ^ ) +// - The following when applied to integer or unsigned integer scalar types: +// * comparison ( == , != , > , >= , < , <= ) +// - The following when applied to the Boolean scalar type: +// * not ( ! ) +// * logical operations ( && , || , ^^ ) +// * comparison ( == , != )" +// +// This function just handles binary and unary nodes. Construction +// rules are handled in construction paths that are not covered by the unary +// and binary paths, while required conversions will still show up here +// as unary converters in the from a construction operator. +// +bool TIntermediate::isSpecializationOperation(const TIntermOperator& node) const +{ + // The operations resulting in floating point are quite limited + // (However, some floating-point operations result in bool, like ">", + // so are handled later.) + if (node.getType().isFloatingDomain()) { + switch (node.getOp()) { + case EOpIndexDirect: + case EOpIndexIndirect: + case EOpIndexDirectStruct: + case EOpVectorSwizzle: + return true; + default: + return false; + } + } + + // Check for floating-point arguments + if (const TIntermBinary* bin = node.getAsBinaryNode()) + if (bin->getLeft() ->getType().isFloatingDomain() || + bin->getRight()->getType().isFloatingDomain()) + return false; + + // So, for now, we can assume everything left is non-floating-point... + + // Now check for integer/bool-based operations + switch (node.getOp()) { + + // dereference/swizzle + case EOpIndexDirect: + case EOpIndexIndirect: + case EOpIndexDirectStruct: + case EOpVectorSwizzle: + + // conversion constructors + case EOpConvIntToBool: + case EOpConvUintToBool: + case EOpConvUintToInt: + case EOpConvBoolToInt: + case EOpConvIntToUint: + case EOpConvBoolToUint: + + // unary operations + case EOpNegative: + case EOpLogicalNot: + case EOpBitwiseNot: + + // binary operations + case EOpAdd: + case EOpSub: + case EOpMul: + case EOpVectorTimesScalar: + case EOpDiv: + case EOpMod: + case EOpRightShift: + case EOpLeftShift: + case EOpAnd: + case EOpInclusiveOr: + case EOpExclusiveOr: + case EOpLogicalOr: + case EOpLogicalXor: + case EOpLogicalAnd: + case EOpEqual: + case EOpNotEqual: + case EOpLessThan: + case EOpGreaterThan: + case EOpLessThanEqual: + case EOpGreaterThanEqual: + return true; + default: + return false; + } +} + //////////////////////////////////////////////////////////////// // // Member functions of the nodes used for building the tree. @@ -1128,7 +1351,9 @@ bool TIntermUnary::promote() break; case EOpBitwiseNot: if (operand->getBasicType() != EbtInt && - operand->getBasicType() != EbtUint) + operand->getBasicType() != EbtUint && + operand->getBasicType() != EbtInt64 && + operand->getBasicType() != EbtUint64) return false; break; @@ -1139,6 +1364,8 @@ bool TIntermUnary::promote() case EOpPreDecrement: if (operand->getBasicType() != EbtInt && operand->getBasicType() != EbtUint && + operand->getBasicType() != EbtInt64 && + operand->getBasicType() != EbtUint64 && operand->getBasicType() != EbtFloat && operand->getBasicType() != EbtDouble) @@ -1256,8 +1483,10 @@ bool TIntermBinary::promote() case EOpInclusiveOrAssign: case EOpExclusiveOrAssign: // Check for integer-only operands. - if (( left->getBasicType() != EbtInt && left->getBasicType() != EbtUint) || - (right->getBasicType() != EbtInt && right->getBasicType() != EbtUint)) + if ((left->getBasicType() != EbtInt && left->getBasicType() != EbtUint && + left->getBasicType() != EbtInt64 && left->getBasicType() != EbtUint64) || + (right->getBasicType() != EbtInt && right->getBasicType() != EbtUint && + right->getBasicType() != EbtInt64 && right->getBasicType() != EbtUint64)) return false; if (left->isMatrix() || right->isMatrix()) return false; @@ -1448,8 +1677,10 @@ bool TIntermBinary::promote() return false; if (left->isVector() && right->isVector() && left->getVectorSize() != right->getVectorSize()) return false; - if (right->isVector() || right->isMatrix()) - setType(TType(basicType, EvqTemporary, right->getVectorSize(), right->getMatrixCols(), right->getMatrixRows())); + if (right->isVector() || right->isMatrix()) { + type.shallowCopy(right->getType()); + type.getQualifier().makeTemporary(); + } break; default: @@ -1559,6 +1790,12 @@ TIntermTyped* TIntermediate::promoteConstantUnion(TBasicType promoteTo, TIntermC case EbtUint: leftUnionArray[i].setDConst(static_cast(rightUnionArray[i].getUConst())); break; + case EbtInt64: + leftUnionArray[i].setDConst(static_cast(rightUnionArray[i].getI64Const())); + break; + case EbtUint64: + leftUnionArray[i].setDConst(static_cast(rightUnionArray[i].getU64Const())); + break; case EbtBool: leftUnionArray[i].setDConst(static_cast(rightUnionArray[i].getBConst())); break; @@ -1580,6 +1817,12 @@ TIntermTyped* TIntermediate::promoteConstantUnion(TBasicType promoteTo, TIntermC case EbtUint: leftUnionArray[i].setDConst(static_cast(rightUnionArray[i].getUConst())); break; + case EbtInt64: + leftUnionArray[i].setDConst(static_cast(rightUnionArray[i].getI64Const())); + break; + case EbtUint64: + leftUnionArray[i].setDConst(static_cast(rightUnionArray[i].getU64Const())); + break; case EbtBool: leftUnionArray[i].setDConst(static_cast(rightUnionArray[i].getBConst())); break; @@ -1599,6 +1842,12 @@ TIntermTyped* TIntermediate::promoteConstantUnion(TBasicType promoteTo, TIntermC case EbtUint: leftUnionArray[i].setIConst(static_cast(rightUnionArray[i].getUConst())); break; + case EbtInt64: + leftUnionArray[i].setIConst(static_cast(rightUnionArray[i].getI64Const())); + break; + case EbtUint64: + leftUnionArray[i].setIConst(static_cast(rightUnionArray[i].getU64Const())); + break; case EbtBool: leftUnionArray[i].setIConst(static_cast(rightUnionArray[i].getBConst())); break; @@ -1618,6 +1867,12 @@ TIntermTyped* TIntermediate::promoteConstantUnion(TBasicType promoteTo, TIntermC case EbtUint: leftUnionArray[i] = rightUnionArray[i]; break; + case EbtInt64: + leftUnionArray[i].setUConst(static_cast(rightUnionArray[i].getI64Const())); + break; + case EbtUint64: + leftUnionArray[i].setUConst(static_cast(rightUnionArray[i].getU64Const())); + break; case EbtBool: leftUnionArray[i].setUConst(static_cast(rightUnionArray[i].getBConst())); break; @@ -1637,6 +1892,12 @@ TIntermTyped* TIntermediate::promoteConstantUnion(TBasicType promoteTo, TIntermC case EbtUint: leftUnionArray[i].setBConst(rightUnionArray[i].getUConst() != 0); break; + case EbtInt64: + leftUnionArray[i].setBConst(rightUnionArray[i].getI64Const() != 0); + break; + case EbtUint64: + leftUnionArray[i].setBConst(rightUnionArray[i].getU64Const() != 0); + break; case EbtBool: leftUnionArray[i] = rightUnionArray[i]; break; @@ -1648,6 +1909,56 @@ TIntermTyped* TIntermediate::promoteConstantUnion(TBasicType promoteTo, TIntermC return node; } break; + case EbtInt64: + switch (node->getType().getBasicType()) { + case EbtInt: + leftUnionArray[i].setI64Const(static_cast(rightUnionArray[i].getIConst())); + break; + case EbtUint: + leftUnionArray[i].setI64Const(static_cast(rightUnionArray[i].getUConst())); + break; + case EbtInt64: + leftUnionArray[i] = rightUnionArray[i]; + break; + case EbtUint64: + leftUnionArray[i].setI64Const(static_cast(rightUnionArray[i].getU64Const())); + break; + case EbtBool: + leftUnionArray[i].setI64Const(static_cast(rightUnionArray[i].getBConst())); + break; + case EbtFloat: + case EbtDouble: + leftUnionArray[i].setI64Const(static_cast(rightUnionArray[i].getDConst())); + break; + default: + return node; + } + break; + case EbtUint64: + switch (node->getType().getBasicType()) { + case EbtInt: + leftUnionArray[i].setU64Const(static_cast(rightUnionArray[i].getIConst())); + break; + case EbtUint: + leftUnionArray[i].setU64Const(static_cast(rightUnionArray[i].getUConst())); + break; + case EbtInt64: + leftUnionArray[i].setU64Const(static_cast(rightUnionArray[i].getI64Const())); + break; + case EbtUint64: + leftUnionArray[i] = rightUnionArray[i]; + break; + case EbtBool: + leftUnionArray[i].setU64Const(static_cast(rightUnionArray[i].getBConst())); + break; + case EbtFloat: + case EbtDouble: + leftUnionArray[i].setU64Const(static_cast(rightUnionArray[i].getDConst())); + break; + default: + return node; + } + break; default: return node; } diff --git a/glslang/MachineIndependent/ParseHelper.cpp b/glslang/MachineIndependent/ParseHelper.cpp index 5de89e1b..959d6900 100644 --- a/glslang/MachineIndependent/ParseHelper.cpp +++ b/glslang/MachineIndependent/ParseHelper.cpp @@ -48,14 +48,14 @@ extern int yyparse(glslang::TParseContext*); namespace glslang { -TParseContext::TParseContext(TSymbolTable& symt, TIntermediate& interm, bool pb, int v, EProfile p, int spv, int vulkan, EShLanguage L, TInfoSink& is, - bool fc, EShMessages m) : - intermediate(interm), symbolTable(symt), infoSink(is), language(L), - version(v), profile(p), spv(spv), vulkan(vulkan), forwardCompatible(fc), +TParseContext::TParseContext(TSymbolTable& symbolTable, TIntermediate& interm, bool parsingBuiltins, + int version, EProfile profile, int spv, int vulkan, EShLanguage language, + TInfoSink& infoSink, bool forwardCompatible, EShMessages messages) : + TParseContextBase(symbolTable, interm, version, profile, spv, vulkan, language, infoSink, forwardCompatible, messages), contextPragma(true, false), loopNestingLevel(0), structNestingLevel(0), controlFlowNestingLevel(0), statementNestingLevel(0), - postMainReturn(false), - tokensBeforeEOF(false), limits(resources.limits), messages(m), currentScanner(nullptr), - numErrors(0), parsingBuiltins(pb), afterEOF(false), + inMain(false), postMainReturn(false), currentFunctionType(nullptr), blockName(nullptr), + limits(resources.limits), parsingBuiltins(parsingBuiltins), + afterEOF(false), atomicUintOffsets(nullptr), anyIndexLimits(false) { // ensure we always have a linkage node, even if empty, to simplify tree topology algorithms @@ -69,7 +69,7 @@ TParseContext::TParseContext(TSymbolTable& symt, TIntermediate& interm, bool pb, for (int type = 0; type < maxSamplerIndex; ++type) defaultSamplerPrecision[type] = EpqNone; - // replace with real defaults for those that have them + // replace with real precision defaults for those that have them if (profile == EEsProfile) { TSampler sampler; sampler.set(EbtFloat, Esd2D); @@ -80,16 +80,22 @@ TParseContext::TParseContext(TSymbolTable& symt, TIntermediate& interm, bool pb, sampler.external = true; defaultSamplerPrecision[computeSamplerTypeIndex(sampler)] = EpqLow; - switch (language) { - case EShLangFragment: - defaultPrecision[EbtInt] = EpqMedium; - defaultPrecision[EbtUint] = EpqMedium; - break; - default: - defaultPrecision[EbtInt] = EpqHigh; - defaultPrecision[EbtUint] = EpqHigh; - defaultPrecision[EbtFloat] = EpqHigh; - break; + // If we are parsing built-in computational variables/functions, it is meaningful to record + // whether the built-in has no precision qualifier, as that ambiguity + // is used to resolve the precision from the supplied arguments/operands instead. + // So, we don't actually want to replace EpqNone with a default precision for built-ins. + if (! parsingBuiltins) { + switch (language) { + case EShLangFragment: + defaultPrecision[EbtInt] = EpqMedium; + defaultPrecision[EbtUint] = EpqMedium; + break; + default: + defaultPrecision[EbtInt] = EpqHigh; + defaultPrecision[EbtUint] = EpqHigh; + defaultPrecision[EbtFloat] = EpqHigh; + break; + } } defaultPrecision[EbtSampler] = EpqLow; @@ -616,10 +622,20 @@ void TParseContext::makeEditable(TSymbol*& symbol) intermediate.addSymbolLinkageNode(linkage, *symbol); } +// Return a writable version of the variable 'name'. +// +// Return nullptr if 'name' is not found. This should mean +// something is seriously wrong (e.g., compiler asking self for +// built-in that doesn't exist). TVariable* TParseContext::getEditableVariable(const char* name) { bool builtIn; TSymbol* symbol = symbolTable.find(name, &builtIn); + + assert(symbol != nullptr); + if (symbol == nullptr) + return nullptr; + if (builtIn) makeEditable(symbol); @@ -775,7 +791,7 @@ TIntermTyped* TParseContext::handleDotDereference(const TSourceLoc& loc, TInterm // // .length() can't be resolved until we later see the function-calling syntax. - // Save away the name in the AST for now. Processing is compeleted in + // Save away the name in the AST for now. Processing is completed in // handleLengthMethod(). // if (field == "length") { @@ -873,6 +889,10 @@ TIntermTyped* TParseContext::handleDotDereference(const TSourceLoc& loc, TInterm } else error(loc, "does not apply to this type:", field.c_str(), base->getType().getCompleteString().c_str()); + // Propagate noContraction up the dereference chain + if (base->getQualifier().noContraction) + result->getWritableType().getQualifier().noContraction = true; + return result; } @@ -986,7 +1006,7 @@ TIntermAggregate* TParseContext::handleFunctionDefinition(const TSourceLoc& loc, // // Raise error message if main function takes any parameters or returns anything other than void // - if (function.getName() == "main") { + if (function.getName() == intermediate.getEntryPoint().c_str()) { if (function.getParamCount() > 0) error(loc, "function cannot take any parameter(s)", function.getName().c_str(), ""); if (function.getType().getBasicType() != EbtVoid) @@ -1812,6 +1832,24 @@ TOperator TParseContext::mapTypeToConstructorOp(const TType& type) const default: break; // some compilers want this } break; + case EbtInt64: + switch(type.getVectorSize()) { + case 1: op = EOpConstructInt64; break; + case 2: op = EOpConstructI64Vec2; break; + case 3: op = EOpConstructI64Vec3; break; + case 4: op = EOpConstructI64Vec4; break; + default: break; // some compilers want this + } + break; + case EbtUint64: + switch(type.getVectorSize()) { + case 1: op = EOpConstructUint64; break; + case 2: op = EOpConstructU64Vec2; break; + case 3: op = EOpConstructU64Vec3; break; + case 4: op = EOpConstructU64Vec4; break; + default: break; // some compilers want this + } + break; case EbtBool: switch(type.getVectorSize()) { case 1: op = EOpConstructBool; break; @@ -2180,6 +2218,18 @@ bool TParseContext::builtInName(const TString& identifier) // constructor to build something of the type of the constructor. Also returns // the type of the constructor. // +// Part of establishing type is establishing specialization-constness. +// We don't yet know "top down" whether type is a specialization constant, +// but a const constructor can becomes a specialization constant if any of +// its children are, subject to KHR_vulkan_glsl rules: +// +// - int(), uint(), and bool() constructors for type conversions +// from any of the following types to any of the following types: +// * int +// * uint +// * bool +// - vector versions of the above conversion constructors +// // Returns true if there was an error in construction. // bool TParseContext::constructorError(const TSourceLoc& loc, TIntermNode* node, TFunction& function, TOperator op, TType& type) @@ -2225,6 +2275,7 @@ bool TParseContext::constructorError(const TSourceLoc& loc, TIntermNode* node, T bool overFull = false; bool matrixInMatrix = false; bool arrayArg = false; + bool floatArgument = false; for (int arg = 0; arg < function.getParamCount(); ++arg) { if (function[arg].type->isArray()) { if (! function[arg].type->isExplicitlySizedArray()) { @@ -2253,11 +2304,52 @@ bool TParseContext::constructorError(const TSourceLoc& loc, TIntermNode* node, T constType = false; if (function[arg].type->getQualifier().isSpecConstant()) specConstType = true; + if (function[arg].type->isFloatingDomain()) + floatArgument = true; } + // inherit constness from children if (constType) { - if (specConstType) + bool makeSpecConst; + // Finish pinning down spec-const semantics + if (specConstType) { + switch (op) { + case EOpConstructInt: + case EOpConstructUint: + case EOpConstructInt64: + case EOpConstructUint64: + case EOpConstructBool: + case EOpConstructBVec2: + case EOpConstructBVec3: + case EOpConstructBVec4: + case EOpConstructIVec2: + case EOpConstructIVec3: + case EOpConstructIVec4: + case EOpConstructUVec2: + case EOpConstructUVec3: + case EOpConstructUVec4: + case EOpConstructI64Vec2: + case EOpConstructI64Vec3: + case EOpConstructI64Vec4: + case EOpConstructU64Vec2: + case EOpConstructU64Vec3: + case EOpConstructU64Vec4: + // This was the list of valid ones, if they aren't converting from float + // and aren't making an array. + makeSpecConst = ! floatArgument && ! type.isArray(); + break; + default: + // anything else wasn't white-listed in the spec as a conversion + makeSpecConst = false; + break; + } + } else + makeSpecConst = false; + + if (makeSpecConst) type.getQualifier().makeSpecConstant(); + else if (specConstType) + type.getQualifier().makeTemporary(); else type.getQualifier().storage = EvqConst; } @@ -2534,13 +2626,19 @@ void TParseContext::globalQualifierTypeCheck(const TSourceLoc& loc, const TQuali return; } - if (publicType.basicType == EbtInt || publicType.basicType == EbtUint || publicType.basicType == EbtDouble) + if (publicType.basicType == EbtInt || publicType.basicType == EbtUint || + publicType.basicType == EbtInt64 || publicType.basicType == EbtUint64 || + publicType.basicType == EbtDouble) profileRequires(loc, EEsProfile, 300, nullptr, "shader input/output"); if (! qualifier.flat) { - if (publicType.basicType == EbtInt || publicType.basicType == EbtUint || publicType.basicType == EbtDouble || - (publicType.userDef && (publicType.userDef->containsBasicType(EbtInt) || - publicType.userDef->containsBasicType(EbtUint) || + if (publicType.basicType == EbtInt || publicType.basicType == EbtUint || + publicType.basicType == EbtInt64 || publicType.basicType == EbtUint64 || + publicType.basicType == EbtDouble || + (publicType.userDef && (publicType.userDef->containsBasicType(EbtInt) || + publicType.userDef->containsBasicType(EbtUint) || + publicType.userDef->containsBasicType(EbtInt64) || + publicType.userDef->containsBasicType(EbtUint64) || publicType.userDef->containsBasicType(EbtDouble)))) { if (qualifier.storage == EvqVaryingIn && language == EShLangFragment) error(loc, "must be qualified as flat", TType::getBasicString(publicType.basicType), GetStorageQualifierString(qualifier.storage)); @@ -2673,8 +2771,10 @@ void TParseContext::mergeQualifiers(const TSourceLoc& loc, TQualifier& dst, cons (profile == EEsProfile && version < 310)) && ! extensionTurnedOn(E_GL_ARB_shading_language_420pack)) { // non-function parameters + if (src.noContraction && (dst.invariant || dst.isInterpolation() || dst.isAuxiliary() || dst.storage != EvqTemporary || dst.precision != EpqNone)) + error(loc, "precise qualifier must appear first", "", ""); if (src.invariant && (dst.isInterpolation() || dst.isAuxiliary() || dst.storage != EvqTemporary || dst.precision != EpqNone)) - error(loc, "invariant qualifier must appear first", "", ""); + error(loc, "invariant qualifier must appear before interpolation, storage, and precision qualifiers ", "", ""); else if (src.isInterpolation() && (dst.isAuxiliary() || dst.storage != EvqTemporary || dst.precision != EpqNone)) error(loc, "interpolation qualifiers must appear before storage and precision qualifiers", "", ""); else if (src.isAuxiliary() && (dst.storage != EvqTemporary || dst.precision != EpqNone)) @@ -2683,6 +2783,8 @@ void TParseContext::mergeQualifiers(const TSourceLoc& loc, TQualifier& dst, cons error(loc, "precision qualifier must appear as last qualifier", "", ""); // function parameters + if (src.noContraction && (dst.storage == EvqConst || dst.storage == EvqIn || dst.storage == EvqOut)) + error(loc, "precise qualifier must appear first", "", ""); if (src.storage == EvqConst && (dst.storage == EvqIn || dst.storage == EvqOut)) error(loc, "in/out must appear before const", "", ""); } @@ -2713,6 +2815,7 @@ void TParseContext::mergeQualifiers(const TSourceLoc& loc, TQualifier& dst, cons bool repeated = false; #define MERGE_SINGLETON(field) repeated |= dst.field && src.field; dst.field |= src.field; MERGE_SINGLETON(invariant); + MERGE_SINGLETON(noContraction); MERGE_SINGLETON(centroid); MERGE_SINGLETON(smooth); MERGE_SINGLETON(flat); @@ -2830,13 +2933,14 @@ bool TParseContext::containsFieldWithBasicType(const TType& type, TBasicType bas void TParseContext::arraySizeCheck(const TSourceLoc& loc, TIntermTyped* expr, TArraySize& sizePair) { bool isConst = false; - sizePair.size = 1; sizePair.node = nullptr; + int size = 1; + TIntermConstantUnion* constant = expr->getAsConstantUnion(); if (constant) { // handle true (non-specialization) constant - sizePair.size = constant->getConstArray()[0].getIConst(); + size = constant->getConstArray()[0].getIConst(); isConst = true; } else { // see if it's a specialization constant instead @@ -2845,16 +2949,18 @@ void TParseContext::arraySizeCheck(const TSourceLoc& loc, TIntermTyped* expr, TA sizePair.node = expr; TIntermSymbol* symbol = expr->getAsSymbolNode(); if (symbol && symbol->getConstArray().size() > 0) - sizePair.size = symbol->getConstArray()[0].getIConst(); + size = symbol->getConstArray()[0].getIConst(); } } + sizePair.size = size; + if (! isConst || (expr->getBasicType() != EbtInt && expr->getBasicType() != EbtUint)) { error(loc, "array size must be a constant integer expression", "", ""); return; } - if (sizePair.size <= 0) { + if (size <= 0) { error(loc, "array size must be a positive integer", "", ""); return; } @@ -3122,16 +3228,27 @@ void TParseContext::updateImplicitArraySize(const TSourceLoc& loc, TIntermNode * // This has to be the result of a block dereference, unless it's bad shader code // If it's a uniform block, then an error will be issued elsewhere, but // return early now to avoid crashing later in this function. - if (! deref->getLeft()->getAsSymbolNode() || deref->getLeft()->getBasicType() != EbtBlock || + if (deref->getLeft()->getBasicType() != EbtBlock || deref->getLeft()->getType().getQualifier().storage == EvqUniform || deref->getRight()->getAsConstantUnion() == nullptr) return; - blockIndex = deref->getRight()->getAsConstantUnion()->getConstArray()[0].getIConst(); + const TIntermTyped* left = deref->getLeft(); + const TIntermTyped* right = deref->getRight(); - lookupName = &deref->getLeft()->getAsSymbolNode()->getName(); + if (left->getAsBinaryNode()) { + left = left->getAsBinaryNode()->getLeft(); // Block array access + assert(left->isArray()); + } + + if (! left->getAsSymbolNode()) + return; + + blockIndex = right->getAsConstantUnion()->getConstArray()[0].getIConst(); + + lookupName = &left->getAsSymbolNode()->getName(); if (IsAnonymous(*lookupName)) - lookupName = &(*deref->getLeft()->getType().getStruct())[blockIndex].type->getFieldName(); + lookupName = &(*left->getType().getStruct())[blockIndex].type->getFieldName(); } // Lookup the symbol, should only fail if shader code is incorrect @@ -3144,7 +3261,10 @@ void TParseContext::updateImplicitArraySize(const TSourceLoc& loc, TIntermNode * return; } - symbol->getWritableType().setImplicitArraySize(index + 1); + if (symbol->getType().isStruct() && blockIndex != -1) + (*symbol->getWritableType().getStruct())[blockIndex].type->setImplicitArraySize(index + 1); + else + symbol->getWritableType().setImplicitArraySize(index + 1); } // Returns true if the first argument to the #line directive is the line number for the next line. @@ -3156,7 +3276,8 @@ void TParseContext::updateImplicitArraySize(const TSourceLoc& loc, TIntermNode * // Desktop, version 3.30 and later, and ES: "After processing this directive // (including its new-line), the implementation will behave as if it is compiling at line number line and // source string number source-string-number. -bool TParseContext::lineDirectiveShouldSetNextLine() const { +bool TParseContext::lineDirectiveShouldSetNextLine() const +{ return profile == EEsProfile || version >= 330; } @@ -3211,6 +3332,7 @@ TSymbol* TParseContext::redeclareBuiltinVariable(const TSourceLoc& loc, const TS (identifier == "gl_FragDepth" && ((nonEsRedecls && version >= 420) || esRedecls)) || (identifier == "gl_FragCoord" && ((nonEsRedecls && version >= 150) || esRedecls)) || identifier == "gl_ClipDistance" || + identifier == "gl_CullDistance" || identifier == "gl_FrontColor" || identifier == "gl_BackColor" || identifier == "gl_FrontSecondaryColor" || @@ -3263,8 +3385,9 @@ TSymbol* TParseContext::redeclareBuiltinVariable(const TSourceLoc& loc, const TS error(loc, "cannot apply layout qualifier to", "redeclaration", symbol->getName().c_str()); if (qualifier.isMemory() || qualifier.isAuxiliary() || symbol->getType().getQualifier().storage != qualifier.storage) error(loc, "cannot change storage, memory, or auxiliary qualification of", "redeclaration", symbol->getName().c_str()); - } else if (identifier == "gl_TexCoord" || - identifier == "gl_ClipDistance") { + } else if (identifier == "gl_TexCoord" || + identifier == "gl_ClipDistance" || + identifier == "gl_CullDistance") { if (qualifier.hasLayout() || qualifier.isMemory() || qualifier.isAuxiliary() || qualifier.nopersp != symbolQualifier.nopersp || qualifier.flat != symbolQualifier.flat || symbolQualifier.storage != qualifier.storage) @@ -3403,10 +3526,14 @@ void TParseContext::redeclareBuiltinBlock(const TSourceLoc& loc, TTypeList& newT oldType.getQualifier().centroid = newType.getQualifier().centroid; oldType.getQualifier().sample = newType.getQualifier().sample; oldType.getQualifier().invariant = newType.getQualifier().invariant; + oldType.getQualifier().noContraction = newType.getQualifier().noContraction; oldType.getQualifier().smooth = newType.getQualifier().smooth; oldType.getQualifier().flat = newType.getQualifier().flat; oldType.getQualifier().nopersp = newType.getQualifier().nopersp; + if (oldType.isImplicitlySizedArray() && newType.isExplicitlySizedArray()) + oldType.changeOuterArraySize(newType.getOuterArraySize()); + // go to next member ++member; } else { @@ -3483,13 +3610,20 @@ void TParseContext::paramCheckFix(const TSourceLoc& loc, const TQualifier& quali type.getQualifier().writeonly = qualifier.writeonly; type.getQualifier().restrict = qualifier.restrict; } + if (qualifier.isAuxiliary() || qualifier.isInterpolation()) error(loc, "cannot use auxiliary or interpolation qualifiers on a function parameter", "", ""); if (qualifier.hasLayout()) error(loc, "cannot use layout qualifiers on a function parameter", "", ""); if (qualifier.invariant) - error(loc, "cannot use invariant qualifier on a function parameter", "", ""); + error(loc, "cannot use invariant qualifier on a function parameter", "", ""); + if (qualifier.noContraction) { + if (qualifier.storage == EvqOut || qualifier.storage == EvqInOut) + type.getQualifier().noContraction = true; + else + warn(loc, "qualifier has no effect on non-output parameters", "precise", ""); + } paramCheckFix(loc, qualifier.storage, type); } @@ -3676,6 +3810,8 @@ void TParseContext::arrayLimitCheck(const TSourceLoc& loc, const TString& identi limitCheck(loc, size, "gl_MaxTextureCoords", "gl_TexCoord array size"); else if (identifier.compare("gl_ClipDistance") == 0) limitCheck(loc, size, "gl_MaxClipDistances", "gl_ClipDistance array size"); + else if (identifier.compare("gl_CullDistance") == 0) + limitCheck(loc, size, "gl_MaxCullDistances", "gl_CullDistance array size"); } // See if the provided value is less than the symbol indicated by limit, @@ -3718,7 +3854,7 @@ void TParseContext::finalErrorCheck() break; case EShLangCompute: if (profile != EEsProfile && version < 430) - requireExtensions(getCurrentLoc(), 1, &E_GL_ARB_compute_shader, "tessellation shaders"); + requireExtensions(getCurrentLoc(), 1, &E_GL_ARB_compute_shader, "compute shaders"); break; default: break; @@ -4089,6 +4225,13 @@ void TParseContext::setLayoutQualifier(const TSourceLoc& loc, TPublicType& publi requireProfile(loc, ECompatibilityProfile | ECoreProfile, "index layout qualifier on fragment output"); const char* exts[2] = { E_GL_ARB_separate_shader_objects, E_GL_ARB_explicit_attrib_location }; profileRequires(loc, ECompatibilityProfile | ECoreProfile, 330, 2, exts, "index layout qualifier on fragment output"); + + // "It is also a compile-time error if a fragment shader sets a layout index to less than 0 or greater than 1." + if (value < 0 || value > 1) { + value = 0; + error(loc, "value must be 0 or 1", "index", ""); + } + publicType.qualifier.layoutIndex = value; return; } @@ -4096,6 +4239,8 @@ void TParseContext::setLayoutQualifier(const TSourceLoc& loc, TPublicType& publi case EShLangCompute: if (id.compare(0, 11, "local_size_") == 0) { + profileRequires(loc, EEsProfile, 310, 0, "gl_WorkGroupSize"); + profileRequires(loc, ~EEsProfile, 430, E_GL_ARB_compute_shader, "gl_WorkGroupSize"); if (id == "local_size_x") { publicType.shaderQualifiers.localSize[0] = value; return; @@ -4400,6 +4545,8 @@ void TParseContext::layoutTypeCheck(const TSourceLoc& loc, const TType& type) { case EbtInt: case EbtUint: + case EbtInt64: + case EbtUint64: case EbtBool: case EbtFloat: case EbtDouble: @@ -4867,7 +5014,14 @@ TIntermNode* TParseContext::executeInitializer(const TSourceLoc& loc, TIntermTyp // constructor-style subtree, allowing the rest of the code to operate // identically for both kinds of initializers. // - initializer = convertInitializerList(loc, variable->getType(), initializer); + // Type can't be deduced from the initializer list, so a skeletal type to + // follow has to be passed in. Constness and specialization-constness + // should be deduced bottom up, not dictated by the skeletal type. + // + TType skeletalType; + skeletalType.shallowCopy(variable->getType()); + skeletalType.getQualifier().makeTemporary(); + initializer = convertInitializerList(loc, skeletalType, initializer); if (! initializer) { // error recovery; don't leave const without constant values if (qualifier == EvqConst) @@ -4956,7 +5110,7 @@ TIntermNode* TParseContext::executeInitializer(const TSourceLoc& loc, TIntermTyp // normal assigning of a value to a variable... specializationCheck(loc, initializer->getType(), "initializer"); TIntermSymbol* intermSymbol = intermediate.addSymbol(*variable, loc); - TIntermNode* initNode = intermediate.addAssign(EOpAssign, intermSymbol, initializer, loc); + TIntermTyped* initNode = intermediate.addAssign(EOpAssign, intermSymbol, initializer, loc); if (! initNode) assignError(loc, "=", intermSymbol->getCompleteString(), initializer->getCompleteString()); @@ -4967,11 +5121,14 @@ TIntermNode* TParseContext::executeInitializer(const TSourceLoc& loc, TIntermTyp } // -// Reprocess any initializer-list { ... } parts of the initializer. +// Reprocess any initializer-list (the "{ ... }" syntax) parts of the +// initializer. +// // Need to hierarchically assign correct types and implicit // conversions. Will do this mimicking the same process used for // creating a constructor-style initializer, ensuring we get the -// same form. +// same form. However, it has to in parallel walk the 'type' +// passed in, as type cannot be deduced from an initializer list. // TIntermTyped* TParseContext::convertInitializerList(const TSourceLoc& loc, const TType& type, TIntermTyped* initializer) { @@ -5117,12 +5274,6 @@ TIntermTyped* TParseContext::addConstructor(const TSourceLoc& loc, TIntermNode* // for each parameter to the constructor call, check to see if the right type is passed or convert them // to the right type if possible (and allowed). // for structure constructors, just check if the right type is passed, no conversion is allowed. - - // We don't know "top down" whether type is a specialization constant, - // but a const becomes a specialization constant if any of its children are. - bool hasSpecConst = false; - bool isConstConstrutor = true; - for (TIntermSequence::iterator p = sequenceVector.begin(); p != sequenceVector.end(); p++, paramCount++) { if (type.isArray()) @@ -5132,21 +5283,13 @@ TIntermTyped* TParseContext::addConstructor(const TSourceLoc& loc, TIntermNode* else newNode = constructBuiltIn(type, op, (*p)->getAsTyped(), node->getLoc(), true); - if (newNode) { + if (newNode) *p = newNode; - if (! newNode->getType().getQualifier().isConstant()) - isConstConstrutor = false; - if (newNode->getType().getQualifier().isSpecConstant()) - hasSpecConst = true; - } else + else return nullptr; } - TIntermTyped* constructor = intermediate.setAggregateOperator(aggrNode, op, type, loc); - if (isConstConstrutor && hasSpecConst) - constructor->getWritableType().getQualifier().makeSpecConstant(); - - return constructor; + return intermediate.setAggregateOperator(aggrNode, op, type, loc); } // Function for constructor implementation. Calls addUnaryMath with appropriate EOp value @@ -5211,6 +5354,20 @@ TIntermTyped* TParseContext::constructBuiltIn(const TType& type, TOperator op, T basicOp = EOpConstructUint; break; + case EOpConstructI64Vec2: + case EOpConstructI64Vec3: + case EOpConstructI64Vec4: + case EOpConstructInt64: + basicOp = EOpConstructInt64; + break; + + case EOpConstructU64Vec2: + case EOpConstructU64Vec3: + case EOpConstructU64Vec4: + case EOpConstructUint64: + basicOp = EOpConstructUint64; + break; + case EOpConstructBVec2: case EOpConstructBVec3: case EOpConstructBVec4: @@ -5499,7 +5656,7 @@ void TParseContext::blockStageIoCheck(const TSourceLoc& loc, const TQualifier& q } } -// Do all block-declaration checking regarding its qualifers. +// Do all block-declaration checking regarding its qualifiers. void TParseContext::blockQualifierCheck(const TSourceLoc& loc, const TQualifier& qualifier, bool instanceName) { // The 4.5 specification says: @@ -5699,6 +5856,14 @@ void TParseContext::addQualifierToExisting(const TSourceLoc& loc, TQualifier qua error(loc, "cannot change qualification after use", "invariant", ""); symbol->getWritableType().getQualifier().invariant = true; invariantCheck(loc, symbol->getType().getQualifier()); + } else if (qualifier.noContraction) { + if (intermediate.inIoAccessed(identifier)) + error(loc, "cannot change qualification after use", "precise", ""); + symbol->getWritableType().getQualifier().noContraction = true; + } else if (qualifier.specConstant) { + symbol->getWritableType().getQualifier().makeSpecConstant(); + if (qualifier.hasSpecConstantId()) + symbol->getWritableType().getQualifier().layoutSpecConstantId = qualifier.layoutSpecConstantId; } else warn(loc, "unknown requalification", "", ""); } @@ -5709,6 +5874,7 @@ void TParseContext::addQualifierToExisting(const TSourceLoc& loc, TQualifier qua addQualifierToExisting(loc, qualifier, *identifiers[i]); } +// Make sure 'invariant' isn't being applied to a non-allowed object. void TParseContext::invariantCheck(const TSourceLoc& loc, const TQualifier& qualifier) { if (! qualifier.invariant) @@ -5820,7 +5986,8 @@ void TParseContext::updateStandaloneQualifierDefaults(const TSourceLoc& loc, con // Fix the existing constant gl_WorkGroupSize with this new information. TVariable* workGroupSize = getEditableVariable("gl_WorkGroupSize"); - workGroupSize->getWritableConstArray()[i].setUConst(intermediate.getLocalSize(i)); + if (workGroupSize != nullptr) + workGroupSize->getWritableConstArray()[i].setUConst(intermediate.getLocalSize(i)); } } else error(loc, "can only apply to 'in'", "local_size", ""); @@ -5833,7 +6000,8 @@ void TParseContext::updateStandaloneQualifierDefaults(const TSourceLoc& loc, con error(loc, "can only apply to 'in'", "local_size id", ""); // Set the workgroup built-in variable as a specialization constant TVariable* workGroupSize = getEditableVariable("gl_WorkGroupSize"); - workGroupSize->getWritableType().getQualifier().specConstant = true; + if (workGroupSize != nullptr) + workGroupSize->getWritableType().getQualifier().specConstant = true; } } if (publicType.shaderQualifiers.earlyFragmentTests) { @@ -5989,32 +6157,4 @@ TIntermNode* TParseContext::addSwitch(const TSourceLoc& loc, TIntermTyped* expre return switchNode; } -void TParseContext::notifyVersion(int line, int version, const char* type_string) -{ - if (versionCallback) { - versionCallback(line, version, type_string); - } -} - -void TParseContext::notifyErrorDirective(int line, const char* error_message) -{ - if (errorCallback) { - errorCallback(line, error_message); - } -} - -void TParseContext::notifyLineDirective(int curLineNo, int newLineNo, bool hasSource, int sourceNum, const char* sourceName) -{ - if (lineCallback) { - lineCallback(curLineNo, newLineNo, hasSource, sourceNum, sourceName); - } -} - -void TParseContext::notifyExtensionDirective(int line, const char* extension, const char* behavior) -{ - if (extensionCallback) { - extensionCallback(line, extension, behavior); - } -} - } // end namespace glslang diff --git a/glslang/MachineIndependent/ParseHelper.h b/glslang/MachineIndependent/ParseHelper.h index ac1932d5..a4775e71 100644 --- a/glslang/MachineIndependent/ParseHelper.h +++ b/glslang/MachineIndependent/ParseHelper.h @@ -33,10 +33,18 @@ //ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE //POSSIBILITY OF SUCH DAMAGE. // + +// +// This header defines a two-level parse-helper hierarchy, derived from +// TParseVersions: +// - TParseContextBase: sharable across multiple parsers +// - TParseContext: GLSL specific helper +// + #ifndef _PARSER_HELPER_INCLUDED_ #define _PARSER_HELPER_INCLUDED_ -#include "Versions.h" +#include "parseVersions.h" #include "../Include/ShHandle.h" #include "SymbolTable.h" #include "localintermediate.h" @@ -60,10 +68,88 @@ class TPpContext; typedef std::set TIdSetType; // -// The following are extra variables needed during parsing, grouped together so -// they can be passed to the parser without needing a global. +// Sharable code (as well as what's in TParseVersions) across +// parse helpers. // -class TParseContext { +class TParseContextBase : public TParseVersions { +public: + TParseContextBase(TSymbolTable& symbolTable, TIntermediate& interm, int version, + EProfile profile, int spv, int vulkan, EShLanguage language, + TInfoSink& infoSink, bool forwardCompatible, EShMessages messages) + : TParseVersions(interm, version, profile, spv, vulkan, language, infoSink, forwardCompatible, messages), + symbolTable(symbolTable), tokensBeforeEOF(false), + linkage(nullptr), scanContext(nullptr), ppContext(nullptr) { } + virtual ~TParseContextBase() { } + + virtual void setLimits(const TBuiltInResource&) = 0; + + EShLanguage getLanguage() const { return language; } + TIntermAggregate*& getLinkage() { return linkage; } + void setScanContext(TScanContext* c) { scanContext = c; } + TScanContext* getScanContext() const { return scanContext; } + void setPpContext(TPpContext* c) { ppContext = c; } + TPpContext* getPpContext() const { return ppContext; } + + virtual void setLineCallback(const std::function& func) { lineCallback = func; } + virtual void setExtensionCallback(const std::function& func) { extensionCallback = func; } + virtual void setVersionCallback(const std::function& func) { versionCallback = func; } + virtual void setPragmaCallback(const std::function&)>& func) { pragmaCallback = func; } + virtual void setErrorCallback(const std::function& func) { errorCallback = func; } + + virtual void reservedPpErrorCheck(const TSourceLoc&, const char* name, const char* op) = 0; + virtual bool lineContinuationCheck(const TSourceLoc&, bool endOfComment) = 0; + virtual bool lineDirectiveShouldSetNextLine() const = 0; + virtual void handlePragma(const TSourceLoc&, const TVector&) = 0; + + virtual bool parseShaderStrings(TPpContext&, TInputScanner& input, bool versionWillBeError = false) = 0; + + virtual void notifyVersion(int line, int version, const char* type_string) + { + if (versionCallback) + versionCallback(line, version, type_string); + } + virtual void notifyErrorDirective(int line, const char* error_message) + { + if (errorCallback) + errorCallback(line, error_message); + } + virtual void notifyLineDirective(int curLineNo, int newLineNo, bool hasSource, int sourceNum, const char* sourceName) + { + if (lineCallback) + lineCallback(curLineNo, newLineNo, hasSource, sourceNum, sourceName); + } + virtual void notifyExtensionDirective(int line, const char* extension, const char* behavior) + { + if (extensionCallback) + extensionCallback(line, extension, behavior); + } + + TSymbolTable& symbolTable; // symbol table that goes with the current language, version, and profile + bool tokensBeforeEOF; + +protected: + TParseContextBase(TParseContextBase&); + TParseContextBase& operator=(TParseContextBase&); + + TIntermAggregate* linkage; // aggregate node of objects the linker may need, if not referenced by the rest of the AST + TScanContext* scanContext; + TPpContext* ppContext; + + // These, if set, will be called when a line, pragma ... is preprocessed. + // They will be called with any parameters to the original directive. + std::function lineCallback; + std::function&)> pragmaCallback; + std::function versionCallback; + std::function extensionCallback; + std::function errorCallback; +}; + +// +// GLSL-specific parse helper. Should have GLSL in the name, but that's +// too big of a change for comparing branches at the moment, and perhaps +// impacts downstream consumers as well. +// +class TParseContext : public TParseContextBase { public: TParseContext(TSymbolTable&, TIntermediate&, bool parsingBuiltins, int version, EProfile, int spv, int vulkan, EShLanguage, TInfoSink&, bool forwardCompatible = false, EShMessages messages = EShMsgDefault); @@ -72,7 +158,6 @@ public: void setLimits(const TBuiltInResource&); bool parseShaderStrings(TPpContext&, TInputScanner& input, bool versionWillBeError = false); void parserError(const char* s); // for bison's yyerror - const char* getPreamble(); void C_DECL error(const TSourceLoc&, const char* szReason, const char* szToken, const char* szExtraInfoFormat, ...); @@ -83,12 +168,10 @@ public: void C_DECL ppWarn(const TSourceLoc&, const char* szReason, const char* szToken, const char* szExtraInfoFormat, ...); - bool relaxedErrors() const { return (messages & EShMsgRelaxedErrors) != 0; } - bool suppressWarnings() const { return (messages & EShMsgSuppressWarnings) != 0; } - void reservedErrorCheck(const TSourceLoc&, const TString&); void reservedPpErrorCheck(const TSourceLoc&, const char* name, const char* op); bool lineContinuationCheck(const TSourceLoc&, bool endOfComment); + bool lineDirectiveShouldSetNextLine() const; bool builtInName(const TString&); void handlePragma(const TSourceLoc&, const TVector&); @@ -210,55 +293,6 @@ public: void updateImplicitArraySize(const TSourceLoc&, TIntermNode*, int index); - void setScanContext(TScanContext* c) { scanContext = c; } - TScanContext* getScanContext() const { return scanContext; } - void setPpContext(TPpContext* c) { ppContext = c; } - TPpContext* getPpContext() const { return ppContext; } - void addError() { ++numErrors; } - int getNumErrors() const { return numErrors; } - const TSourceLoc& getCurrentLoc() const { return currentScanner->getSourceLoc(); } - void setCurrentLine(int line) { currentScanner->setLine(line); } - void setCurrentColumn(int col) { currentScanner->setColumn(col); } - void setCurrentSourceName(const char* name) { currentScanner->setFile(name); } - void setCurrentString(int string) { currentScanner->setString(string); } - void setScanner(TInputScanner* scanner) { currentScanner = scanner; } - TInputScanner* getScanner() const { return currentScanner; } - - bool lineDirectiveShouldSetNextLine() const; - - void notifyVersion(int line, int version, const char* type_string); - void notifyErrorDirective(int line, const char* error_message); - void notifyLineDirective(int curLineNo, int newLineNo, bool hasSource, int sourceNum, const char* sourceName); - void notifyExtensionDirective(int line, const char* extension, const char* behavior); - - // The following are implemented in Versions.cpp to localize version/profile/stage/extensions control - void initializeExtensionBehavior(); - void requireProfile(const TSourceLoc&, int queryProfiles, const char* featureDesc); - void profileRequires(const TSourceLoc&, int queryProfiles, int minVersion, int numExtensions, const char* const extensions[], const char* featureDesc); - void profileRequires(const TSourceLoc&, int queryProfiles, int minVersion, const char* const extension, const char* featureDesc); - void requireStage(const TSourceLoc&, EShLanguageMask, const char* featureDesc); - void requireStage(const TSourceLoc&, EShLanguage, const char* featureDesc); - void checkDeprecated(const TSourceLoc&, int queryProfiles, int depVersion, const char* featureDesc); - void requireNotRemoved(const TSourceLoc&, int queryProfiles, int removedVersion, const char* featureDesc); - void requireExtensions(const TSourceLoc&, int numExtensions, const char* const extensions[], const char* featureDesc); - void ppRequireExtensions(const TSourceLoc&, int numExtensions, const char* const extensions[], const char* featureDesc); - TExtensionBehavior getExtensionBehavior(const char*); - bool extensionTurnedOn(const char* const extension); - bool extensionsTurnedOn(int numExtensions, const char* const extensions[]); - void updateExtensionBehavior(int line, const char* const extension, const char* behavior); - void fullIntegerCheck(const TSourceLoc&, const char* op); - void doubleCheck(const TSourceLoc&, const char* op); - void spvRemoved(const TSourceLoc&, const char* op); - void vulkanRemoved(const TSourceLoc&, const char* op); - void requireVulkan(const TSourceLoc&, const char* op); - void requireSpv(const TSourceLoc&, const char* op); - - void setVersionCallback(const std::function& func) { versionCallback = func; } - void setPragmaCallback(const std::function&)>& func) { pragmaCallback = func; } - void setLineCallback(const std::function& func) { lineCallback = func; } - void setExtensionCallback(const std::function& func) { extensionCallback = func; } - void setErrorCallback(const std::function& func) { errorCallback = func; } - protected: void nonInitConstCheck(const TSourceLoc&, TString& identifier, TType& type); void inheritGlobalDefaults(TQualifier& dst) const; @@ -268,8 +302,6 @@ protected: TIntermNode* executeInitializer(const TSourceLoc&, TIntermTyped* initializer, TVariable* variable); TIntermTyped* convertInitializerList(const TSourceLoc&, const TType&, TIntermTyped* initializer); TOperator mapTypeToConstructorOp(const TType&) const; - bool checkExtensionsRequested(const TSourceLoc&, int numExtensions, const char* const extensions[], const char* featureDesc); - void updateExtensionBehavior(const char* const extension, TExtensionBehavior); void finalErrorCheck(); void outputMessage(const TSourceLoc&, const char* szReason, const char* szToken, const char* szExtraInfoFormat, TPrefixType prefix, @@ -280,18 +312,6 @@ public: // Generally, bison productions, the scanner, and the PP need read/write access to these; just give them direct access // - TIntermediate& intermediate; // helper for making and hooking up pieces of the parse tree - TSymbolTable& symbolTable; // symbol table that goes with the current language, version, and profile - TInfoSink& infoSink; - - // compilation mode - EShLanguage language; // vertex or fragment language - int version; // version, updated by #version in the shader - EProfile profile; // the declared profile in the shader (core by default) - int spv; // SPIR-V version; 0 means not SPIR-V - int vulkan; // Vulkan version; 0 means not vulkan - bool forwardCompatible; // true if errors are to be given for use of deprecated features - // Current state of parsing struct TPragma contextPragma; int loopNestingLevel; // 0 if outside all loops @@ -306,9 +326,7 @@ public: bool functionReturnsValue; // true if a non-void function has a return const TString* blockName; TQualifier currentBlockQualifier; - TIntermAggregate *linkage; // aggregate node of objects the linker may need, if not referenced by the rest of the AST TPrecisionQualifier defaultPrecision[EbtNumTypes]; - bool tokensBeforeEOF; TBuiltInResource resources; TLimits& limits; @@ -316,13 +334,7 @@ protected: TParseContext(TParseContext&); TParseContext& operator=(TParseContext&); - EShMessages messages; // errors/warnings/rule-sets - TScanContext* scanContext; - TPpContext* ppContext; - TInputScanner* currentScanner; - int numErrors; // number of compile-time errors encountered - bool parsingBuiltins; // true if parsing built-in symbols/functions - TMap extensionBehavior; // for each extension string, what its current behavior is set to + const bool parsingBuiltins; // true if parsing built-in symbols/functions static const int maxSamplerIndex = EsdNumDims * (EbtNumTypes * (2 * 2 * 2)); // see computeSamplerTypeIndex() TPrecisionQualifier defaultSamplerPrecision[maxSamplerIndex]; bool afterEOF; @@ -369,14 +381,6 @@ protected: // array-sizing declarations // TVector ioArraySymbolResizeList; - - // These, if set, will be called when a line, pragma ... is preprocessed. - // They will be called with any parameters to the original directive. - std::function lineCallback; - std::function&)> pragmaCallback; - std::function versionCallback; - std::function extensionCallback; - std::function errorCallback; }; } // end namespace glslang diff --git a/glslang/MachineIndependent/Scan.cpp b/glslang/MachineIndependent/Scan.cpp index 098f0bd0..762fb86c 100644 --- a/glslang/MachineIndependent/Scan.cpp +++ b/glslang/MachineIndependent/Scan.cpp @@ -454,6 +454,15 @@ void TScanContext::fillInKeywordMap() (*KeywordMap)["uvec3"] = UVEC3; (*KeywordMap)["uvec4"] = UVEC4; + (*KeywordMap)["int64_t"] = INT64_T; + (*KeywordMap)["uint64_t"] = UINT64_T; + (*KeywordMap)["i64vec2"] = I64VEC2; + (*KeywordMap)["i64vec3"] = I64VEC3; + (*KeywordMap)["i64vec4"] = I64VEC4; + (*KeywordMap)["u64vec2"] = U64VEC2; + (*KeywordMap)["u64vec3"] = U64VEC3; + (*KeywordMap)["u64vec4"] = U64VEC4; + (*KeywordMap)["sampler2D"] = SAMPLER2D; (*KeywordMap)["samplerCube"] = SAMPLERCUBE; (*KeywordMap)["samplerCubeArray"] = SAMPLERCUBEARRAY; @@ -667,10 +676,12 @@ int TScanContext::tokenize(TPpContext* pp, TParserToken& token) case PpAtomDecrement: return DEC_OP; case PpAtomIncrement: return INC_OP; - case PpAtomConstInt: parserToken->sType.lex.i = ppToken.ival; return INTCONSTANT; - case PpAtomConstUint: parserToken->sType.lex.i = ppToken.ival; return UINTCONSTANT; - case PpAtomConstFloat: parserToken->sType.lex.d = ppToken.dval; return FLOATCONSTANT; - case PpAtomConstDouble: parserToken->sType.lex.d = ppToken.dval; return DOUBLECONSTANT; + case PpAtomConstInt: parserToken->sType.lex.i = ppToken.ival; return INTCONSTANT; + case PpAtomConstUint: parserToken->sType.lex.i = ppToken.ival; return UINTCONSTANT; + case PpAtomConstInt64: parserToken->sType.lex.i64 = ppToken.i64val; return INT64CONSTANT; + case PpAtomConstUint64: parserToken->sType.lex.i64 = ppToken.i64val; return UINT64CONSTANT; + case PpAtomConstFloat: parserToken->sType.lex.d = ppToken.dval; return FLOATCONSTANT; + case PpAtomConstDouble: parserToken->sType.lex.d = ppToken.dval; return DOUBLECONSTANT; case PpAtomIdentifier: { int token = tokenizeIdentifier(); @@ -914,6 +925,18 @@ int TScanContext::tokenizeIdentifier() reservedWord(); return keyword; + case INT64_T: + case UINT64_T: + case I64VEC2: + case I64VEC3: + case I64VEC4: + case U64VEC2: + case U64VEC3: + case U64VEC4: + if (parseContext.profile != EEsProfile && parseContext.version >= 450) + return keyword; + return identifierOrType(); + case SAMPLERCUBEARRAY: case SAMPLERCUBEARRAYSHADOW: case ISAMPLERCUBEARRAY: diff --git a/glslang/MachineIndependent/Scan.h b/glslang/MachineIndependent/Scan.h index 219049be..1cc437cb 100644 --- a/glslang/MachineIndependent/Scan.h +++ b/glslang/MachineIndependent/Scan.h @@ -54,7 +54,7 @@ public: TInputScanner(int n, const char* const s[], size_t L[], const char* const* names = nullptr, int b = 0, int f = 0, bool single = false) : numSources(n), sources(reinterpret_cast(s)), // up to this point, common usage is "char*", but now we need positive 8-bit characters - lengths(L), currentSource(0), currentChar(0), stringBias(b), finale(f), singleLogical(single) + lengths(L), currentSource(0), currentChar(0), stringBias(b), finale(f), singleLogical(single), endOfFileReached(false) { loc = new TSourceLoc[numSources]; for (int i = 0; i < numSources; ++i) { @@ -81,10 +81,8 @@ public: // retrieve the next character and advance one character int get() { - if (currentSource >= numSources) - return EndOfInput; - int ret = peek(); + if (ret == EndOfInput) return ret; ++loc[currentSource].column; ++logicalSourceLoc.column; if (ret == '\n') { @@ -101,8 +99,10 @@ public: // retrieve the next character, no advance int peek() { - if (currentSource >= numSources) + if (currentSource >= numSources) { + endOfFileReached = true; return EndOfInput; + } // Make sure we do not read off the end of a string. // N.B. Sources can have a length of 0. int sourceToRead = currentSource; @@ -122,6 +122,9 @@ public: // go back one character void unget() { + // Do not roll back once we've reached the end of the file. + if (endOfFileReached) return; + if (currentChar > 0) { --currentChar; --loc[currentSource].column; @@ -251,6 +254,10 @@ protected: TSourceLoc logicalSourceLoc; bool singleLogical; // treats the strings as a single logical string. // locations will be reported from the first string. + + // set to true once peak() returns EndOfFile, so that we won't roll back + // once we've reached EndOfFile. + bool endOfFileReached; }; } // end namespace glslang diff --git a/glslang/MachineIndependent/ScanContext.h b/glslang/MachineIndependent/ScanContext.h index 5f1ffb57..f237bee9 100644 --- a/glslang/MachineIndependent/ScanContext.h +++ b/glslang/MachineIndependent/ScanContext.h @@ -48,7 +48,7 @@ class TParserToken; class TScanContext { public: - explicit TScanContext(TParseContext& pc) : parseContext(pc), afterType(false), field(false) { } + explicit TScanContext(TParseContextBase& pc) : parseContext(pc), afterType(false), field(false) { } virtual ~TScanContext() { } static void fillInKeywordMap(); @@ -72,7 +72,7 @@ protected: int firstGenerationImage(bool inEs310); int secondGenerationImage(); - TParseContext& parseContext; + TParseContextBase& parseContext; bool afterType; // true if we've recognized a type, so can only be looking for an identifier bool field; // true if we're on a field, right after a '.' TSourceLoc loc; diff --git a/glslang/MachineIndependent/ShaderLang.cpp b/glslang/MachineIndependent/ShaderLang.cpp index 2a6e1e19..c2b56055 100644 --- a/glslang/MachineIndependent/ShaderLang.cpp +++ b/glslang/MachineIndependent/ShaderLang.cpp @@ -1,6 +1,6 @@ // //Copyright (C) 2002-2005 3Dlabs Inc. Ltd. -//Copyright (C) 2013-2015 LunarG, Inc. +//Copyright (C) 2013-2016 LunarG, Inc. //Copyright (C) 2015-2016 Google, Inc. // //All rights reserved. @@ -44,8 +44,11 @@ #include #include #include +#include #include "SymbolTable.h" #include "ParseHelper.h" +#include "../../hlsl/hlslParseHelper.h" +#include "../../hlsl/hlslParseables.h" #include "Scan.h" #include "ScanContext.h" @@ -63,6 +66,19 @@ namespace { // anonymous namespace for file-local functions and symbols using namespace glslang; +// Create a language specific version of parseables. +TBuiltInParseables* CreateBuiltInParseables(TInfoSink& infoSink, EShSource source) +{ + switch (source) { + case EShSourceGlsl: return new TBuiltIns(); // GLSL builtIns + case EShSourceHlsl: return new TBuiltInParseablesHlsl(); // HLSL intrinsics + + default: + infoSink.info.message(EPrefixInternalError, "Unable to determine source language"); + return nullptr; + } +} + // Local mapping functions for making arrays of symbol tables.... int MapVersionToIndex(int version) @@ -150,6 +166,9 @@ bool InitializeSymbolTable(const TString& builtIns, int version, EProfile profil builtInShaders[0] = builtIns.c_str(); builtInLengths[0] = builtIns.size(); + if (builtInLengths[0] == 0) + return true; + TInputScanner input(1, builtInShaders, builtInLengths); if (! parseContext.parseShaderStrings(ppContext, input) != 0) { infoSink.info.message(EPrefixInternalError, "Unable to parse built-ins"); @@ -170,11 +189,12 @@ int CommonIndex(EProfile profile, EShLanguage language) // // To initialize per-stage shared tables, with the common table already complete. // -void InitializeStageSymbolTable(TBuiltIns& builtIns, int version, EProfile profile, int spv, int vulkan, EShLanguage language, TInfoSink& infoSink, TSymbolTable** commonTable, TSymbolTable** symbolTables) +void InitializeStageSymbolTable(TBuiltInParseables& builtInParseables, int version, EProfile profile, int spv, int vulkan, + EShLanguage language, TInfoSink& infoSink, TSymbolTable** commonTable, TSymbolTable** symbolTables) { (*symbolTables[language]).adoptLevels(*commonTable[CommonIndex(profile, language)]); - InitializeSymbolTable(builtIns.getStageString(language), version, profile, spv, vulkan, language, infoSink, *symbolTables[language]); - IdentifyBuiltIns(version, profile, spv, vulkan, language, *symbolTables[language]); + InitializeSymbolTable(builtInParseables.getStageString(language), version, profile, spv, vulkan, language, infoSink, *symbolTables[language]); + builtInParseables.identifyBuiltIns(version, profile, spv, vulkan, language, *symbolTables[language]); if (profile == EEsProfile && version >= 300) (*symbolTables[language]).setNoBuiltInRedeclarations(); if (version == 110) @@ -185,49 +205,51 @@ void InitializeStageSymbolTable(TBuiltIns& builtIns, int version, EProfile profi // Initialize the full set of shareable symbol tables; // The common (cross-stage) and those shareable per-stage. // -bool InitializeSymbolTables(TInfoSink& infoSink, TSymbolTable** commonTable, TSymbolTable** symbolTables, int version, EProfile profile, int spv, int vulkan) +bool InitializeSymbolTables(TInfoSink& infoSink, TSymbolTable** commonTable, TSymbolTable** symbolTables, int version, EProfile profile, int spv, int vulkan, EShSource source) { - TBuiltIns builtIns; - builtIns.initialize(version, profile, spv, vulkan); + std::unique_ptr builtInParseables(CreateBuiltInParseables(infoSink, source)); + + builtInParseables->initialize(version, profile, spv, vulkan); // do the common tables - InitializeSymbolTable(builtIns.getCommonString(), version, profile, spv, vulkan, EShLangVertex, infoSink, *commonTable[EPcGeneral]); + InitializeSymbolTable(builtInParseables->getCommonString(), version, profile, spv, vulkan, EShLangVertex, infoSink, *commonTable[EPcGeneral]); if (profile == EEsProfile) - InitializeSymbolTable(builtIns.getCommonString(), version, profile, spv, vulkan, EShLangFragment, infoSink, *commonTable[EPcFragment]); + InitializeSymbolTable(builtInParseables->getCommonString(), version, profile, spv, vulkan, EShLangFragment, infoSink, *commonTable[EPcFragment]); // do the per-stage tables // always have vertex and fragment - InitializeStageSymbolTable(builtIns, version, profile, spv, vulkan, EShLangVertex, infoSink, commonTable, symbolTables); - InitializeStageSymbolTable(builtIns, version, profile, spv, vulkan, EShLangFragment, infoSink, commonTable, symbolTables); + InitializeStageSymbolTable(*builtInParseables, version, profile, spv, vulkan, EShLangVertex, infoSink, commonTable, symbolTables); + InitializeStageSymbolTable(*builtInParseables, version, profile, spv, vulkan, EShLangFragment, infoSink, commonTable, symbolTables); // check for tessellation if ((profile != EEsProfile && version >= 150) || (profile == EEsProfile && version >= 310)) { - InitializeStageSymbolTable(builtIns, version, profile, spv, vulkan, EShLangTessControl, infoSink, commonTable, symbolTables); - InitializeStageSymbolTable(builtIns, version, profile, spv, vulkan, EShLangTessEvaluation, infoSink, commonTable, symbolTables); + InitializeStageSymbolTable(*builtInParseables, version, profile, spv, vulkan, EShLangTessControl, infoSink, commonTable, symbolTables); + InitializeStageSymbolTable(*builtInParseables, version, profile, spv, vulkan, EShLangTessEvaluation, infoSink, commonTable, symbolTables); } // check for geometry if ((profile != EEsProfile && version >= 150) || (profile == EEsProfile && version >= 310)) - InitializeStageSymbolTable(builtIns, version, profile, spv, vulkan, EShLangGeometry, infoSink, commonTable, symbolTables); + InitializeStageSymbolTable(*builtInParseables, version, profile, spv, vulkan, EShLangGeometry, infoSink, commonTable, symbolTables); // check for compute - if ((profile != EEsProfile && version >= 430) || + if ((profile != EEsProfile && version >= 420) || (profile == EEsProfile && version >= 310)) - InitializeStageSymbolTable(builtIns, version, profile, spv, vulkan, EShLangCompute, infoSink, commonTable, symbolTables); + InitializeStageSymbolTable(*builtInParseables, version, profile, spv, vulkan, EShLangCompute, infoSink, commonTable, symbolTables); return true; } -bool AddContextSpecificSymbols(const TBuiltInResource* resources, TInfoSink& infoSink, TSymbolTable& symbolTable, int version, EProfile profile, int spv, int vulkan, EShLanguage language) +bool AddContextSpecificSymbols(const TBuiltInResource* resources, TInfoSink& infoSink, TSymbolTable& symbolTable, int version, + EProfile profile, int spv, int vulkan, EShLanguage language, EShSource source) { - TBuiltIns builtIns; + std::unique_ptr builtInParseables(CreateBuiltInParseables(infoSink, source)); - builtIns.initialize(*resources, version, profile, spv, vulkan, language); - InitializeSymbolTable(builtIns.getCommonString(), version, profile, spv, vulkan, language, infoSink, symbolTable); - IdentifyBuiltIns(version, profile, spv, vulkan, language, symbolTable, *resources); + builtInParseables->initialize(*resources, version, profile, spv, vulkan, language); + InitializeSymbolTable(builtInParseables->getCommonString(), version, profile, spv, vulkan, language, infoSink, symbolTable); + builtInParseables->identifyBuiltIns(version, profile, spv, vulkan, language, symbolTable, *resources); return true; } @@ -244,7 +266,7 @@ bool AddContextSpecificSymbols(const TBuiltInResource* resources, TInfoSink& inf // This only gets done the first time any thread needs a particular symbol table // (lazy evaluation). // -void SetupBuiltinSymbolTable(int version, EProfile profile, int spv, int vulkan) +void SetupBuiltinSymbolTable(int version, EProfile profile, int spv, int vulkan, EShSource source) { TInfoSink infoSink; @@ -274,7 +296,7 @@ void SetupBuiltinSymbolTable(int version, EProfile profile, int spv, int vulkan) stageTables[stage] = new TSymbolTable; // Generate the local symbol tables using the new pool - InitializeSymbolTables(infoSink, commonTable, stageTables, version, profile, spv, vulkan); + InitializeSymbolTables(infoSink, commonTable, stageTables, version, profile, spv, vulkan, source); // Switch to the process-global pool SetThreadPoolAllocator(*PerProcessGPA); @@ -308,11 +330,19 @@ void SetupBuiltinSymbolTable(int version, EProfile profile, int spv, int vulkan) glslang::ReleaseGlobalLock(); } -bool DeduceVersionProfile(TInfoSink& infoSink, EShLanguage stage, bool versionNotFirst, int defaultVersion, int& version, EProfile& profile, int spv) +// Return true if the shader was correctly specified for version/profile/stage. +bool DeduceVersionProfile(TInfoSink& infoSink, EShLanguage stage, bool versionNotFirst, int defaultVersion, + EShSource source, int& version, EProfile& profile, int spv) { const int FirstProfileVersion = 150; bool correct = true; + if (source == EShSourceHlsl) { + version = 450; // TODO: GLSL parser is still used for builtins. + profile = ENoProfile; + return correct; + } + // Get a good version... if (version == 0) { version = defaultVersion; @@ -387,7 +417,7 @@ bool DeduceVersionProfile(TInfoSink& infoSink, EShLanguage stage, bool versionNo (profile != EEsProfile && version < 420)) { correct = false; infoSink.info.message(EPrefixError, "#version: compute shaders require es profile with version 310 or above, or non-es profile with version 420 or above"); - version = profile == EEsProfile ? 310 : 430; // 420 supports the extension, correction is to 430 which does not + version = profile == EEsProfile ? 310 : 420; } break; default: @@ -457,7 +487,7 @@ bool DeduceVersionProfile(TInfoSink& infoSink, EShLanguage stage, bool versionNo // This is the common setup and cleanup code for PreprocessDeferred and // CompileDeferred. // It takes any callable with a signature of -// bool (TParseContext& parseContext, TPpContext& ppContext, +// bool (TParseContextBase& parseContext, TPpContext& ppContext, // TInputScanner& input, bool versionWillBeError, // TSymbolTable& , TIntermediate& , // EShOptimizationLevel , EShMessages ); @@ -552,7 +582,8 @@ bool ProcessDeferred( profile = defaultProfile; } int spv = (messages & EShMsgSpvRules) ? 100 : 0; // TODO find path to get real version number here, for now non-0 is what matters - bool goodVersion = DeduceVersionProfile(compiler->infoSink, compiler->getLanguage(), versionNotFirst, defaultVersion, version, profile, spv); + EShSource source = (messages & EShMsgReadHlsl) ? EShSourceHlsl : EShSourceGlsl; + bool goodVersion = DeduceVersionProfile(compiler->infoSink, compiler->getLanguage(), versionNotFirst, defaultVersion, source, version, profile, spv); bool versionWillBeError = (versionNotFound || (profile == EEsProfile && version >= 300 && versionNotFirst)); bool warnVersionNotFirst = false; if (! versionWillBeError && versionNotFirstToken) { @@ -563,12 +594,13 @@ bool ProcessDeferred( } int vulkan = (messages & EShMsgVulkanRules) ? 100 : 0; // TODO find path to get real version number here, for now non-0 is what matters + intermediate.setSource(source); intermediate.setVersion(version); intermediate.setProfile(profile); intermediate.setSpv(spv); if (vulkan) intermediate.setOriginUpperLeft(); - SetupBuiltinSymbolTable(version, profile, spv, vulkan); + SetupBuiltinSymbolTable(version, profile, spv, vulkan, source); TSymbolTable* cachedTable = SharedSymbolTables[MapVersionToIndex(version)] [MapProfileToIndex(profile)] @@ -582,31 +614,46 @@ bool ProcessDeferred( // Add built-in symbols that are potentially context dependent; // they get popped again further down. - AddContextSpecificSymbols(resources, compiler->infoSink, symbolTable, version, profile, spv, vulkan, compiler->getLanguage()); + AddContextSpecificSymbols(resources, compiler->infoSink, symbolTable, version, profile, spv, vulkan, + compiler->getLanguage(), source); // // Now we can process the full shader under proper symbols and rules. // - TParseContext parseContext(symbolTable, intermediate, false, version, profile, spv, vulkan, compiler->getLanguage(), compiler->infoSink, forwardCompatible, messages); - glslang::TScanContext scanContext(parseContext); - TPpContext ppContext(parseContext, names[numPre]? names[numPre]: "", includer); - parseContext.setScanContext(&scanContext); - parseContext.setPpContext(&ppContext); - parseContext.setLimits(*resources); + TParseContextBase* parseContext; + if (source == EShSourceHlsl) { + parseContext = new HlslParseContext(symbolTable, intermediate, false, version, profile, spv, vulkan, + compiler->getLanguage(), compiler->infoSink, forwardCompatible, messages); + } + else { + intermediate.setEntryPoint("main"); + parseContext = new TParseContext(symbolTable, intermediate, false, version, profile, spv, vulkan, + compiler->getLanguage(), compiler->infoSink, forwardCompatible, messages); + } + TPpContext ppContext(*parseContext, names[numPre]? names[numPre]: "", includer); + + // only GLSL (bison triggered, really) needs an externally set scan context + glslang::TScanContext scanContext(*parseContext); + if ((messages & EShMsgReadHlsl) == 0) + parseContext->setScanContext(&scanContext); + + parseContext->setPpContext(&ppContext); + parseContext->setLimits(*resources); if (! goodVersion) - parseContext.addError(); + parseContext->addError(); if (warnVersionNotFirst) { TSourceLoc loc; loc.init(); - parseContext.warn(loc, "Illegal to have non-comment, non-whitespace tokens before #version", "#version", ""); + parseContext->warn(loc, "Illegal to have non-comment, non-whitespace tokens before #version", "#version", ""); } - parseContext.initializeExtensionBehavior(); - + parseContext->initializeExtensionBehavior(); // Fill in the strings as outlined above. - strings[0] = parseContext.getPreamble(); + std::string preamble; + parseContext->getPreamble(preamble); + strings[0] = preamble.c_str(); lengths[0] = strlen(strings[0]); names[0] = nullptr; strings[1] = customPreamble; @@ -624,14 +671,14 @@ bool ProcessDeferred( // Push a new symbol allocation scope that will get used for the shader's globals. symbolTable.push(); - bool success = processingContext(parseContext, ppContext, fullInput, + bool success = processingContext(*parseContext, ppContext, fullInput, versionWillBeError, symbolTable, intermediate, optLevel, messages); // Clean up the symbol table. The AST is self-sufficient now. delete symbolTableMemory; - + delete parseContext; delete [] lengths; delete [] strings; delete [] names; @@ -706,7 +753,7 @@ private: // It places the result in the "string" argument to its constructor. struct DoPreprocessing { explicit DoPreprocessing(std::string* string): outputString(string) {} - bool operator()(TParseContext& parseContext, TPpContext& ppContext, + bool operator()(TParseContextBase& parseContext, TPpContext& ppContext, TInputScanner& input, bool versionWillBeError, TSymbolTable& , TIntermediate& , EShOptimizationLevel , EShMessages ) @@ -817,7 +864,7 @@ struct DoPreprocessing { // DoFullParse is a valid ProcessingConext template argument for fully // parsing the shader. It populates the "intermediate" with the AST. struct DoFullParse{ - bool operator()(TParseContext& parseContext, TPpContext& ppContext, + bool operator()(TParseContextBase& parseContext, TPpContext& ppContext, TInputScanner& fullInput, bool versionWillBeError, TSymbolTable& symbolTable, TIntermediate& intermediate, EShOptimizationLevel optLevel, EShMessages messages) @@ -826,13 +873,13 @@ struct DoFullParse{ // Parse the full shader. if (! parseContext.parseShaderStrings(ppContext, fullInput, versionWillBeError)) success = false; - intermediate.addSymbolLinkageNodes(parseContext.linkage, parseContext.language, symbolTable); + intermediate.addSymbolLinkageNodes(parseContext.getLinkage(), parseContext.getLanguage(), symbolTable); if (success && intermediate.getTreeRoot()) { if (optLevel == EShOptNoGeneration) parseContext.infoSink.info.message(EPrefixNone, "No errors. No code generation or linking was requested."); else - success = intermediate.postProcess(intermediate.getTreeRoot(), parseContext.language); + success = intermediate.postProcess(intermediate.getTreeRoot(), parseContext.getLanguage()); } else if (! success) { parseContext.infoSink.info.prefix(EPrefixError); parseContext.infoSink.info << parseContext.getNumErrors() << " compilation errors. No code generated.\n\n"; @@ -1356,6 +1403,11 @@ void TShader::setStringsWithLengthsAndNames( stringNames = names; } +void TShader::setEntryPoint(const char* entryPoint) +{ + intermediate->setEntryPoint(entryPoint); +} + // // Turn the shader strings into a parse tree in the TIntermediate. // @@ -1474,14 +1526,34 @@ bool TProgram::linkStage(EShLanguage stage, EShMessages messages) if (stages[stage].size() == 0) return true; + int numEsShaders = 0, numNonEsShaders = 0; + for (auto it = stages[stage].begin(); it != stages[stage].end(); ++it) { + if ((*it)->intermediate->getProfile() == EEsProfile) { + numEsShaders++; + } else { + numNonEsShaders++; + } + } + + if (numEsShaders > 0 && numNonEsShaders > 0) { + infoSink->info.message(EPrefixError, "Cannot mix ES profile with non-ES profile shaders"); + return false; + } else if (numEsShaders > 1) { + infoSink->info.message(EPrefixError, "Cannot attach multiple ES shaders of the same type to a single program"); + return false; + } + // // Be efficient for the common single compilation unit per stage case, // reusing it's TIntermediate instead of merging into a new one. // + TIntermediate *firstIntermediate = stages[stage].front()->intermediate; if (stages[stage].size() == 1) - intermediate[stage] = stages[stage].front()->intermediate; + intermediate[stage] = firstIntermediate; else { - intermediate[stage] = new TIntermediate(stage); + intermediate[stage] = new TIntermediate(stage, + firstIntermediate->getVersion(), + firstIntermediate->getProfile()); newedIntermediate[stage] = true; } @@ -1542,6 +1614,9 @@ int TProgram::getUniformBlockIndex(int index) { return reflection->getUni int TProgram::getUniformType(int index) { return reflection->getUniform(index).glDefineType; } int TProgram::getUniformBufferOffset(int index) { return reflection->getUniform(index).offset; } int TProgram::getUniformArraySize(int index) { return reflection->getUniform(index).size; } +int TProgram::getNumLiveAttributes() { return reflection->getNumAttributes(); } +const char* TProgram::getAttributeName(int index) { return reflection->getAttribute(index).name.c_str(); } +int TProgram::getAttributeType(int index) { return reflection->getAttribute(index).glDefineType; } void TProgram::dumpReflection() { reflection->dump(); } diff --git a/glslang/MachineIndependent/SymbolTable.cpp b/glslang/MachineIndependent/SymbolTable.cpp index 75f50402..bf0f1f9f 100644 --- a/glslang/MachineIndependent/SymbolTable.cpp +++ b/glslang/MachineIndependent/SymbolTable.cpp @@ -62,6 +62,8 @@ void TType::buildMangledName(TString& mangledName) case EbtDouble: mangledName += 'd'; break; case EbtInt: mangledName += 'i'; break; case EbtUint: mangledName += 'u'; break; + case EbtInt64: mangledName += "i64"; break; + case EbtUint64: mangledName += "u64"; break; case EbtBool: mangledName += 'b'; break; case EbtAtomicUint: mangledName += "au"; break; case EbtSampler: @@ -71,9 +73,13 @@ void TType::buildMangledName(TString& mangledName) default: break; // some compilers want this } if (sampler.image) - mangledName += "I"; + mangledName += "I"; // a normal image + else if (sampler.sampler) + mangledName += "p"; // a "pure" sampler + else if (!sampler.combined) + mangledName += "t"; // a "pure" texture else - mangledName += "s"; + mangledName += "s"; // traditional combined sampler if (sampler.arrayed) mangledName += "A"; if (sampler.shadow) diff --git a/glslang/MachineIndependent/Versions.cpp b/glslang/MachineIndependent/Versions.cpp index 676f4fd6..c1192071 100644 --- a/glslang/MachineIndependent/Versions.cpp +++ b/glslang/MachineIndependent/Versions.cpp @@ -74,12 +74,12 @@ // // const char* const XXX_extension_X = "XXX_extension_X"; // -// 2) Add extension initialization to TParseContext::initializeExtensionBehavior(), +// 2) Add extension initialization to TParseVersions::initializeExtensionBehavior(), // the first function below: // // extensionBehavior[XXX_extension_X] = EBhDisable; // -// 3) Add any preprocessor directives etc. in the next function, TParseContext::getPreamble(): +// 3) Add any preprocessor directives etc. in the next function, TParseVersions::getPreamble(): // // "#define XXX_extension_X 1\n" // @@ -138,7 +138,8 @@ // table. (There is a different symbol table for each version.) // -#include "ParseHelper.h" +#include "parseVersions.h" +#include "localintermediate.h" namespace glslang { @@ -147,7 +148,7 @@ namespace glslang { // are incorporated into a core version, their features are supported through allowing that // core version, not through a pseudo-enablement of the extension. // -void TParseContext::initializeExtensionBehavior() +void TParseVersions::initializeExtensionBehavior() { extensionBehavior[E_GL_OES_texture_3D] = EBhDisable; extensionBehavior[E_GL_OES_standard_derivatives] = EBhDisable; @@ -161,7 +162,7 @@ void TParseContext::initializeExtensionBehavior() extensionBehavior[E_GL_ARB_texture_gather] = EBhDisable; extensionBehavior[E_GL_ARB_gpu_shader5] = EBhDisablePartial; extensionBehavior[E_GL_ARB_separate_shader_objects] = EBhDisable; - extensionBehavior[E_GL_ARB_compute_shader] = EBhDisablePartial; + extensionBehavior[E_GL_ARB_compute_shader] = EBhDisable; extensionBehavior[E_GL_ARB_tessellation_shader] = EBhDisable; extensionBehavior[E_GL_ARB_enhanced_layouts] = EBhDisable; extensionBehavior[E_GL_ARB_texture_cube_map_array] = EBhDisable; @@ -170,10 +171,13 @@ void TParseContext::initializeExtensionBehavior() extensionBehavior[E_GL_ARB_shader_image_load_store] = EBhDisable; extensionBehavior[E_GL_ARB_shader_atomic_counters] = EBhDisable; extensionBehavior[E_GL_ARB_shader_draw_parameters] = EBhDisable; + extensionBehavior[E_GL_ARB_shader_group_vote] = EBhDisable; extensionBehavior[E_GL_ARB_derivative_control] = EBhDisable; extensionBehavior[E_GL_ARB_shader_texture_image_samples] = EBhDisable; extensionBehavior[E_GL_ARB_viewport_array] = EBhDisable; + extensionBehavior[E_GL_ARB_gpu_shader_int64] = EBhDisable; extensionBehavior[E_GL_ARB_gl_spirv] = EBhDisable; + extensionBehavior[E_GL_ARB_shader_ballot] = EBhDisable; extensionBehavior[E_GL_ARB_sparse_texture2] = EBhDisable; extensionBehavior[E_GL_ARB_sparse_texture_clamp] = EBhDisable; // extensionBehavior[E_GL_ARB_cull_distance] = EBhDisable; // present for 4.5, but need extension control over block members @@ -213,10 +217,10 @@ void TParseContext::initializeExtensionBehavior() // Get code that is not part of a shared symbol table, is specific to this shader, // or needed by the preprocessor (which does not use a shared symbol table). -const char* TParseContext::getPreamble() +void TParseVersions::getPreamble(std::string& preamble) { if (profile == EEsProfile) { - return + preamble = "#define GL_ES 1\n" "#define GL_FRAGMENT_PRECISION_HIGH 1\n" "#define GL_OES_texture_3D 1\n" @@ -225,10 +229,6 @@ const char* TParseContext::getPreamble() "#define GL_OES_EGL_image_external 1\n" "#define GL_EXT_shader_texture_lod 1\n" - // #line and #include - "#define GL_GOOGLE_cpp_style_line_directive 1\n" - "#define GL_GOOGLE_include_directive 1\n" - // AEP "#define GL_ANDROID_extension_pack_es31a 1\n" "#define GL_KHR_blend_equation_advanced 1\n" @@ -258,7 +258,7 @@ const char* TParseContext::getPreamble() "#define GL_OES_texture_cube_map_array 1\n" ; } else { - return + preamble = "#define GL_FRAGMENT_PRECISION_HIGH 1\n" "#define GL_ARB_texture_rectangle 1\n" "#define GL_ARB_shading_language_420pack 1\n" @@ -274,18 +274,27 @@ const char* TParseContext::getPreamble() "#define GL_ARB_shader_image_load_store 1\n" "#define GL_ARB_shader_atomic_counters 1\n" "#define GL_ARB_shader_draw_parameters 1\n" + "#define GL_ARB_shader_group_vote 1\n" "#define GL_ARB_derivative_control 1\n" "#define GL_ARB_shader_texture_image_samples 1\n" "#define GL_ARB_viewport_array 1\n" + "#define GL_ARB_gpu_shader_int64 1\n" "#define GL_ARB_gl_spirv 1\n" + "#define GL_ARB_shader_ballot 1\n" "#define GL_ARB_sparse_texture2 1\n" "#define GL_ARB_sparse_texture_clamp 1\n" - - "#define GL_GOOGLE_cpp_style_line_directive 1\n" - "#define GL_GOOGLE_include_directive 1\n" // "#define GL_ARB_cull_distance 1\n" // present for 4.5, but need extension control over block members ; } + + // #line and #include + preamble += + "#define GL_GOOGLE_cpp_style_line_directive 1\n" + "#define GL_GOOGLE_include_directive 1\n" + ; + + if (vulkan > 0) + preamble += "#define VULKAN 100\n"; } // @@ -297,7 +306,7 @@ const char* TParseContext::getPreamble() // Operation: If the current profile is not one of the profileMask, // give an error message. // -void TParseContext::requireProfile(const TSourceLoc& loc, int profileMask, const char* featureDesc) +void TParseVersions::requireProfile(const TSourceLoc& loc, int profileMask, const char* featureDesc) { if (! (profile & profileMask)) error(loc, "not supported with this profile:", featureDesc, ProfileName(profile)); @@ -336,7 +345,7 @@ const char* StageName(EShLanguage stage) // // entry point that takes multiple extensions -void TParseContext::profileRequires(const TSourceLoc& loc, int profileMask, int minVersion, int numExtensions, const char* const extensions[], const char* featureDesc) +void TParseVersions::profileRequires(const TSourceLoc& loc, int profileMask, int minVersion, int numExtensions, const char* const extensions[], const char* featureDesc) { if (profile & profileMask) { bool okay = false; @@ -361,7 +370,7 @@ void TParseContext::profileRequires(const TSourceLoc& loc, int profileMask, int } // entry point for the above that takes a single extension -void TParseContext::profileRequires(const TSourceLoc& loc, int profileMask, int minVersion, const char* extension, const char* featureDesc) +void TParseVersions::profileRequires(const TSourceLoc& loc, int profileMask, int minVersion, const char* extension, const char* featureDesc) { profileRequires(loc, profileMask, minVersion, extension ? 1 : 0, &extension, featureDesc); } @@ -373,7 +382,7 @@ void TParseContext::profileRequires(const TSourceLoc& loc, int profileMask, int // // Operation: If the current stage is not present, give an error message. // -void TParseContext::requireStage(const TSourceLoc& loc, EShLanguageMask languageMask, const char* featureDesc) +void TParseVersions::requireStage(const TSourceLoc& loc, EShLanguageMask languageMask, const char* featureDesc) { if (((1 << language) & languageMask) == 0) error(loc, "not supported in this stage:", featureDesc, StageName(language)); @@ -381,7 +390,7 @@ void TParseContext::requireStage(const TSourceLoc& loc, EShLanguageMask language // If only one stage supports a feature, this can be called. But, all supporting stages // must be specified with one call. -void TParseContext::requireStage(const TSourceLoc& loc, EShLanguage stage, const char* featureDesc) +void TParseVersions::requireStage(const TSourceLoc& loc, EShLanguage stage, const char* featureDesc) { requireStage(loc, static_cast(1 << stage), featureDesc); } @@ -390,7 +399,7 @@ void TParseContext::requireStage(const TSourceLoc& loc, EShLanguage stage, const // Within a set of profiles, see if a feature is deprecated and give an error or warning based on whether // a future compatibility context is being use. // -void TParseContext::checkDeprecated(const TSourceLoc& loc, int profileMask, int depVersion, const char* featureDesc) +void TParseVersions::checkDeprecated(const TSourceLoc& loc, int profileMask, int depVersion, const char* featureDesc) { if (profile & profileMask) { if (version >= depVersion) { @@ -407,7 +416,7 @@ void TParseContext::checkDeprecated(const TSourceLoc& loc, int profileMask, int // Within a set of profiles, see if a feature has now been removed and if so, give an error. // The version argument is the first version no longer having the feature. // -void TParseContext::requireNotRemoved(const TSourceLoc& loc, int profileMask, int removedVersion, const char* featureDesc) +void TParseVersions::requireNotRemoved(const TSourceLoc& loc, int profileMask, int removedVersion, const char* featureDesc) { if (profile & profileMask) { if (version >= removedVersion) { @@ -421,7 +430,7 @@ void TParseContext::requireNotRemoved(const TSourceLoc& loc, int profileMask, in // Returns true if at least one of the extensions in the extensions parameter is requested. Otherwise, returns false. // Warns appropriately if the requested behavior of an extension is "warn". -bool TParseContext::checkExtensionsRequested(const TSourceLoc& loc, int numExtensions, const char* const extensions[], const char* featureDesc) +bool TParseVersions::checkExtensionsRequested(const TSourceLoc& loc, int numExtensions, const char* const extensions[], const char* featureDesc) { // First, see if any of the extensions are enabled for (int i = 0; i < numExtensions; ++i) { @@ -452,7 +461,7 @@ bool TParseContext::checkExtensionsRequested(const TSourceLoc& loc, int numExten // Use when there are no profile/version to check, it's just an error if one of the // extensions is not present. // -void TParseContext::requireExtensions(const TSourceLoc& loc, int numExtensions, const char* const extensions[], const char* featureDesc) +void TParseVersions::requireExtensions(const TSourceLoc& loc, int numExtensions, const char* const extensions[], const char* featureDesc) { if (checkExtensionsRequested(loc, numExtensions, extensions, featureDesc)) return; @@ -470,7 +479,7 @@ void TParseContext::requireExtensions(const TSourceLoc& loc, int numExtensions, // Use by preprocessor when there are no profile/version to check, it's just an error if one of the // extensions is not present. // -void TParseContext::ppRequireExtensions(const TSourceLoc& loc, int numExtensions, const char* const extensions[], const char* featureDesc) +void TParseVersions::ppRequireExtensions(const TSourceLoc& loc, int numExtensions, const char* const extensions[], const char* featureDesc) { if (checkExtensionsRequested(loc, numExtensions, extensions, featureDesc)) return; @@ -484,7 +493,7 @@ void TParseContext::ppRequireExtensions(const TSourceLoc& loc, int numExtensions } } -TExtensionBehavior TParseContext::getExtensionBehavior(const char* extension) +TExtensionBehavior TParseVersions::getExtensionBehavior(const char* extension) { auto iter = extensionBehavior.find(TString(extension)); if (iter == extensionBehavior.end()) @@ -494,7 +503,7 @@ TExtensionBehavior TParseContext::getExtensionBehavior(const char* extension) } // Returns true if the given extension is set to enable, require, or warn. -bool TParseContext::extensionTurnedOn(const char* const extension) +bool TParseVersions::extensionTurnedOn(const char* const extension) { switch (getExtensionBehavior(extension)) { case EBhEnable: @@ -507,7 +516,7 @@ bool TParseContext::extensionTurnedOn(const char* const extension) return false; } // See if any of the extensions are set to enable, require, or warn. -bool TParseContext::extensionsTurnedOn(int numExtensions, const char* const extensions[]) +bool TParseVersions::extensionsTurnedOn(int numExtensions, const char* const extensions[]) { for (int i = 0; i < numExtensions; ++i) { if (extensionTurnedOn(extensions[i])) return true; @@ -518,7 +527,7 @@ bool TParseContext::extensionsTurnedOn(int numExtensions, const char* const exte // // Change the current state of an extension's behavior. // -void TParseContext::updateExtensionBehavior(int line, const char* extension, const char* behaviorString) +void TParseVersions::updateExtensionBehavior(int line, const char* extension, const char* behaviorString) { // Translate from text string of extension's behavior to an enum. TExtensionBehavior behavior = EBhDisable; @@ -571,7 +580,7 @@ void TParseContext::updateExtensionBehavior(int line, const char* extension, con spv = 100; } -void TParseContext::updateExtensionBehavior(const char* extension, TExtensionBehavior behavior) +void TParseVersions::updateExtensionBehavior(const char* extension, TExtensionBehavior behavior) { // Update the current behavior if (strcmp(extension, "all") == 0) { @@ -612,43 +621,54 @@ void TParseContext::updateExtensionBehavior(const char* extension, TExtensionBeh } // Call for any operation needing full GLSL integer data-type support. -void TParseContext::fullIntegerCheck(const TSourceLoc& loc, const char* op) +void TParseVersions::fullIntegerCheck(const TSourceLoc& loc, const char* op) { profileRequires(loc, ENoProfile, 130, nullptr, op); profileRequires(loc, EEsProfile, 300, nullptr, op); } // Call for any operation needing GLSL double data-type support. -void TParseContext::doubleCheck(const TSourceLoc& loc, const char* op) +void TParseVersions::doubleCheck(const TSourceLoc& loc, const char* op) { requireProfile(loc, ECoreProfile | ECompatibilityProfile, op); profileRequires(loc, ECoreProfile, 400, nullptr, op); profileRequires(loc, ECompatibilityProfile, 400, nullptr, op); } +// Call for any operation needing GLSL 64-bit integer data-type support. +void TParseVersions::int64Check(const TSourceLoc& loc, const char* op, bool builtIn) +{ + if (! builtIn) { + requireExtensions(loc, 1, &E_GL_ARB_gpu_shader_int64, "shader int64"); + requireProfile(loc, ECoreProfile | ECompatibilityProfile, op); + profileRequires(loc, ECoreProfile, 450, nullptr, op); + profileRequires(loc, ECompatibilityProfile, 450, nullptr, op); + } +} + // Call for any operation removed because SPIR-V is in use. -void TParseContext::spvRemoved(const TSourceLoc& loc, const char* op) +void TParseVersions::spvRemoved(const TSourceLoc& loc, const char* op) { if (spv > 0) error(loc, "not allowed when generating SPIR-V", op, ""); } // Call for any operation removed because Vulkan SPIR-V is being generated. -void TParseContext::vulkanRemoved(const TSourceLoc& loc, const char* op) +void TParseVersions::vulkanRemoved(const TSourceLoc& loc, const char* op) { if (vulkan > 0) error(loc, "not allowed when using GLSL for Vulkan", op, ""); } // Call for any operation that requires Vulkan. -void TParseContext::requireVulkan(const TSourceLoc& loc, const char* op) +void TParseVersions::requireVulkan(const TSourceLoc& loc, const char* op) { if (vulkan == 0) error(loc, "only allowed when using GLSL for Vulkan", op, ""); } // Call for any operation that requires SPIR-V. -void TParseContext::requireSpv(const TSourceLoc& loc, const char* op) +void TParseVersions::requireSpv(const TSourceLoc& loc, const char* op) { if (spv == 0) error(loc, "only allowed when generating SPIR-V", op, ""); diff --git a/glslang/MachineIndependent/Versions.h b/glslang/MachineIndependent/Versions.h index d022d876..ba08ca3c 100644 --- a/glslang/MachineIndependent/Versions.h +++ b/glslang/MachineIndependent/Versions.h @@ -108,10 +108,13 @@ const char* const E_GL_ARB_explicit_attrib_location = "GL_ARB_explicit_attri const char* const E_GL_ARB_shader_image_load_store = "GL_ARB_shader_image_load_store"; const char* const E_GL_ARB_shader_atomic_counters = "GL_ARB_shader_atomic_counters"; const char* const E_GL_ARB_shader_draw_parameters = "GL_ARB_shader_draw_parameters"; +const char* const E_GL_ARB_shader_group_vote = "GL_ARB_shader_group_vote"; const char* const E_GL_ARB_derivative_control = "GL_ARB_derivative_control"; const char* const E_GL_ARB_shader_texture_image_samples = "GL_ARB_shader_texture_image_samples"; const char* const E_GL_ARB_viewport_array = "GL_ARB_viewport_array"; +const char* const E_GL_ARB_gpu_shader_int64 = "GL_ARB_gpu_shader_int64"; const char* const E_GL_ARB_gl_spirv = "GL_ARB_gl_spirv"; +const char* const E_GL_ARB_shader_ballot = "GL_ARB_shader_ballot"; const char* const E_GL_ARB_sparse_texture2 = "GL_ARB_sparse_texture2"; const char* const E_GL_ARB_sparse_texture_clamp = "GL_ARB_sparse_texture_clamp"; //const char* const E_GL_ARB_cull_distance = "GL_ARB_cull_distance"; // present for 4.5, but need extension control over block members diff --git a/glslang/MachineIndependent/gl_types.h b/glslang/MachineIndependent/gl_types.h index 91603b5b..9e877d37 100644 --- a/glslang/MachineIndependent/gl_types.h +++ b/glslang/MachineIndependent/gl_types.h @@ -41,6 +41,16 @@ #define GL_UNSIGNED_INT_VEC3 0x8DC7 #define GL_UNSIGNED_INT_VEC4 0x8DC8 +#define GL_INT64_ARB 0x140E +#define GL_INT64_VEC2_ARB 0x8FE9 +#define GL_INT64_VEC3_ARB 0x8FEA +#define GL_INT64_VEC4_ARB 0x8FEB + +#define GL_UNSIGNED_INT64_ARB 0x140F +#define GL_UNSIGNED_INT64_VEC2_ARB 0x8FE5 +#define GL_UNSIGNED_INT64_VEC3_ARB 0x8FE6 +#define GL_UNSIGNED_INT64_VEC4_ARB 0x8FE7 + #define GL_BOOL 0x8B56 #define GL_BOOL_VEC2 0x8B57 #define GL_BOOL_VEC3 0x8B58 diff --git a/glslang/MachineIndependent/glslang.y b/glslang/MachineIndependent/glslang.y index 847bcc9a..4f8e3fc1 100644 --- a/glslang/MachineIndependent/glslang.y +++ b/glslang/MachineIndependent/glslang.y @@ -70,6 +70,8 @@ using namespace glslang; glslang::TString *string; int i; unsigned int u; + long long i64; + unsigned long long u64; bool b; double d; }; @@ -117,9 +119,9 @@ extern int yylex(YYSTYPE*, TParseContext&); %expect 1 // One shift reduce conflict because of if | else %token ATTRIBUTE VARYING -%token CONST BOOL FLOAT DOUBLE INT UINT +%token CONST BOOL FLOAT DOUBLE INT UINT INT64_T UINT64_T %token BREAK CONTINUE DO ELSE FOR IF DISCARD RETURN SWITCH CASE DEFAULT SUBROUTINE -%token BVEC2 BVEC3 BVEC4 IVEC2 IVEC3 IVEC4 UVEC2 UVEC3 UVEC4 VEC2 VEC3 VEC4 +%token BVEC2 BVEC3 BVEC4 IVEC2 IVEC3 IVEC4 I64VEC2 I64VEC3 I64VEC4 UVEC2 UVEC3 UVEC4 U64VEC2 U64VEC3 U64VEC4 VEC2 VEC3 VEC4 %token MAT2 MAT3 MAT4 CENTROID IN OUT INOUT %token UNIFORM PATCH SAMPLE BUFFER SHARED %token COHERENT VOLATILE RESTRICT READONLY WRITEONLY @@ -180,7 +182,7 @@ extern int yylex(YYSTYPE*, TParseContext&); %token STRUCT VOID WHILE %token IDENTIFIER TYPE_NAME -%token FLOATCONSTANT DOUBLECONSTANT INTCONSTANT UINTCONSTANT BOOLCONSTANT +%token FLOATCONSTANT DOUBLECONSTANT INTCONSTANT UINTCONSTANT INT64CONSTANT UINT64CONSTANT BOOLCONSTANT %token LEFT_OP RIGHT_OP %token INC_OP DEC_OP LE_OP GE_OP EQ_OP NE_OP %token AND_OP OR_OP XOR_OP MUL_ASSIGN DIV_ASSIGN ADD_ASSIGN @@ -257,6 +259,14 @@ primary_expression parseContext.fullIntegerCheck($1.loc, "unsigned literal"); $$ = parseContext.intermediate.addConstantUnion($1.u, $1.loc, true); } + | INT64CONSTANT { + parseContext.int64Check($1.loc, "64-bit integer literal"); + $$ = parseContext.intermediate.addConstantUnion($1.i64, $1.loc, true); + } + | UINT64CONSTANT { + parseContext.int64Check($1.loc, "64-bit unsigned integer literal"); + $$ = parseContext.intermediate.addConstantUnion($1.u64, $1.loc, true); + } | FLOATCONSTANT { $$ = parseContext.intermediate.addConstantUnion($1.d, EbtFloat, $1.loc, true); } @@ -1076,7 +1086,10 @@ layout_qualifier_id precise_qualifier : PRECISE { + parseContext.profileRequires($$.loc, ECoreProfile | ECompatibilityProfile, 400, E_GL_ARB_gpu_shader5, "precise"); + parseContext.profileRequires($1.loc, EEsProfile, 320, Num_AEP_gpu_shader5, AEP_gpu_shader5, "precise"); $$.init($1.loc); + $$.qualifier.noContraction = true; } ; @@ -1195,7 +1208,7 @@ storage_qualifier $$.qualifier.storage = EvqBuffer; } | SHARED { - parseContext.profileRequires($1.loc, ECoreProfile | ECompatibilityProfile, 430, 0, "shared"); + parseContext.profileRequires($1.loc, ECoreProfile | ECompatibilityProfile, 430, E_GL_ARB_compute_shader, "shared"); parseContext.profileRequires($1.loc, EEsProfile, 310, 0, "shared"); parseContext.requireStage($1.loc, EShLangCompute, "shared"); $$.init($1.loc); @@ -1309,6 +1322,16 @@ type_specifier_nonarray $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtUint; } + | INT64_T { + parseContext.int64Check($1.loc, "64-bit integer", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtInt64; + } + | UINT64_T { + parseContext.int64Check($1.loc, "64-bit unsigned integer", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtUint64; + } | BOOL { $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtBool; @@ -1376,6 +1399,24 @@ type_specifier_nonarray $$.basicType = EbtInt; $$.setVector(4); } + | I64VEC2 { + parseContext.int64Check($1.loc, "64-bit integer vector", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtInt64; + $$.setVector(2); + } + | I64VEC3 { + parseContext.int64Check($1.loc, "64-bit integer vector", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtInt64; + $$.setVector(3); + } + | I64VEC4 { + parseContext.int64Check($1.loc, "64-bit integer vector", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtInt64; + $$.setVector(4); + } | UVEC2 { parseContext.fullIntegerCheck($1.loc, "unsigned integer vector"); $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); @@ -1394,6 +1435,24 @@ type_specifier_nonarray $$.basicType = EbtUint; $$.setVector(4); } + | U64VEC2 { + parseContext.int64Check($1.loc, "64-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtUint64; + $$.setVector(2); + } + | U64VEC3 { + parseContext.int64Check($1.loc, "64-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtUint64; + $$.setVector(3); + } + | U64VEC4 { + parseContext.int64Check($1.loc, "64-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); + $$.basicType = EbtUint64; + $$.setVector(4); + } | MAT2 { $$.init($1.loc, parseContext.symbolTable.atGlobalLevel()); $$.basicType = EbtFloat; diff --git a/glslang/MachineIndependent/glslang_tab.cpp b/glslang/MachineIndependent/glslang_tab.cpp index d435aa80..a284fda4 100644 --- a/glslang/MachineIndependent/glslang_tab.cpp +++ b/glslang/MachineIndependent/glslang_tab.cpp @@ -1,19 +1,19 @@ -/* A Bison parser, made by GNU Bison 2.7. */ +/* A Bison parser, made by GNU Bison 3.0.4. */ /* Bison implementation for Yacc-like parsers in C - - Copyright (C) 1984, 1989-1990, 2000-2012 Free Software Foundation, Inc. - + + Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc. + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program. If not, see . */ @@ -26,7 +26,7 @@ special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. - + This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ @@ -44,7 +44,7 @@ #define YYBISON 1 /* Bison version. */ -#define YYBISON_VERSION "2.7" +#define YYBISON_VERSION "3.0.4" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -62,8 +62,7 @@ /* Copy the first part of user declarations. */ -/* Line 371 of yacc.c */ -#line 41 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 41 "MachineIndependent/glslang.y" /* yacc.c:339 */ /* Based on: @@ -88,14 +87,13 @@ Jutta Degener, 1995 using namespace glslang; -/* Line 371 of yacc.c */ -#line 93 "C:/Projects/glslang/glslang/MachineIndependent/glslang_tab.cpp" +#line 91 "MachineIndependent/glslang_tab.cpp" /* yacc.c:339 */ -# ifndef YY_NULL +# ifndef YY_NULLPTR # if defined __cplusplus && 201103L <= __cplusplus -# define YY_NULL nullptr +# define YY_NULLPTR nullptr # else -# define YY_NULL 0 +# define YY_NULLPTR 0 # endif # endif @@ -109,9 +107,9 @@ using namespace glslang; /* In a future release of Bison, this section will be replaced by #include "glslang_tab.cpp.h". */ -#ifndef YY_YY_C_PROJECTS_GLSLANG_GLSLANG_MACHINEINDEPENDENT_GLSLANG_TAB_CPP_H_INCLUDED -# define YY_YY_C_PROJECTS_GLSLANG_GLSLANG_MACHINEINDEPENDENT_GLSLANG_TAB_CPP_H_INCLUDED -/* Enabling traces. */ +#ifndef YY_YY_MACHINEINDEPENDENT_GLSLANG_TAB_CPP_H_INCLUDED +# define YY_YY_MACHINEINDEPENDENT_GLSLANG_TAB_CPP_H_INCLUDED +/* Debug traces. */ #ifndef YYDEBUG # define YYDEBUG 1 #endif @@ -119,278 +117,287 @@ using namespace glslang; extern int yydebug; #endif -/* Tokens. */ +/* Token type. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - ATTRIBUTE = 258, - VARYING = 259, - CONST = 260, - BOOL = 261, - FLOAT = 262, - DOUBLE = 263, - INT = 264, - UINT = 265, - BREAK = 266, - CONTINUE = 267, - DO = 268, - ELSE = 269, - FOR = 270, - IF = 271, - DISCARD = 272, - RETURN = 273, - SWITCH = 274, - CASE = 275, - DEFAULT = 276, - SUBROUTINE = 277, - BVEC2 = 278, - BVEC3 = 279, - BVEC4 = 280, - IVEC2 = 281, - IVEC3 = 282, - IVEC4 = 283, - UVEC2 = 284, - UVEC3 = 285, - UVEC4 = 286, - VEC2 = 287, - VEC3 = 288, - VEC4 = 289, - MAT2 = 290, - MAT3 = 291, - MAT4 = 292, - CENTROID = 293, - IN = 294, - OUT = 295, - INOUT = 296, - UNIFORM = 297, - PATCH = 298, - SAMPLE = 299, - BUFFER = 300, - SHARED = 301, - COHERENT = 302, - VOLATILE = 303, - RESTRICT = 304, - READONLY = 305, - WRITEONLY = 306, - DVEC2 = 307, - DVEC3 = 308, - DVEC4 = 309, - DMAT2 = 310, - DMAT3 = 311, - DMAT4 = 312, - NOPERSPECTIVE = 313, - FLAT = 314, - SMOOTH = 315, - LAYOUT = 316, - MAT2X2 = 317, - MAT2X3 = 318, - MAT2X4 = 319, - MAT3X2 = 320, - MAT3X3 = 321, - MAT3X4 = 322, - MAT4X2 = 323, - MAT4X3 = 324, - MAT4X4 = 325, - DMAT2X2 = 326, - DMAT2X3 = 327, - DMAT2X4 = 328, - DMAT3X2 = 329, - DMAT3X3 = 330, - DMAT3X4 = 331, - DMAT4X2 = 332, - DMAT4X3 = 333, - DMAT4X4 = 334, - ATOMIC_UINT = 335, - SAMPLER1D = 336, - SAMPLER2D = 337, - SAMPLER3D = 338, - SAMPLERCUBE = 339, - SAMPLER1DSHADOW = 340, - SAMPLER2DSHADOW = 341, - SAMPLERCUBESHADOW = 342, - SAMPLER1DARRAY = 343, - SAMPLER2DARRAY = 344, - SAMPLER1DARRAYSHADOW = 345, - SAMPLER2DARRAYSHADOW = 346, - ISAMPLER1D = 347, - ISAMPLER2D = 348, - ISAMPLER3D = 349, - ISAMPLERCUBE = 350, - ISAMPLER1DARRAY = 351, - ISAMPLER2DARRAY = 352, - USAMPLER1D = 353, - USAMPLER2D = 354, - USAMPLER3D = 355, - USAMPLERCUBE = 356, - USAMPLER1DARRAY = 357, - USAMPLER2DARRAY = 358, - SAMPLER2DRECT = 359, - SAMPLER2DRECTSHADOW = 360, - ISAMPLER2DRECT = 361, - USAMPLER2DRECT = 362, - SAMPLERBUFFER = 363, - ISAMPLERBUFFER = 364, - USAMPLERBUFFER = 365, - SAMPLERCUBEARRAY = 366, - SAMPLERCUBEARRAYSHADOW = 367, - ISAMPLERCUBEARRAY = 368, - USAMPLERCUBEARRAY = 369, - SAMPLER2DMS = 370, - ISAMPLER2DMS = 371, - USAMPLER2DMS = 372, - SAMPLER2DMSARRAY = 373, - ISAMPLER2DMSARRAY = 374, - USAMPLER2DMSARRAY = 375, - SAMPLEREXTERNALOES = 376, - SAMPLER = 377, - SAMPLERSHADOW = 378, - TEXTURE1D = 379, - TEXTURE2D = 380, - TEXTURE3D = 381, - TEXTURECUBE = 382, - TEXTURE1DARRAY = 383, - TEXTURE2DARRAY = 384, - ITEXTURE1D = 385, - ITEXTURE2D = 386, - ITEXTURE3D = 387, - ITEXTURECUBE = 388, - ITEXTURE1DARRAY = 389, - ITEXTURE2DARRAY = 390, - UTEXTURE1D = 391, - UTEXTURE2D = 392, - UTEXTURE3D = 393, - UTEXTURECUBE = 394, - UTEXTURE1DARRAY = 395, - UTEXTURE2DARRAY = 396, - TEXTURE2DRECT = 397, - ITEXTURE2DRECT = 398, - UTEXTURE2DRECT = 399, - TEXTUREBUFFER = 400, - ITEXTUREBUFFER = 401, - UTEXTUREBUFFER = 402, - TEXTURECUBEARRAY = 403, - ITEXTURECUBEARRAY = 404, - UTEXTURECUBEARRAY = 405, - TEXTURE2DMS = 406, - ITEXTURE2DMS = 407, - UTEXTURE2DMS = 408, - TEXTURE2DMSARRAY = 409, - ITEXTURE2DMSARRAY = 410, - UTEXTURE2DMSARRAY = 411, - SUBPASSINPUT = 412, - SUBPASSINPUTMS = 413, - ISUBPASSINPUT = 414, - ISUBPASSINPUTMS = 415, - USUBPASSINPUT = 416, - USUBPASSINPUTMS = 417, - IMAGE1D = 418, - IIMAGE1D = 419, - UIMAGE1D = 420, - IMAGE2D = 421, - IIMAGE2D = 422, - UIMAGE2D = 423, - IMAGE3D = 424, - IIMAGE3D = 425, - UIMAGE3D = 426, - IMAGE2DRECT = 427, - IIMAGE2DRECT = 428, - UIMAGE2DRECT = 429, - IMAGECUBE = 430, - IIMAGECUBE = 431, - UIMAGECUBE = 432, - IMAGEBUFFER = 433, - IIMAGEBUFFER = 434, - UIMAGEBUFFER = 435, - IMAGE1DARRAY = 436, - IIMAGE1DARRAY = 437, - UIMAGE1DARRAY = 438, - IMAGE2DARRAY = 439, - IIMAGE2DARRAY = 440, - UIMAGE2DARRAY = 441, - IMAGECUBEARRAY = 442, - IIMAGECUBEARRAY = 443, - UIMAGECUBEARRAY = 444, - IMAGE2DMS = 445, - IIMAGE2DMS = 446, - UIMAGE2DMS = 447, - IMAGE2DMSARRAY = 448, - IIMAGE2DMSARRAY = 449, - UIMAGE2DMSARRAY = 450, - STRUCT = 451, - VOID = 452, - WHILE = 453, - IDENTIFIER = 454, - TYPE_NAME = 455, - FLOATCONSTANT = 456, - DOUBLECONSTANT = 457, - INTCONSTANT = 458, - UINTCONSTANT = 459, - BOOLCONSTANT = 460, - LEFT_OP = 461, - RIGHT_OP = 462, - INC_OP = 463, - DEC_OP = 464, - LE_OP = 465, - GE_OP = 466, - EQ_OP = 467, - NE_OP = 468, - AND_OP = 469, - OR_OP = 470, - XOR_OP = 471, - MUL_ASSIGN = 472, - DIV_ASSIGN = 473, - ADD_ASSIGN = 474, - MOD_ASSIGN = 475, - LEFT_ASSIGN = 476, - RIGHT_ASSIGN = 477, - AND_ASSIGN = 478, - XOR_ASSIGN = 479, - OR_ASSIGN = 480, - SUB_ASSIGN = 481, - LEFT_PAREN = 482, - RIGHT_PAREN = 483, - LEFT_BRACKET = 484, - RIGHT_BRACKET = 485, - LEFT_BRACE = 486, - RIGHT_BRACE = 487, - DOT = 488, - COMMA = 489, - COLON = 490, - EQUAL = 491, - SEMICOLON = 492, - BANG = 493, - DASH = 494, - TILDE = 495, - PLUS = 496, - STAR = 497, - SLASH = 498, - PERCENT = 499, - LEFT_ANGLE = 500, - RIGHT_ANGLE = 501, - VERTICAL_BAR = 502, - CARET = 503, - AMPERSAND = 504, - QUESTION = 505, - INVARIANT = 506, - PRECISE = 507, - HIGH_PRECISION = 508, - MEDIUM_PRECISION = 509, - LOW_PRECISION = 510, - PRECISION = 511, - PACKED = 512, - RESOURCE = 513, - SUPERP = 514 - }; + enum yytokentype + { + ATTRIBUTE = 258, + VARYING = 259, + CONST = 260, + BOOL = 261, + FLOAT = 262, + DOUBLE = 263, + INT = 264, + UINT = 265, + INT64_T = 266, + UINT64_T = 267, + BREAK = 268, + CONTINUE = 269, + DO = 270, + ELSE = 271, + FOR = 272, + IF = 273, + DISCARD = 274, + RETURN = 275, + SWITCH = 276, + CASE = 277, + DEFAULT = 278, + SUBROUTINE = 279, + BVEC2 = 280, + BVEC3 = 281, + BVEC4 = 282, + IVEC2 = 283, + IVEC3 = 284, + IVEC4 = 285, + I64VEC2 = 286, + I64VEC3 = 287, + I64VEC4 = 288, + UVEC2 = 289, + UVEC3 = 290, + UVEC4 = 291, + U64VEC2 = 292, + U64VEC3 = 293, + U64VEC4 = 294, + VEC2 = 295, + VEC3 = 296, + VEC4 = 297, + MAT2 = 298, + MAT3 = 299, + MAT4 = 300, + CENTROID = 301, + IN = 302, + OUT = 303, + INOUT = 304, + UNIFORM = 305, + PATCH = 306, + SAMPLE = 307, + BUFFER = 308, + SHARED = 309, + COHERENT = 310, + VOLATILE = 311, + RESTRICT = 312, + READONLY = 313, + WRITEONLY = 314, + DVEC2 = 315, + DVEC3 = 316, + DVEC4 = 317, + DMAT2 = 318, + DMAT3 = 319, + DMAT4 = 320, + NOPERSPECTIVE = 321, + FLAT = 322, + SMOOTH = 323, + LAYOUT = 324, + MAT2X2 = 325, + MAT2X3 = 326, + MAT2X4 = 327, + MAT3X2 = 328, + MAT3X3 = 329, + MAT3X4 = 330, + MAT4X2 = 331, + MAT4X3 = 332, + MAT4X4 = 333, + DMAT2X2 = 334, + DMAT2X3 = 335, + DMAT2X4 = 336, + DMAT3X2 = 337, + DMAT3X3 = 338, + DMAT3X4 = 339, + DMAT4X2 = 340, + DMAT4X3 = 341, + DMAT4X4 = 342, + ATOMIC_UINT = 343, + SAMPLER1D = 344, + SAMPLER2D = 345, + SAMPLER3D = 346, + SAMPLERCUBE = 347, + SAMPLER1DSHADOW = 348, + SAMPLER2DSHADOW = 349, + SAMPLERCUBESHADOW = 350, + SAMPLER1DARRAY = 351, + SAMPLER2DARRAY = 352, + SAMPLER1DARRAYSHADOW = 353, + SAMPLER2DARRAYSHADOW = 354, + ISAMPLER1D = 355, + ISAMPLER2D = 356, + ISAMPLER3D = 357, + ISAMPLERCUBE = 358, + ISAMPLER1DARRAY = 359, + ISAMPLER2DARRAY = 360, + USAMPLER1D = 361, + USAMPLER2D = 362, + USAMPLER3D = 363, + USAMPLERCUBE = 364, + USAMPLER1DARRAY = 365, + USAMPLER2DARRAY = 366, + SAMPLER2DRECT = 367, + SAMPLER2DRECTSHADOW = 368, + ISAMPLER2DRECT = 369, + USAMPLER2DRECT = 370, + SAMPLERBUFFER = 371, + ISAMPLERBUFFER = 372, + USAMPLERBUFFER = 373, + SAMPLERCUBEARRAY = 374, + SAMPLERCUBEARRAYSHADOW = 375, + ISAMPLERCUBEARRAY = 376, + USAMPLERCUBEARRAY = 377, + SAMPLER2DMS = 378, + ISAMPLER2DMS = 379, + USAMPLER2DMS = 380, + SAMPLER2DMSARRAY = 381, + ISAMPLER2DMSARRAY = 382, + USAMPLER2DMSARRAY = 383, + SAMPLEREXTERNALOES = 384, + SAMPLER = 385, + SAMPLERSHADOW = 386, + TEXTURE1D = 387, + TEXTURE2D = 388, + TEXTURE3D = 389, + TEXTURECUBE = 390, + TEXTURE1DARRAY = 391, + TEXTURE2DARRAY = 392, + ITEXTURE1D = 393, + ITEXTURE2D = 394, + ITEXTURE3D = 395, + ITEXTURECUBE = 396, + ITEXTURE1DARRAY = 397, + ITEXTURE2DARRAY = 398, + UTEXTURE1D = 399, + UTEXTURE2D = 400, + UTEXTURE3D = 401, + UTEXTURECUBE = 402, + UTEXTURE1DARRAY = 403, + UTEXTURE2DARRAY = 404, + TEXTURE2DRECT = 405, + ITEXTURE2DRECT = 406, + UTEXTURE2DRECT = 407, + TEXTUREBUFFER = 408, + ITEXTUREBUFFER = 409, + UTEXTUREBUFFER = 410, + TEXTURECUBEARRAY = 411, + ITEXTURECUBEARRAY = 412, + UTEXTURECUBEARRAY = 413, + TEXTURE2DMS = 414, + ITEXTURE2DMS = 415, + UTEXTURE2DMS = 416, + TEXTURE2DMSARRAY = 417, + ITEXTURE2DMSARRAY = 418, + UTEXTURE2DMSARRAY = 419, + SUBPASSINPUT = 420, + SUBPASSINPUTMS = 421, + ISUBPASSINPUT = 422, + ISUBPASSINPUTMS = 423, + USUBPASSINPUT = 424, + USUBPASSINPUTMS = 425, + IMAGE1D = 426, + IIMAGE1D = 427, + UIMAGE1D = 428, + IMAGE2D = 429, + IIMAGE2D = 430, + UIMAGE2D = 431, + IMAGE3D = 432, + IIMAGE3D = 433, + UIMAGE3D = 434, + IMAGE2DRECT = 435, + IIMAGE2DRECT = 436, + UIMAGE2DRECT = 437, + IMAGECUBE = 438, + IIMAGECUBE = 439, + UIMAGECUBE = 440, + IMAGEBUFFER = 441, + IIMAGEBUFFER = 442, + UIMAGEBUFFER = 443, + IMAGE1DARRAY = 444, + IIMAGE1DARRAY = 445, + UIMAGE1DARRAY = 446, + IMAGE2DARRAY = 447, + IIMAGE2DARRAY = 448, + UIMAGE2DARRAY = 449, + IMAGECUBEARRAY = 450, + IIMAGECUBEARRAY = 451, + UIMAGECUBEARRAY = 452, + IMAGE2DMS = 453, + IIMAGE2DMS = 454, + UIMAGE2DMS = 455, + IMAGE2DMSARRAY = 456, + IIMAGE2DMSARRAY = 457, + UIMAGE2DMSARRAY = 458, + STRUCT = 459, + VOID = 460, + WHILE = 461, + IDENTIFIER = 462, + TYPE_NAME = 463, + FLOATCONSTANT = 464, + DOUBLECONSTANT = 465, + INTCONSTANT = 466, + UINTCONSTANT = 467, + INT64CONSTANT = 468, + UINT64CONSTANT = 469, + BOOLCONSTANT = 470, + LEFT_OP = 471, + RIGHT_OP = 472, + INC_OP = 473, + DEC_OP = 474, + LE_OP = 475, + GE_OP = 476, + EQ_OP = 477, + NE_OP = 478, + AND_OP = 479, + OR_OP = 480, + XOR_OP = 481, + MUL_ASSIGN = 482, + DIV_ASSIGN = 483, + ADD_ASSIGN = 484, + MOD_ASSIGN = 485, + LEFT_ASSIGN = 486, + RIGHT_ASSIGN = 487, + AND_ASSIGN = 488, + XOR_ASSIGN = 489, + OR_ASSIGN = 490, + SUB_ASSIGN = 491, + LEFT_PAREN = 492, + RIGHT_PAREN = 493, + LEFT_BRACKET = 494, + RIGHT_BRACKET = 495, + LEFT_BRACE = 496, + RIGHT_BRACE = 497, + DOT = 498, + COMMA = 499, + COLON = 500, + EQUAL = 501, + SEMICOLON = 502, + BANG = 503, + DASH = 504, + TILDE = 505, + PLUS = 506, + STAR = 507, + SLASH = 508, + PERCENT = 509, + LEFT_ANGLE = 510, + RIGHT_ANGLE = 511, + VERTICAL_BAR = 512, + CARET = 513, + AMPERSAND = 514, + QUESTION = 515, + INVARIANT = 516, + PRECISE = 517, + HIGH_PRECISION = 518, + MEDIUM_PRECISION = 519, + LOW_PRECISION = 520, + PRECISION = 521, + PACKED = 522, + RESOURCE = 523, + SUPERP = 524 + }; #endif - +/* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef union YYSTYPE + +union YYSTYPE { -/* Line 387 of yacc.c */ -#line 66 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 66 "MachineIndependent/glslang.y" /* yacc.c:355 */ struct { glslang::TSourceLoc loc; @@ -398,6 +405,8 @@ typedef union YYSTYPE glslang::TString *string; int i; unsigned int u; + long long i64; + unsigned long long u64; bool b; double d; }; @@ -422,35 +431,22 @@ typedef union YYSTYPE }; } interm; +#line 435 "MachineIndependent/glslang_tab.cpp" /* yacc.c:355 */ +}; -/* Line 387 of yacc.c */ -#line 428 "C:/Projects/glslang/glslang/MachineIndependent/glslang_tab.cpp" -} YYSTYPE; +typedef union YYSTYPE YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 #endif -#ifdef YYPARSE_PARAM -#if defined __STDC__ || defined __cplusplus -int yyparse (void *YYPARSE_PARAM); -#else -int yyparse (); -#endif -#else /* ! YYPARSE_PARAM */ -#if defined __STDC__ || defined __cplusplus -int yyparse (glslang::TParseContext* pParseContext); -#else -int yyparse (); -#endif -#endif /* ! YYPARSE_PARAM */ -#endif /* !YY_YY_C_PROJECTS_GLSLANG_GLSLANG_MACHINEINDEPENDENT_GLSLANG_TAB_CPP_H_INCLUDED */ +int yyparse (glslang::TParseContext* pParseContext); + +#endif /* !YY_YY_MACHINEINDEPENDENT_GLSLANG_TAB_CPP_H_INCLUDED */ /* Copy the second part of user declarations. */ -/* Line 390 of yacc.c */ -#line 98 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 100 "MachineIndependent/glslang.y" /* yacc.c:358 */ /* windows only pragma */ @@ -466,8 +462,7 @@ int yyparse (); extern int yylex(YYSTYPE*, TParseContext&); -/* Line 390 of yacc.c */ -#line 471 "C:/Projects/glslang/glslang/MachineIndependent/glslang_tab.cpp" +#line 466 "MachineIndependent/glslang_tab.cpp" /* yacc.c:358 */ #ifdef short # undef short @@ -481,11 +476,8 @@ typedef unsigned char yytype_uint8; #ifdef YYTYPE_INT8 typedef YYTYPE_INT8 yytype_int8; -#elif (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -typedef signed char yytype_int8; #else -typedef short int yytype_int8; +typedef signed char yytype_int8; #endif #ifdef YYTYPE_UINT16 @@ -505,8 +497,7 @@ typedef short int yytype_int16; # define YYSIZE_T __SIZE_TYPE__ # elif defined size_t # define YYSIZE_T size_t -# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +# elif ! defined YYSIZE_T # include /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # else @@ -528,6 +519,33 @@ typedef short int yytype_int16; # endif #endif +#ifndef YY_ATTRIBUTE +# if (defined __GNUC__ \ + && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \ + || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C +# define YY_ATTRIBUTE(Spec) __attribute__(Spec) +# else +# define YY_ATTRIBUTE(Spec) /* empty */ +# endif +#endif + +#ifndef YY_ATTRIBUTE_PURE +# define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__)) +#endif + +#ifndef YY_ATTRIBUTE_UNUSED +# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__)) +#endif + +#if !defined _Noreturn \ + && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112) +# if defined _MSC_VER && 1200 <= _MSC_VER +# define _Noreturn __declspec (noreturn) +# else +# define _Noreturn YY_ATTRIBUTE ((__noreturn__)) +# endif +#endif + /* Suppress unused-variable warnings by "using" E. */ #if ! defined lint || defined __GNUC__ # define YYUSE(E) ((void) (E)) @@ -535,23 +553,25 @@ typedef short int yytype_int16; # define YYUSE(E) /* empty */ #endif -/* Identity function, used to suppress warnings about constant conditions. */ -#ifndef lint -# define YYID(N) (N) +#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ +/* Suppress an incorrect diagnostic about yylval being uninitialized. */ +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\ + _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") +# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ + _Pragma ("GCC diagnostic pop") #else -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static int -YYID (int yyi) -#else -static int -YYID (yyi) - int yyi; +# define YY_INITIAL_VALUE(Value) Value #endif -{ - return yyi; -} +#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_END #endif +#ifndef YY_INITIAL_VALUE +# define YY_INITIAL_VALUE(Value) /* Nothing. */ +#endif + #if ! defined yyoverflow || YYERROR_VERBOSE @@ -570,8 +590,7 @@ YYID (yyi) # define alloca _alloca # else # define YYSTACK_ALLOC alloca -# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS # include /* INFRINGES ON USER NAME SPACE */ /* Use EXIT_SUCCESS as a witness for stdlib.h. */ # ifndef EXIT_SUCCESS @@ -583,8 +602,8 @@ YYID (yyi) # endif # ifdef YYSTACK_ALLOC - /* Pacify GCC's `empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) + /* Pacify GCC's 'empty if-body' warning. */ +# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) # ifndef YYSTACK_ALLOC_MAXIMUM /* The OS might guarantee only one guard page at the bottom of the stack, and a page size can be as small as 4096 bytes. So we cannot safely @@ -600,7 +619,7 @@ YYID (yyi) # endif # if (defined __cplusplus && ! defined EXIT_SUCCESS \ && ! ((defined YYMALLOC || defined malloc) \ - && (defined YYFREE || defined free))) + && (defined YYFREE || defined free))) # include /* INFRINGES ON USER NAME SPACE */ # ifndef EXIT_SUCCESS # define EXIT_SUCCESS 0 @@ -608,15 +627,13 @@ YYID (yyi) # endif # ifndef YYMALLOC # define YYMALLOC malloc -# if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +# if ! defined malloc && ! defined EXIT_SUCCESS void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ # endif # endif # ifndef YYFREE # define YYFREE free -# if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +# if ! defined free && ! defined EXIT_SUCCESS void free (void *); /* INFRINGES ON USER NAME SPACE */ # endif # endif @@ -626,7 +643,7 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */ #if (! defined yyoverflow \ && (! defined __cplusplus \ - || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) + || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ union yyalloc @@ -651,16 +668,16 @@ union yyalloc elements in the stack, and YYPTR gives the new location of the stack. Advance YYPTR to a properly aligned location for the next stack. */ -# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ - do \ - { \ - YYSIZE_T yynewbytes; \ - YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ - Stack = &yyptr->Stack_alloc; \ - yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ - yyptr += yynewbytes / sizeof (*yyptr); \ - } \ - while (YYID (0)) +# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ + do \ + { \ + YYSIZE_T yynewbytes; \ + YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ + Stack = &yyptr->Stack_alloc; \ + yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ + yyptr += yynewbytes / sizeof (*yyptr); \ + } \ + while (0) #endif @@ -679,33 +696,35 @@ union yyalloc for (yyi = 0; yyi < (Count); yyi++) \ (Dst)[yyi] = (Src)[yyi]; \ } \ - while (YYID (0)) + while (0) # endif # endif #endif /* !YYCOPY_NEEDED */ /* YYFINAL -- State number of the termination state. */ -#define YYFINAL 240 +#define YYFINAL 248 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 5659 +#define YYLAST 5943 /* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 260 +#define YYNTOKENS 270 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 100 /* YYNRULES -- Number of rules. */ -#define YYNRULES 411 -/* YYNRULES -- Number of states. */ -#define YYNSTATES 543 +#define YYNRULES 421 +/* YYNSTATES -- Number of states. */ +#define YYNSTATES 553 -/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ +/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned + by yylex, with out-of-bounds checking. */ #define YYUNDEFTOK 2 -#define YYMAXUTOK 514 +#define YYMAXUTOK 524 -#define YYTRANSLATE(YYX) \ +#define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) -/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ +/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM + as returned by yylex, without out-of-bounds checking. */ static const yytype_uint16 yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -759,213 +778,57 @@ static const yytype_uint16 yytranslate[] = 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, - 255, 256, 257, 258, 259 + 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265, 266, 267, 268, 269 }; #if YYDEBUG -/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in - YYRHS. */ -static const yytype_uint16 yyprhs[] = -{ - 0, 0, 3, 5, 7, 9, 11, 13, 15, 17, - 21, 23, 28, 30, 34, 37, 40, 42, 44, 46, - 49, 52, 55, 57, 60, 64, 67, 69, 71, 73, - 76, 79, 82, 84, 86, 88, 90, 92, 96, 100, - 104, 106, 110, 114, 116, 120, 124, 126, 130, 134, - 138, 142, 144, 148, 152, 154, 158, 160, 164, 166, - 170, 172, 176, 178, 182, 184, 188, 190, 191, 198, - 200, 204, 206, 208, 210, 212, 214, 216, 218, 220, - 222, 224, 226, 228, 232, 234, 237, 240, 245, 248, - 252, 257, 260, 264, 269, 270, 277, 280, 284, 287, - 289, 291, 294, 298, 302, 305, 309, 312, 314, 317, - 319, 321, 323, 327, 332, 339, 345, 347, 350, 354, - 360, 365, 367, 370, 372, 374, 376, 378, 383, 385, - 389, 391, 395, 397, 399, 401, 404, 406, 408, 410, - 412, 414, 416, 418, 420, 422, 424, 426, 428, 430, - 432, 434, 436, 438, 440, 442, 444, 446, 448, 450, - 452, 457, 459, 463, 465, 468, 471, 475, 479, 484, - 486, 488, 490, 492, 494, 496, 498, 500, 502, 504, - 506, 508, 510, 512, 514, 516, 518, 520, 522, 524, - 526, 528, 530, 532, 534, 536, 538, 540, 542, 544, - 546, 548, 550, 552, 554, 556, 558, 560, 562, 564, - 566, 568, 570, 572, 574, 576, 578, 580, 582, 584, - 586, 588, 590, 592, 594, 596, 598, 600, 602, 604, - 606, 608, 610, 612, 614, 616, 618, 620, 622, 624, - 626, 628, 630, 632, 634, 636, 638, 640, 642, 644, - 646, 648, 650, 652, 654, 656, 658, 660, 662, 664, - 666, 668, 670, 672, 674, 676, 678, 680, 682, 684, - 686, 688, 690, 692, 694, 696, 698, 700, 702, 704, - 706, 708, 710, 712, 714, 716, 718, 720, 722, 724, - 726, 728, 730, 732, 734, 736, 738, 740, 742, 744, - 746, 748, 750, 752, 754, 756, 758, 760, 762, 764, - 766, 768, 770, 772, 774, 776, 778, 780, 782, 784, - 786, 788, 790, 792, 794, 796, 798, 800, 802, 804, - 806, 808, 810, 812, 814, 816, 817, 824, 825, 831, - 833, 836, 840, 845, 847, 851, 853, 856, 858, 862, - 867, 869, 873, 875, 877, 879, 881, 883, 885, 887, - 889, 891, 893, 896, 897, 898, 904, 906, 908, 909, - 912, 913, 916, 919, 923, 925, 928, 930, 933, 939, - 943, 945, 947, 952, 953, 962, 963, 965, 969, 972, - 973, 980, 981, 990, 991, 999, 1001, 1003, 1005, 1006, - 1009, 1013, 1016, 1019, 1022, 1026, 1029, 1031, 1034, 1036, - 1038, 1039 -}; - -/* YYRHS -- A `-1'-separated list of the rules' RHS. */ -static const yytype_int16 yyrhs[] = -{ - 356, 0, -1, 199, -1, 261, -1, 203, -1, 204, - -1, 201, -1, 202, -1, 205, -1, 227, 289, 228, - -1, 262, -1, 263, 229, 264, 230, -1, 265, -1, - 263, 233, 199, -1, 263, 208, -1, 263, 209, -1, - 289, -1, 266, -1, 267, -1, 269, 228, -1, 268, - 228, -1, 270, 197, -1, 270, -1, 270, 287, -1, - 269, 234, 287, -1, 271, 227, -1, 315, -1, 263, - -1, 263, -1, 208, 272, -1, 209, 272, -1, 273, - 272, -1, 241, -1, 239, -1, 238, -1, 240, -1, - 272, -1, 274, 242, 272, -1, 274, 243, 272, -1, - 274, 244, 272, -1, 274, -1, 275, 241, 274, -1, - 275, 239, 274, -1, 275, -1, 276, 206, 275, -1, - 276, 207, 275, -1, 276, -1, 277, 245, 276, -1, - 277, 246, 276, -1, 277, 210, 276, -1, 277, 211, - 276, -1, 277, -1, 278, 212, 277, -1, 278, 213, - 277, -1, 278, -1, 279, 249, 278, -1, 279, -1, - 280, 248, 279, -1, 280, -1, 281, 247, 280, -1, - 281, -1, 282, 214, 281, -1, 282, -1, 283, 216, - 282, -1, 283, -1, 284, 215, 283, -1, 284, -1, - -1, 284, 250, 286, 289, 235, 287, -1, 285, -1, - 272, 288, 287, -1, 236, -1, 217, -1, 218, -1, - 220, -1, 219, -1, 226, -1, 221, -1, 222, -1, - 223, -1, 224, -1, 225, -1, 287, -1, 289, 234, - 287, -1, 285, -1, 295, 237, -1, 302, 237, -1, - 256, 318, 315, 237, -1, 292, 237, -1, 292, 199, - 237, -1, 292, 199, 316, 237, -1, 311, 237, -1, - 311, 199, 237, -1, 311, 199, 294, 237, -1, -1, - 311, 199, 231, 293, 322, 232, -1, 234, 199, -1, - 294, 234, 199, -1, 296, 228, -1, 298, -1, 297, - -1, 298, 300, -1, 297, 234, 300, -1, 304, 199, - 227, -1, 315, 199, -1, 315, 199, 316, -1, 311, - 299, -1, 299, -1, 311, 301, -1, 301, -1, 315, - -1, 303, -1, 302, 234, 199, -1, 302, 234, 199, - 316, -1, 302, 234, 199, 316, 236, 326, -1, 302, - 234, 199, 236, 326, -1, 304, -1, 304, 199, -1, - 304, 199, 316, -1, 304, 199, 316, 236, 326, -1, - 304, 199, 236, 326, -1, 315, -1, 311, 315, -1, - 251, -1, 60, -1, 59, -1, 58, -1, 61, 227, - 308, 228, -1, 309, -1, 308, 234, 309, -1, 199, - -1, 199, 236, 290, -1, 46, -1, 252, -1, 312, - -1, 311, 312, -1, 313, -1, 307, -1, 318, -1, - 306, -1, 305, -1, 310, -1, 5, -1, 3, -1, - 4, -1, 41, -1, 39, -1, 40, -1, 38, -1, - 43, -1, 44, -1, 42, -1, 45, -1, 46, -1, - 47, -1, 48, -1, 49, -1, 50, -1, 51, -1, - 22, -1, 22, 227, 314, 228, -1, 200, -1, 314, - 234, 200, -1, 317, -1, 317, 316, -1, 229, 230, - -1, 229, 285, 230, -1, 316, 229, 230, -1, 316, - 229, 285, 230, -1, 197, -1, 7, -1, 8, -1, - 9, -1, 10, -1, 6, -1, 32, -1, 33, -1, - 34, -1, 52, -1, 53, -1, 54, -1, 23, -1, - 24, -1, 25, -1, 26, -1, 27, -1, 28, -1, - 29, -1, 30, -1, 31, -1, 35, -1, 36, -1, - 37, -1, 62, -1, 63, -1, 64, -1, 65, -1, - 66, -1, 67, -1, 68, -1, 69, -1, 70, -1, - 55, -1, 56, -1, 57, -1, 71, -1, 72, -1, - 73, -1, 74, -1, 75, -1, 76, -1, 77, -1, - 78, -1, 79, -1, 80, -1, 81, -1, 82, -1, - 83, -1, 84, -1, 85, -1, 86, -1, 87, -1, - 88, -1, 89, -1, 90, -1, 91, -1, 111, -1, - 112, -1, 92, -1, 93, -1, 94, -1, 95, -1, - 96, -1, 97, -1, 113, -1, 98, -1, 99, -1, - 100, -1, 101, -1, 102, -1, 103, -1, 114, -1, - 104, -1, 105, -1, 106, -1, 107, -1, 108, -1, - 109, -1, 110, -1, 115, -1, 116, -1, 117, -1, - 118, -1, 119, -1, 120, -1, 122, -1, 123, -1, - 124, -1, 125, -1, 126, -1, 127, -1, 128, -1, - 129, -1, 148, -1, 130, -1, 131, -1, 132, -1, - 133, -1, 134, -1, 135, -1, 149, -1, 136, -1, - 137, -1, 138, -1, 139, -1, 140, -1, 141, -1, - 150, -1, 142, -1, 143, -1, 144, -1, 145, -1, - 146, -1, 147, -1, 151, -1, 152, -1, 153, -1, - 154, -1, 155, -1, 156, -1, 163, -1, 164, -1, - 165, -1, 166, -1, 167, -1, 168, -1, 169, -1, - 170, -1, 171, -1, 172, -1, 173, -1, 174, -1, - 175, -1, 176, -1, 177, -1, 178, -1, 179, -1, - 180, -1, 181, -1, 182, -1, 183, -1, 184, -1, - 185, -1, 186, -1, 187, -1, 188, -1, 189, -1, - 190, -1, 191, -1, 192, -1, 193, -1, 194, -1, - 195, -1, 121, -1, 157, -1, 158, -1, 159, -1, - 160, -1, 161, -1, 162, -1, 319, -1, 200, -1, - 253, -1, 254, -1, 255, -1, -1, 196, 199, 231, - 320, 322, 232, -1, -1, 196, 231, 321, 322, 232, - -1, 323, -1, 322, 323, -1, 315, 324, 237, -1, - 311, 315, 324, 237, -1, 325, -1, 324, 234, 325, - -1, 199, -1, 199, 316, -1, 287, -1, 231, 327, - 232, -1, 231, 327, 234, 232, -1, 326, -1, 327, - 234, 326, -1, 291, -1, 331, -1, 330, -1, 328, - -1, 340, -1, 341, -1, 344, -1, 347, -1, 348, - -1, 355, -1, 231, 232, -1, -1, -1, 231, 332, - 339, 333, 232, -1, 338, -1, 330, -1, -1, 336, - 331, -1, -1, 337, 330, -1, 231, 232, -1, 231, - 339, 232, -1, 329, -1, 339, 329, -1, 237, -1, - 289, 237, -1, 16, 227, 289, 228, 342, -1, 335, - 14, 335, -1, 335, -1, 289, -1, 304, 199, 236, - 326, -1, -1, 19, 227, 289, 228, 345, 231, 346, - 232, -1, -1, 339, -1, 20, 289, 235, -1, 21, - 235, -1, -1, 198, 227, 349, 343, 228, 334, -1, - -1, 13, 350, 329, 198, 227, 289, 228, 237, -1, - -1, 15, 227, 351, 352, 354, 228, 334, -1, 340, - -1, 328, -1, 343, -1, -1, 353, 237, -1, 353, - 237, 289, -1, 12, 237, -1, 11, 237, -1, 18, - 237, -1, 18, 289, 237, -1, 17, 237, -1, 357, - -1, 356, 357, -1, 358, -1, 291, -1, -1, 295, - 359, 338, -1 -}; - -/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ + /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 244, 244, 250, 253, 256, 260, 263, 267, 270, - 278, 281, 284, 287, 290, 295, 303, 310, 317, 323, - 327, 334, 337, 343, 350, 360, 368, 373, 403, 409, - 413, 417, 437, 438, 439, 440, 446, 447, 452, 457, - 466, 467, 472, 480, 481, 487, 496, 497, 502, 507, - 512, 520, 521, 529, 540, 541, 550, 551, 560, 561, - 570, 571, 579, 580, 588, 589, 597, 598, 598, 616, - 617, 632, 636, 640, 644, 649, 653, 657, 661, 665, - 669, 673, 680, 683, 693, 700, 705, 710, 718, 722, - 726, 730, 735, 740, 749, 749, 760, 764, 771, 778, - 781, 788, 796, 816, 834, 849, 872, 883, 893, 903, - 913, 922, 925, 929, 933, 938, 946, 951, 956, 961, - 966, 975, 986, 1013, 1022, 1029, 1036, 1046, 1052, 1055, - 1062, 1066, 1070, 1078, 1084, 1087, 1098, 1101, 1104, 1107, - 1111, 1115, 1122, 1126, 1138, 1152, 1157, 1163, 1169, 1176, - 1182, 1187, 1192, 1197, 1204, 1208, 1212, 1216, 1220, 1224, - 1230, 1242, 1245, 1250, 1254, 1263, 1268, 1276, 1280, 1290, - 1294, 1298, 1303, 1307, 1312, 1316, 1321, 1326, 1331, 1337, - 1343, 1349, 1354, 1359, 1364, 1369, 1374, 1379, 1385, 1391, - 1397, 1402, 1407, 1412, 1417, 1422, 1427, 1432, 1437, 1442, - 1447, 1452, 1457, 1463, 1469, 1475, 1481, 1487, 1493, 1499, - 1505, 1511, 1517, 1523, 1529, 1534, 1539, 1544, 1549, 1554, - 1559, 1564, 1569, 1574, 1579, 1584, 1589, 1594, 1599, 1604, - 1609, 1614, 1619, 1624, 1629, 1634, 1639, 1644, 1649, 1654, - 1659, 1664, 1669, 1674, 1679, 1684, 1689, 1694, 1699, 1704, - 1709, 1714, 1719, 1724, 1729, 1734, 1739, 1744, 1749, 1754, - 1759, 1764, 1769, 1774, 1779, 1784, 1789, 1794, 1799, 1804, - 1809, 1814, 1819, 1824, 1829, 1834, 1839, 1844, 1849, 1854, - 1859, 1864, 1869, 1874, 1879, 1884, 1889, 1894, 1899, 1904, - 1909, 1914, 1919, 1924, 1929, 1934, 1939, 1944, 1949, 1954, - 1959, 1964, 1969, 1974, 1979, 1984, 1989, 1994, 1999, 2004, - 2009, 2014, 2019, 2024, 2029, 2034, 2039, 2044, 2049, 2054, - 2059, 2064, 2069, 2074, 2080, 2086, 2092, 2098, 2104, 2110, - 2116, 2121, 2137, 2143, 2149, 2158, 2158, 2169, 2169, 2179, - 2182, 2195, 2213, 2237, 2241, 2247, 2252, 2263, 2266, 2272, - 2281, 2284, 2290, 2294, 2295, 2301, 2302, 2303, 2304, 2305, - 2306, 2307, 2311, 2312, 2316, 2312, 2328, 2329, 2333, 2333, - 2340, 2340, 2354, 2357, 2365, 2373, 2384, 2385, 2389, 2396, - 2400, 2408, 2412, 2425, 2425, 2445, 2448, 2454, 2466, 2478, - 2478, 2493, 2493, 2509, 2509, 2530, 2533, 2539, 2542, 2548, - 2552, 2559, 2564, 2569, 2576, 2594, 2603, 2607, 2614, 2617, - 2623, 2623 + 0, 246, 246, 252, 255, 258, 262, 266, 270, 273, + 277, 280, 288, 291, 294, 297, 300, 305, 313, 320, + 327, 333, 337, 344, 347, 353, 360, 370, 378, 383, + 413, 419, 423, 427, 447, 448, 449, 450, 456, 457, + 462, 467, 476, 477, 482, 490, 491, 497, 506, 507, + 512, 517, 522, 530, 531, 539, 550, 551, 560, 561, + 570, 571, 580, 581, 589, 590, 598, 599, 607, 608, + 608, 626, 627, 642, 646, 650, 654, 659, 663, 667, + 671, 675, 679, 683, 690, 693, 703, 710, 715, 720, + 728, 732, 736, 740, 745, 750, 759, 759, 770, 774, + 781, 788, 791, 798, 806, 826, 844, 859, 882, 893, + 903, 913, 923, 932, 935, 939, 943, 948, 956, 961, + 966, 971, 976, 985, 996, 1023, 1032, 1039, 1046, 1056, + 1062, 1065, 1072, 1076, 1080, 1088, 1097, 1100, 1111, 1114, + 1117, 1120, 1124, 1128, 1135, 1139, 1151, 1165, 1170, 1176, + 1182, 1189, 1195, 1200, 1205, 1210, 1217, 1221, 1225, 1229, + 1233, 1237, 1243, 1255, 1258, 1263, 1267, 1276, 1281, 1289, + 1293, 1303, 1307, 1311, 1316, 1320, 1325, 1330, 1335, 1339, + 1344, 1349, 1354, 1360, 1366, 1372, 1377, 1382, 1387, 1392, + 1397, 1402, 1408, 1414, 1420, 1426, 1432, 1438, 1444, 1450, + 1456, 1461, 1466, 1471, 1476, 1481, 1486, 1491, 1496, 1501, + 1506, 1511, 1516, 1522, 1528, 1534, 1540, 1546, 1552, 1558, + 1564, 1570, 1576, 1582, 1588, 1593, 1598, 1603, 1608, 1613, + 1618, 1623, 1628, 1633, 1638, 1643, 1648, 1653, 1658, 1663, + 1668, 1673, 1678, 1683, 1688, 1693, 1698, 1703, 1708, 1713, + 1718, 1723, 1728, 1733, 1738, 1743, 1748, 1753, 1758, 1763, + 1768, 1773, 1778, 1783, 1788, 1793, 1798, 1803, 1808, 1813, + 1818, 1823, 1828, 1833, 1838, 1843, 1848, 1853, 1858, 1863, + 1868, 1873, 1878, 1883, 1888, 1893, 1898, 1903, 1908, 1913, + 1918, 1923, 1928, 1933, 1938, 1943, 1948, 1953, 1958, 1963, + 1968, 1973, 1978, 1983, 1988, 1993, 1998, 2003, 2008, 2013, + 2018, 2023, 2028, 2033, 2038, 2043, 2048, 2053, 2058, 2063, + 2068, 2073, 2078, 2083, 2088, 2093, 2098, 2103, 2108, 2113, + 2118, 2123, 2128, 2133, 2139, 2145, 2151, 2157, 2163, 2169, + 2175, 2180, 2196, 2202, 2208, 2217, 2217, 2228, 2228, 2238, + 2241, 2254, 2272, 2296, 2300, 2306, 2311, 2322, 2325, 2331, + 2340, 2343, 2349, 2353, 2354, 2360, 2361, 2362, 2363, 2364, + 2365, 2366, 2370, 2371, 2375, 2371, 2387, 2388, 2392, 2392, + 2399, 2399, 2413, 2416, 2424, 2432, 2443, 2444, 2448, 2455, + 2459, 2467, 2471, 2484, 2484, 2504, 2507, 2513, 2525, 2537, + 2537, 2552, 2552, 2568, 2568, 2589, 2592, 2598, 2601, 2607, + 2611, 2618, 2623, 2628, 2635, 2653, 2662, 2666, 2673, 2676, + 2682, 2682 }; #endif @@ -975,14 +838,15 @@ static const yytype_uint16 yyrline[] = static const char *const yytname[] = { "$end", "error", "$undefined", "ATTRIBUTE", "VARYING", "CONST", "BOOL", - "FLOAT", "DOUBLE", "INT", "UINT", "BREAK", "CONTINUE", "DO", "ELSE", - "FOR", "IF", "DISCARD", "RETURN", "SWITCH", "CASE", "DEFAULT", - "SUBROUTINE", "BVEC2", "BVEC3", "BVEC4", "IVEC2", "IVEC3", "IVEC4", - "UVEC2", "UVEC3", "UVEC4", "VEC2", "VEC3", "VEC4", "MAT2", "MAT3", - "MAT4", "CENTROID", "IN", "OUT", "INOUT", "UNIFORM", "PATCH", "SAMPLE", - "BUFFER", "SHARED", "COHERENT", "VOLATILE", "RESTRICT", "READONLY", - "WRITEONLY", "DVEC2", "DVEC3", "DVEC4", "DMAT2", "DMAT3", "DMAT4", - "NOPERSPECTIVE", "FLAT", "SMOOTH", "LAYOUT", "MAT2X2", "MAT2X3", + "FLOAT", "DOUBLE", "INT", "UINT", "INT64_T", "UINT64_T", "BREAK", + "CONTINUE", "DO", "ELSE", "FOR", "IF", "DISCARD", "RETURN", "SWITCH", + "CASE", "DEFAULT", "SUBROUTINE", "BVEC2", "BVEC3", "BVEC4", "IVEC2", + "IVEC3", "IVEC4", "I64VEC2", "I64VEC3", "I64VEC4", "UVEC2", "UVEC3", + "UVEC4", "U64VEC2", "U64VEC3", "U64VEC4", "VEC2", "VEC3", "VEC4", "MAT2", + "MAT3", "MAT4", "CENTROID", "IN", "OUT", "INOUT", "UNIFORM", "PATCH", + "SAMPLE", "BUFFER", "SHARED", "COHERENT", "VOLATILE", "RESTRICT", + "READONLY", "WRITEONLY", "DVEC2", "DVEC3", "DVEC4", "DMAT2", "DMAT3", + "DMAT4", "NOPERSPECTIVE", "FLAT", "SMOOTH", "LAYOUT", "MAT2X2", "MAT2X3", "MAT2X4", "MAT3X2", "MAT3X3", "MAT3X4", "MAT4X2", "MAT4X3", "MAT4X4", "DMAT2X2", "DMAT2X3", "DMAT2X4", "DMAT3X2", "DMAT3X3", "DMAT3X4", "DMAT4X2", "DMAT4X3", "DMAT4X4", "ATOMIC_UINT", "SAMPLER1D", "SAMPLER2D", @@ -1016,20 +880,20 @@ static const char *const yytname[] = "UIMAGECUBEARRAY", "IMAGE2DMS", "IIMAGE2DMS", "UIMAGE2DMS", "IMAGE2DMSARRAY", "IIMAGE2DMSARRAY", "UIMAGE2DMSARRAY", "STRUCT", "VOID", "WHILE", "IDENTIFIER", "TYPE_NAME", "FLOATCONSTANT", "DOUBLECONSTANT", - "INTCONSTANT", "UINTCONSTANT", "BOOLCONSTANT", "LEFT_OP", "RIGHT_OP", - "INC_OP", "DEC_OP", "LE_OP", "GE_OP", "EQ_OP", "NE_OP", "AND_OP", - "OR_OP", "XOR_OP", "MUL_ASSIGN", "DIV_ASSIGN", "ADD_ASSIGN", - "MOD_ASSIGN", "LEFT_ASSIGN", "RIGHT_ASSIGN", "AND_ASSIGN", "XOR_ASSIGN", - "OR_ASSIGN", "SUB_ASSIGN", "LEFT_PAREN", "RIGHT_PAREN", "LEFT_BRACKET", - "RIGHT_BRACKET", "LEFT_BRACE", "RIGHT_BRACE", "DOT", "COMMA", "COLON", - "EQUAL", "SEMICOLON", "BANG", "DASH", "TILDE", "PLUS", "STAR", "SLASH", - "PERCENT", "LEFT_ANGLE", "RIGHT_ANGLE", "VERTICAL_BAR", "CARET", - "AMPERSAND", "QUESTION", "INVARIANT", "PRECISE", "HIGH_PRECISION", - "MEDIUM_PRECISION", "LOW_PRECISION", "PRECISION", "PACKED", "RESOURCE", - "SUPERP", "$accept", "variable_identifier", "primary_expression", - "postfix_expression", "integer_expression", "function_call", - "function_call_or_method", "function_call_generic", - "function_call_header_no_parameters", + "INTCONSTANT", "UINTCONSTANT", "INT64CONSTANT", "UINT64CONSTANT", + "BOOLCONSTANT", "LEFT_OP", "RIGHT_OP", "INC_OP", "DEC_OP", "LE_OP", + "GE_OP", "EQ_OP", "NE_OP", "AND_OP", "OR_OP", "XOR_OP", "MUL_ASSIGN", + "DIV_ASSIGN", "ADD_ASSIGN", "MOD_ASSIGN", "LEFT_ASSIGN", "RIGHT_ASSIGN", + "AND_ASSIGN", "XOR_ASSIGN", "OR_ASSIGN", "SUB_ASSIGN", "LEFT_PAREN", + "RIGHT_PAREN", "LEFT_BRACKET", "RIGHT_BRACKET", "LEFT_BRACE", + "RIGHT_BRACE", "DOT", "COMMA", "COLON", "EQUAL", "SEMICOLON", "BANG", + "DASH", "TILDE", "PLUS", "STAR", "SLASH", "PERCENT", "LEFT_ANGLE", + "RIGHT_ANGLE", "VERTICAL_BAR", "CARET", "AMPERSAND", "QUESTION", + "INVARIANT", "PRECISE", "HIGH_PRECISION", "MEDIUM_PRECISION", + "LOW_PRECISION", "PRECISION", "PACKED", "RESOURCE", "SUPERP", "$accept", + "variable_identifier", "primary_expression", "postfix_expression", + "integer_expression", "function_call", "function_call_or_method", + "function_call_generic", "function_call_header_no_parameters", "function_call_header_with_parameters", "function_call_header", "function_identifier", "unary_expression", "unary_operator", "multiplicative_expression", "additive_expression", "shift_expression", @@ -1059,13 +923,13 @@ static const char *const yytname[] = "switch_statement_list", "case_label", "iteration_statement", "$@10", "$@11", "$@12", "for_init_statement", "conditionopt", "for_rest_statement", "jump_statement", "translation_unit", - "external_declaration", "function_definition", "$@13", YY_NULL + "external_declaration", "function_definition", "$@13", YY_NULLPTR }; #endif # ifdef YYPRINT -/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to - token YYLEX-NUM. */ +/* YYTOKNUM[NUM] -- (External) token number corresponding to the + (internal) symbol number NUM (which must be that of a token). */ static const yytype_uint16 yytoknum[] = { 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, @@ -1093,77 +957,1508 @@ static const yytype_uint16 yytoknum[] = 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, - 505, 506, 507, 508, 509, 510, 511, 512, 513, 514 + 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, + 515, 516, 517, 518, 519, 520, 521, 522, 523, 524 }; # endif -/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const yytype_uint16 yyr1[] = +#define YYPACT_NINF -496 + +#define yypact_value_is_default(Yystate) \ + (!!((Yystate) == (-496))) + +#define YYTABLE_NINF -379 + +#define yytable_value_is_error(Yytable_value) \ + 0 + + /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing + STATE-NUM. */ +static const yytype_int16 yypact[] = { - 0, 260, 261, 262, 262, 262, 262, 262, 262, 262, - 263, 263, 263, 263, 263, 263, 264, 265, 266, 267, - 267, 268, 268, 269, 269, 270, 271, 271, 272, 272, - 272, 272, 273, 273, 273, 273, 274, 274, 274, 274, - 275, 275, 275, 276, 276, 276, 277, 277, 277, 277, - 277, 278, 278, 278, 279, 279, 280, 280, 281, 281, - 282, 282, 283, 283, 284, 284, 285, 286, 285, 287, - 287, 288, 288, 288, 288, 288, 288, 288, 288, 288, - 288, 288, 289, 289, 290, 291, 291, 291, 291, 291, - 291, 291, 291, 291, 293, 292, 294, 294, 295, 296, - 296, 297, 297, 298, 299, 299, 300, 300, 300, 300, - 301, 302, 302, 302, 302, 302, 303, 303, 303, 303, - 303, 304, 304, 305, 306, 306, 306, 307, 308, 308, - 309, 309, 309, 310, 311, 311, 312, 312, 312, 312, - 312, 312, 313, 313, 313, 313, 313, 313, 313, 313, - 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, - 313, 314, 314, 315, 315, 316, 316, 316, 316, 317, - 317, 317, 317, 317, 317, 317, 317, 317, 317, 317, - 317, 317, 317, 317, 317, 317, 317, 317, 317, 317, - 317, 317, 317, 317, 317, 317, 317, 317, 317, 317, - 317, 317, 317, 317, 317, 317, 317, 317, 317, 317, - 317, 317, 317, 317, 317, 317, 317, 317, 317, 317, - 317, 317, 317, 317, 317, 317, 317, 317, 317, 317, - 317, 317, 317, 317, 317, 317, 317, 317, 317, 317, - 317, 317, 317, 317, 317, 317, 317, 317, 317, 317, - 317, 317, 317, 317, 317, 317, 317, 317, 317, 317, - 317, 317, 317, 317, 317, 317, 317, 317, 317, 317, - 317, 317, 317, 317, 317, 317, 317, 317, 317, 317, - 317, 317, 317, 317, 317, 317, 317, 317, 317, 317, - 317, 317, 317, 317, 317, 317, 317, 317, 317, 317, - 317, 317, 317, 317, 317, 317, 317, 317, 317, 317, - 317, 317, 317, 317, 317, 317, 317, 317, 317, 317, - 317, 317, 317, 317, 317, 317, 317, 317, 317, 317, - 317, 317, 318, 318, 318, 320, 319, 321, 319, 322, - 322, 323, 323, 324, 324, 325, 325, 326, 326, 326, - 327, 327, 328, 329, 329, 330, 330, 330, 330, 330, - 330, 330, 331, 332, 333, 331, 334, 334, 336, 335, - 337, 335, 338, 338, 339, 339, 340, 340, 341, 342, - 342, 343, 343, 345, 344, 346, 346, 347, 347, 349, - 348, 350, 348, 351, 348, 352, 352, 353, 353, 354, - 354, 355, 355, 355, 355, 355, 356, 356, 357, 357, - 359, 358 + 2394, -496, -496, -496, -496, -496, -496, -496, -496, -496, + -496, -199, -496, -496, -496, -496, -496, -496, -496, -496, + -496, -496, -496, -496, -496, -496, -496, -496, -496, -496, + -496, -496, -496, -496, -496, -496, -496, -496, -496, -496, + -496, -496, -496, -496, -496, -496, -496, -496, -496, -496, + -496, -496, -496, -496, -496, -496, -187, -496, -496, -496, + -496, -496, -496, -496, -496, -496, -496, -496, -496, -496, + -496, -496, -496, -496, -496, -496, -496, -496, -496, -496, + -496, -496, -496, -496, -496, -496, -496, -496, -496, -496, + -496, -496, -496, -496, -496, -496, -496, -496, -496, -496, + -496, -496, -496, -496, -496, -496, -496, -496, -496, -496, + -496, -496, -496, -496, -496, -496, -496, -496, -496, -496, + -496, -496, -496, -496, -496, -496, -496, -496, -496, -496, + -496, -496, -496, -496, -496, -496, -496, -496, -496, -496, + -496, -496, -496, -496, -496, -496, -496, -496, -496, -496, + -496, -496, -496, -496, -496, -496, -496, -496, -496, -496, + -496, -496, -496, -496, -496, -496, -496, -496, -496, -496, + -496, -496, -496, -496, -496, -496, -496, -496, -496, -496, + -496, -496, -496, -496, -496, -496, -496, -496, -496, -496, + -496, -180, -496, -496, -496, -496, -496, -496, -496, -134, + -496, -191, -181, -155, -131, 3871, -133, -496, -69, -496, + -496, -496, -496, 2900, -496, -496, -496, -92, -496, -496, + 546, -496, -496, -68, -45, -91, -496, 5735, -200, -496, + -496, -85, -496, 3871, -496, -496, -496, 3871, -50, -49, + -496, -209, -193, -496, -496, -496, 4323, -80, -496, -496, + -496, -202, -496, -86, -171, -496, -496, 3871, -84, -496, + -198, 810, -496, -496, -496, -496, -92, -214, -496, 4558, + -176, -496, -46, -496, -127, -496, -496, -496, -496, -496, + -496, -496, -496, 5271, 5271, 5271, -496, -496, -496, -496, + -496, -496, -496, -175, -496, -496, -496, -73, -169, 5503, + -71, -496, 5271, -118, -170, -195, -197, -90, -89, -87, + -88, -57, -58, -208, -67, -496, 4804, -496, -36, 5271, + -496, -45, 3871, 3871, -33, 3145, -496, -496, -496, -72, + -70, -496, -61, -59, -66, 5039, -55, 5271, -62, -51, + -54, -496, -496, -141, -496, -496, -125, -496, -181, -48, + -496, -496, -496, -496, 1074, -496, -496, -496, -496, -496, + -496, -80, 4558, -174, 4558, -496, -496, 4558, 3871, -496, + -23, -496, -496, -496, -167, -496, -496, 5271, -20, -496, + -496, 5271, -43, -496, -496, -496, 5271, 5271, 5271, 5271, + 5271, 5271, 5271, 5271, 5271, 5271, 5271, 5271, 5271, 5271, + 5271, 5271, 5271, 5271, 5271, -496, -496, -496, -44, -496, + -496, -496, -496, 3387, -33, -92, -121, -496, -496, -496, + -496, -496, 1338, -496, 5271, -496, -496, -120, 5271, -102, + -496, -496, -496, 1338, -496, -496, -496, -496, -496, -496, + -496, -496, -496, -496, -496, 5271, 5271, -496, -496, -496, + -496, 4558, -496, -105, -496, 3629, -496, -496, -42, -52, + -496, -496, -496, -496, -496, -118, -118, -170, -170, -195, + -195, -195, -195, -197, -197, -90, -89, -87, -88, -57, + -58, 5271, -496, -496, -119, -80, -33, -496, -16, 2130, + -164, -496, -160, -496, 2637, 1338, -496, -496, -496, -496, + 4077, -496, -496, -99, -496, -496, -40, -496, -496, 2637, + -41, -496, -52, -8, 3871, -35, -38, -496, -496, 5271, + 5271, -496, -39, -32, 191, -31, 1866, -496, -30, -34, + 1602, -496, -496, -138, 5271, 1602, -41, -496, -496, 1338, + 4558, -496, -496, -496, -29, -52, -496, -496, 1338, -27, + -496, -496, -496 }; -/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ + /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. + Performed when YYTABLE does not specify something else to do. Zero + means the default is an error. */ +static const yytype_uint16 yydefact[] = +{ + 0, 145, 146, 144, 178, 172, 173, 174, 175, 176, + 177, 161, 185, 186, 187, 188, 189, 190, 191, 192, + 193, 194, 195, 196, 197, 198, 199, 179, 180, 181, + 200, 201, 202, 150, 148, 149, 147, 153, 151, 152, + 154, 155, 156, 157, 158, 159, 160, 182, 183, 184, + 212, 213, 214, 128, 127, 126, 0, 203, 204, 205, + 206, 207, 208, 209, 210, 211, 215, 216, 217, 218, + 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, + 229, 230, 231, 232, 233, 234, 235, 238, 239, 240, + 241, 242, 243, 245, 246, 247, 248, 249, 250, 252, + 253, 254, 255, 256, 257, 258, 236, 237, 244, 251, + 259, 260, 261, 262, 263, 264, 333, 265, 266, 267, + 268, 269, 270, 271, 272, 274, 275, 276, 277, 278, + 279, 281, 282, 283, 284, 285, 286, 288, 289, 290, + 291, 292, 293, 273, 280, 287, 294, 295, 296, 297, + 298, 299, 334, 335, 336, 337, 338, 339, 300, 301, + 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, + 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, + 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, + 332, 0, 171, 341, 125, 135, 342, 343, 344, 0, + 419, 0, 420, 0, 102, 101, 0, 113, 118, 142, + 141, 139, 143, 0, 136, 138, 123, 165, 140, 340, + 0, 416, 418, 0, 0, 0, 347, 0, 0, 90, + 87, 0, 100, 0, 109, 103, 111, 0, 112, 0, + 88, 119, 0, 93, 137, 124, 0, 166, 1, 417, + 163, 0, 134, 132, 0, 130, 345, 0, 0, 91, + 0, 0, 421, 104, 108, 110, 106, 114, 105, 0, + 120, 96, 0, 94, 0, 2, 8, 9, 4, 5, + 6, 7, 10, 0, 0, 0, 167, 36, 35, 37, + 34, 3, 12, 30, 14, 19, 20, 0, 0, 24, + 0, 38, 0, 42, 45, 48, 53, 56, 58, 60, + 62, 64, 66, 68, 0, 28, 0, 162, 0, 0, + 129, 0, 0, 0, 0, 0, 349, 89, 92, 0, + 0, 401, 0, 0, 0, 0, 0, 0, 0, 0, + 373, 382, 386, 38, 71, 84, 0, 362, 0, 123, + 365, 384, 364, 363, 0, 366, 367, 368, 369, 370, + 371, 107, 0, 115, 0, 357, 122, 0, 0, 98, + 0, 95, 31, 32, 0, 16, 17, 0, 0, 22, + 21, 0, 171, 25, 27, 33, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 69, 168, 169, 0, 164, + 86, 133, 131, 0, 0, 355, 0, 353, 348, 350, + 412, 411, 0, 403, 0, 415, 413, 0, 0, 0, + 398, 399, 372, 0, 74, 75, 77, 76, 79, 80, + 81, 82, 83, 78, 73, 0, 0, 387, 383, 385, + 117, 0, 360, 0, 121, 0, 99, 11, 0, 18, + 15, 26, 39, 40, 41, 44, 43, 46, 47, 51, + 52, 49, 50, 54, 55, 57, 59, 61, 63, 65, + 67, 0, 170, 346, 0, 356, 0, 351, 0, 0, + 0, 414, 0, 397, 0, 374, 72, 85, 116, 358, + 0, 97, 13, 0, 352, 354, 0, 406, 405, 408, + 380, 393, 391, 0, 0, 0, 0, 359, 361, 0, + 0, 407, 0, 0, 390, 0, 0, 388, 0, 0, + 0, 375, 70, 0, 409, 0, 380, 379, 381, 395, + 0, 377, 400, 376, 0, 410, 404, 389, 396, 0, + 392, 402, 394 +}; + + /* YYPGOTO[NTERM-NUM]. */ +static const yytype_int16 yypgoto[] = +{ + -496, -496, -496, -496, -496, -496, -496, -496, -496, -496, + -496, -496, -53, -496, -237, -288, -286, -243, -183, -179, + -184, -177, -168, -185, -496, -234, -496, -266, -496, -280, + -496, 4, -496, -496, -496, 6, -496, -496, -496, -15, + -10, -9, -496, -496, -475, -496, -496, -496, -496, -83, + -496, -204, -211, -496, -496, 0, -221, -496, 33, -496, + -496, -496, -308, -314, -178, -247, -349, -496, -248, -346, + -495, -283, -496, -496, -292, -291, -496, -496, 13, -423, + -242, -496, -496, -263, -496, -496, -496, -496, -496, -496, + -496, -496, -496, -496, -496, -496, -496, 28, -496, -496 +}; + + /* YYDEFGOTO[NTERM-NUM]. */ +static const yytype_int16 yydefgoto[] = +{ + -1, 291, 292, 293, 458, 294, 295, 296, 297, 298, + 299, 300, 343, 302, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 344, 481, 345, 445, 346, + 411, 347, 201, 368, 274, 348, 203, 204, 205, 234, + 235, 236, 206, 207, 208, 209, 210, 211, 254, 255, + 212, 213, 214, 215, 251, 315, 247, 217, 218, 219, + 322, 257, 325, 326, 416, 417, 366, 453, 350, 351, + 352, 353, 433, 516, 542, 524, 525, 526, 543, 354, + 355, 356, 527, 515, 357, 528, 549, 358, 359, 494, + 422, 489, 509, 522, 523, 360, 220, 221, 222, 231 +}; + + /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If + positive, shift that token. If negative, reduce the rule whose + number is the opposite. If YYTABLE_NINF, syntax error. */ +static const yytype_int16 yytable[] = +{ + 216, 237, 244, 365, 200, 374, 202, 260, 449, 252, + 495, 419, 314, 450, 413, 452, 228, 404, 454, 513, + 270, 391, 392, 393, 394, 246, 244, 225, 268, 237, + 246, 538, 362, 383, 513, 541, 317, 269, 223, 246, + 541, 316, 318, 375, 376, 361, 363, 259, 271, 328, + 224, 272, 405, 323, 273, 427, 229, 429, 395, 396, + 455, 226, -29, 316, 377, 316, 230, 320, 378, 380, + 367, 457, 451, 321, 510, 381, 488, 446, 511, 389, + 446, 390, 408, 232, 446, 410, 434, 435, 436, 437, + 438, 439, 440, 441, 442, 443, 365, 459, 365, 419, + 544, 365, 498, 467, 468, 444, 446, 469, 470, 471, + 472, 239, 244, 233, 240, 461, 548, 370, 323, 446, + 371, 323, 447, 486, 446, 486, 487, 491, 504, 196, + 197, 198, 397, 398, 386, 387, 388, 499, 241, 500, + 250, 419, 446, 493, 490, 446, 519, 246, 492, 449, + 256, 518, 465, 466, 473, 474, 261, 266, 267, 316, + 319, 369, 253, 327, 323, 379, 384, 402, 403, 401, + 399, 400, 409, 406, 415, 420, 423, 421, 424, 496, + 497, 425, 428, 430, 456, 365, 431, 460, 432, -28, + 506, 550, 446, 301, 485, -23, 482, 520, 502, 529, + -378, 503, 449, 530, 531, 238, 535, 536, 534, 323, + 340, 539, 540, 245, 512, 552, 475, 477, 551, 480, + 216, 476, 264, 263, 200, 478, 202, 258, 265, 512, + 372, 373, 227, 238, 365, 479, 484, 238, 412, 505, + 533, 507, 537, 546, 262, 547, 521, 508, 249, 385, + 0, 323, 0, 532, 545, 0, 0, 324, 0, 0, + 0, 349, 0, 301, 0, 0, 301, 0, 0, 0, + 0, 0, 0, 0, 365, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 514, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 244, 0, 514, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 324, 414, 0, 324, 0, 0, 0, 0, + 0, 0, 0, 462, 463, 464, 301, 301, 301, 301, + 301, 301, 301, 301, 301, 301, 301, 301, 301, 301, + 301, 301, 0, 0, 349, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 324, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 324, 0, 0, 0, 0, 0, 0, + 0, 0, 349, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 349, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 324, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 349, + 0, 0, 0, 0, 349, 349, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 349, + 0, 0, 0, 0, 245, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 349, 0, 0, 0, + 349, 0, 0, 0, 0, 349, 0, 0, 0, 349, + 0, 0, 0, 0, 0, 0, 248, 0, 349, 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, + 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, + 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, + 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, + 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, + 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, + 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, + 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, + 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, + 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, + 191, 192, 0, 0, 193, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 194, 195, 196, + 197, 198, 199, 1, 2, 3, 4, 5, 6, 7, + 8, 9, 10, 329, 330, 331, 0, 332, 333, 334, + 335, 336, 337, 338, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, + 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, + 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, + 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, + 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, + 187, 188, 189, 190, 191, 192, 339, 275, 193, 276, + 277, 278, 279, 280, 281, 282, 0, 0, 283, 284, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 285, 0, 0, + 0, 340, 341, 0, 0, 0, 0, 342, 287, 288, + 289, 290, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 194, 195, 196, 197, 198, 199, 1, 2, 3, + 4, 5, 6, 7, 8, 9, 10, 329, 330, 331, + 0, 332, 333, 334, 335, 336, 337, 338, 11, 12, + 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, + 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, + 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, + 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, + 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, + 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, + 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, + 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, + 339, 275, 193, 276, 277, 278, 279, 280, 281, 282, + 0, 0, 283, 284, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 285, 0, 0, 0, 340, 448, 0, 0, 0, + 0, 342, 287, 288, 289, 290, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 194, 195, 196, 197, 198, + 199, 1, 2, 3, 4, 5, 6, 7, 8, 9, + 10, 329, 330, 331, 0, 332, 333, 334, 335, 336, + 337, 338, 11, 12, 13, 14, 15, 16, 17, 18, + 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, + 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, + 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, + 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, + 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, + 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, + 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, + 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, + 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, + 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, + 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, + 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, + 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, + 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, + 189, 190, 191, 192, 339, 275, 193, 276, 277, 278, + 279, 280, 281, 282, 0, 0, 283, 284, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 285, 0, 0, 0, 340, + 0, 0, 0, 0, 0, 342, 287, 288, 289, 290, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 194, + 195, 196, 197, 198, 199, 1, 2, 3, 4, 5, + 6, 7, 8, 9, 10, 329, 330, 331, 0, 332, + 333, 334, 335, 336, 337, 338, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, + 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, + 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, + 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, + 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, + 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185, 186, 187, 188, 189, 190, 191, 192, 339, 275, + 193, 276, 277, 278, 279, 280, 281, 282, 0, 0, + 283, 284, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 285, + 0, 0, 0, 261, 0, 0, 0, 0, 0, 342, + 287, 288, 289, 290, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 194, 195, 196, 197, 198, 199, 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 329, + 330, 331, 0, 332, 333, 334, 335, 336, 337, 338, + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, + 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, + 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, + 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, + 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, + 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, + 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, + 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, + 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, + 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, + 191, 192, 339, 275, 193, 276, 277, 278, 279, 280, + 281, 282, 0, 0, 283, 284, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 285, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 342, 287, 288, 289, 290, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 194, 195, 196, + 197, 198, 199, 1, 2, 3, 4, 5, 6, 7, + 8, 9, 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, + 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, + 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, + 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, + 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, + 187, 188, 189, 190, 191, 192, 0, 275, 193, 276, + 277, 278, 279, 280, 281, 282, 0, 0, 283, 284, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 285, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 342, 287, 288, + 289, 290, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 194, 195, 196, 197, 198, 199, 1, 2, 3, + 4, 5, 6, 7, 8, 9, 10, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 11, 12, + 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, + 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, + 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, + 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, + 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, + 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, + 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, + 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, + 0, 0, 193, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, + 0, 0, 0, 0, 0, 194, 195, 196, 197, 198, + 199, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, + 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, + 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, + 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, + 190, 191, 192, 0, 275, 193, 276, 277, 278, 279, + 280, 281, 282, 0, 0, 283, 284, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 285, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 287, 288, 289, 290, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 194, 195, + 196, 197, 198, 1, 2, 3, 4, 5, 6, 7, + 8, 9, 10, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, + 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, + 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, + 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, + 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, + 187, 188, 189, 190, 191, 192, 0, 242, 193, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 243, 1, 2, + 3, 4, 5, 6, 7, 8, 9, 10, 0, 0, + 0, 194, 195, 196, 197, 198, 0, 0, 0, 11, + 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, + 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, + 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, + 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, + 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, + 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, + 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, + 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 0, 0, 193, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 418, 0, 0, + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, + 0, 0, 0, 0, 0, 0, 194, 195, 196, 197, + 198, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, + 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, + 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, + 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, + 190, 191, 192, 0, 0, 193, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 483, + 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, + 9, 10, 0, 0, 0, 0, 0, 0, 194, 195, + 196, 197, 198, 11, 12, 13, 14, 15, 16, 17, + 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, + 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, + 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, + 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, + 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, + 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, + 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, + 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, + 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, + 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, + 188, 189, 190, 191, 192, 0, 0, 193, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 501, 0, 0, 1, 2, 3, 4, 5, 6, + 7, 8, 9, 10, 0, 0, 0, 0, 0, 0, + 194, 195, 196, 197, 198, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, + 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, + 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, + 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, + 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, + 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, + 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, + 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, + 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, + 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, + 186, 187, 188, 189, 190, 191, 192, 0, 0, 193, + 0, 0, 0, 4, 5, 6, 7, 8, 9, 10, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 194, 195, 196, 197, 198, 47, 48, 49, + 50, 51, 52, 0, 0, 0, 0, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, + 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, + 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, + 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, + 190, 191, 192, 0, 275, 193, 276, 277, 278, 279, + 280, 281, 282, 0, 0, 283, 284, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 285, 0, 0, 0, 364, 517, + 0, 0, 0, 0, 0, 287, 288, 289, 290, 4, + 5, 6, 7, 8, 9, 10, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 12, 13, + 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 47, 48, 49, 50, 51, 52, 0, + 0, 0, 0, 57, 58, 59, 60, 61, 62, 63, + 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, + 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, + 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, + 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, + 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, + 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, + 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, + 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, + 184, 185, 186, 187, 188, 189, 190, 191, 192, 0, + 275, 193, 276, 277, 278, 279, 280, 281, 282, 0, + 0, 283, 284, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 285, 0, 0, 286, 4, 5, 6, 7, 8, 9, + 10, 287, 288, 289, 290, 0, 0, 0, 0, 0, + 0, 0, 0, 12, 13, 14, 15, 16, 17, 18, + 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, + 29, 30, 31, 32, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 47, 48, + 49, 50, 51, 52, 0, 0, 0, 0, 57, 58, + 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, + 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, + 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, + 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, + 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, + 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, + 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, + 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, + 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, + 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, + 189, 190, 191, 192, 0, 275, 193, 276, 277, 278, + 279, 280, 281, 282, 0, 0, 283, 284, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 285, 0, 0, 0, 364, + 0, 0, 0, 0, 0, 0, 287, 288, 289, 290, + 4, 5, 6, 7, 8, 9, 10, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, + 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, + 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 47, 48, 49, 50, 51, 52, + 0, 0, 0, 0, 57, 58, 59, 60, 61, 62, + 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, + 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, + 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, + 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, + 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, + 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, + 0, 275, 193, 276, 277, 278, 279, 280, 281, 282, + 0, 0, 283, 284, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 285, 0, 0, 407, 4, 5, 6, 7, 8, + 9, 10, 287, 288, 289, 290, 0, 0, 0, 0, + 0, 0, 0, 0, 12, 13, 14, 15, 16, 17, + 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, + 28, 29, 30, 31, 32, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 47, + 48, 49, 50, 51, 52, 0, 0, 0, 0, 57, + 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, + 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, + 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, + 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, + 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, + 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, + 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, + 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, + 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, + 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, + 188, 189, 190, 191, 192, 0, 275, 193, 276, 277, + 278, 279, 280, 281, 282, 0, 0, 283, 284, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 285, 4, 5, 6, + 7, 8, 9, 10, 0, 0, 426, 287, 288, 289, + 290, 0, 0, 0, 0, 0, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 47, 48, 49, 50, 51, 52, 0, 0, 0, + 0, 57, 58, 59, 60, 61, 62, 63, 64, 65, + 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, + 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, + 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, + 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, + 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, + 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, + 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, + 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, + 186, 187, 188, 189, 190, 191, 192, 0, 275, 193, + 276, 277, 278, 279, 280, 281, 282, 0, 0, 283, + 284, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 285, 4, + 5, 6, 7, 8, 9, 10, 0, 0, 0, 287, + 288, 289, 290, 0, 0, 0, 0, 0, 12, 13, + 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 47, 48, 49, 50, 51, 52, 0, + 0, 0, 0, 57, 58, 59, 60, 61, 62, 63, + 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, + 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, + 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, + 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, + 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, + 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, + 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, + 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, + 184, 185, 186, 187, 188, 189, 190, 191, 382, 0, + 275, 193, 276, 277, 278, 279, 280, 281, 282, 0, + 0, 283, 284, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 285, 4, 5, 6, 7, 8, 9, 10, 0, 0, + 0, 287, 288, 289, 290, 0, 0, 0, 0, 0, + 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 47, 48, 49, 50, 51, + 52, 0, 0, 0, 0, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, + 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, + 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, + 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, + 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, + 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, + 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, + 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 0, 0, 193 +}; + +static const yytype_int16 yycheck[] = +{ + 0, 205, 213, 269, 0, 285, 0, 228, 354, 54, + 433, 325, 246, 362, 322, 364, 207, 225, 367, 494, + 241, 216, 217, 220, 221, 239, 237, 207, 237, 233, + 239, 526, 246, 299, 509, 530, 238, 246, 237, 239, + 535, 239, 244, 218, 219, 266, 267, 247, 241, 247, + 237, 244, 260, 257, 247, 335, 247, 337, 255, 256, + 368, 241, 237, 239, 239, 239, 247, 238, 243, 238, + 246, 238, 246, 244, 238, 244, 422, 244, 238, 249, + 244, 251, 316, 238, 244, 319, 227, 228, 229, 230, + 231, 232, 233, 234, 235, 236, 362, 377, 364, 413, + 238, 367, 451, 391, 392, 246, 244, 393, 394, 395, + 396, 244, 323, 244, 247, 381, 539, 244, 322, 244, + 247, 325, 247, 244, 244, 244, 247, 247, 247, 263, + 264, 265, 222, 223, 252, 253, 254, 242, 207, 244, + 208, 455, 244, 245, 424, 244, 245, 239, 428, 495, + 241, 500, 389, 390, 397, 398, 241, 207, 207, 239, + 246, 207, 207, 247, 368, 238, 237, 224, 226, 257, + 259, 258, 208, 240, 207, 247, 237, 247, 237, 445, + 446, 247, 237, 245, 207, 451, 237, 207, 242, 237, + 206, 540, 244, 246, 415, 238, 240, 237, 240, 207, + 241, 481, 548, 238, 242, 205, 238, 16, 247, 413, + 241, 241, 246, 213, 494, 242, 399, 401, 247, 404, + 220, 400, 237, 233, 220, 402, 220, 227, 237, 509, + 283, 284, 199, 233, 500, 403, 414, 237, 321, 486, + 520, 489, 525, 535, 231, 536, 509, 489, 220, 302, + -1, 455, -1, 519, 534, -1, -1, 257, -1, -1, + -1, 261, -1, 316, -1, -1, 319, -1, -1, -1, + -1, -1, -1, -1, 540, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 494, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 514, -1, 509, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 322, 323, -1, 325, -1, -1, -1, -1, + -1, -1, -1, 386, 387, 388, 389, 390, 391, 392, + 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, + 403, 404, -1, -1, 354, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 368, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 413, -1, -1, -1, -1, -1, -1, + -1, -1, 422, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 433, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 455, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 489, + -1, -1, -1, -1, 494, 495, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 509, + -1, -1, -1, -1, 514, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 526, -1, -1, -1, + 530, -1, -1, -1, -1, 535, -1, -1, -1, 539, + -1, -1, -1, -1, -1, -1, 0, -1, 548, 3, + 4, 5, 6, 7, 8, 9, 10, 11, 12, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, + 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, + 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, + 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, + 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, + 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, + 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, + 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, + 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, + 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, + 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, + 204, 205, -1, -1, 208, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 261, 262, 263, + 264, 265, 266, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, -1, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, + 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, + 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, + 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, + 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, + 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, + 210, 211, 212, 213, 214, 215, -1, -1, 218, 219, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 237, -1, -1, + -1, 241, 242, -1, -1, -1, -1, 247, 248, 249, + 250, 251, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 261, 262, 263, 264, 265, 266, 3, 4, 5, + 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + -1, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, + 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, + 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, + 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, + 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, + 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, + 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, + 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, + 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, + 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, + 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, + 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, + 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, + -1, -1, 218, 219, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 237, -1, -1, -1, 241, 242, -1, -1, -1, + -1, 247, 248, 249, 250, 251, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 261, 262, 263, 264, 265, + 266, 3, 4, 5, 6, 7, 8, 9, 10, 11, + 12, 13, 14, 15, -1, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, + 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, + 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, + 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, + 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, + 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, + 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, + 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, + 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, + 212, 213, 214, 215, -1, -1, 218, 219, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 237, -1, -1, -1, 241, + -1, -1, -1, -1, -1, 247, 248, 249, 250, 251, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 261, + 262, 263, 264, 265, 266, 3, 4, 5, 6, 7, + 8, 9, 10, 11, 12, 13, 14, 15, -1, 17, + 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, + 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, + 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, + 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, + 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, + 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, + 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, + 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, + 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, + 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, + 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, + 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, + 208, 209, 210, 211, 212, 213, 214, 215, -1, -1, + 218, 219, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 237, + -1, -1, -1, 241, -1, -1, -1, -1, -1, 247, + 248, 249, 250, 251, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 261, 262, 263, 264, 265, 266, 3, + 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, + 14, 15, -1, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, + 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, + 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, + 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, + 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, + 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, + 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, + 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, + 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, + 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, + 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, + 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, + 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, + 214, 215, -1, -1, 218, 219, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 237, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 247, 248, 249, 250, 251, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 261, 262, 263, + 264, 265, 266, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, + 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, + 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, + 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, + 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, + 200, 201, 202, 203, 204, 205, -1, 207, 208, 209, + 210, 211, 212, 213, 214, 215, -1, -1, 218, 219, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 237, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 247, 248, 249, + 250, 251, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 261, 262, 263, 264, 265, 266, 3, 4, 5, + 6, 7, 8, 9, 10, 11, 12, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, + 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, + 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, + 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, + 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, + 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, + 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, + 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, + 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, + 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, + 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, + 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, + -1, -1, 208, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, + -1, -1, -1, -1, -1, 261, 262, 263, 264, 265, + 266, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, + 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, + 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, + 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, + 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, + 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, + 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, + 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, + 203, 204, 205, -1, 207, 208, 209, 210, 211, 212, + 213, 214, 215, -1, -1, 218, 219, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 237, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 248, 249, 250, 251, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 261, 262, + 263, 264, 265, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, + 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, + 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, + 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, + 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, + 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, + 200, 201, 202, 203, 204, 205, -1, 207, 208, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 247, 3, 4, + 5, 6, 7, 8, 9, 10, 11, 12, -1, -1, + -1, 261, 262, 263, 264, 265, -1, -1, -1, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, + 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, + 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, + 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, + 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, + 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, + 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, + 205, -1, -1, 208, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 242, -1, -1, + 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, + -1, -1, -1, -1, -1, -1, 261, 262, 263, 264, + 265, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, + 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, + 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, + 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, + 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, + 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, + 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, + 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, + 203, 204, 205, -1, -1, 208, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 242, + -1, -1, 3, 4, 5, 6, 7, 8, 9, 10, + 11, 12, -1, -1, -1, -1, -1, -1, 261, 262, + 263, 264, 265, 24, 25, 26, 27, 28, 29, 30, + 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, + 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, + 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, + 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, + 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, + 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, + 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, + 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, + 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, + 201, 202, 203, 204, 205, -1, -1, 208, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 242, -1, -1, 3, 4, 5, 6, 7, 8, + 9, 10, 11, 12, -1, -1, -1, -1, -1, -1, + 261, 262, 263, 264, 265, 24, 25, 26, 27, 28, + 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, + 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, + 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, + 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, + 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, + 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, + 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, + 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, + 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, + 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, + 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, + 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, + 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, + 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, + 199, 200, 201, 202, 203, 204, 205, -1, -1, 208, + -1, -1, -1, 6, 7, 8, 9, 10, 11, 12, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 25, 26, 27, 28, 29, 30, 31, 32, + 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 261, 262, 263, 264, 265, 60, 61, 62, + 63, 64, 65, -1, -1, -1, -1, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, + 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, + 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, + 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, + 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, + 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, + 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, + 203, 204, 205, -1, 207, 208, 209, 210, 211, 212, + 213, 214, 215, -1, -1, 218, 219, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 237, -1, -1, -1, 241, 242, + -1, -1, -1, -1, -1, 248, 249, 250, 251, 6, + 7, 8, 9, 10, 11, 12, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 45, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 60, 61, 62, 63, 64, 65, -1, + -1, -1, -1, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, + 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, + 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, + 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, + 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, + 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, + 197, 198, 199, 200, 201, 202, 203, 204, 205, -1, + 207, 208, 209, 210, 211, 212, 213, 214, 215, -1, + -1, 218, 219, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 237, -1, -1, 240, 6, 7, 8, 9, 10, 11, + 12, 248, 249, 250, 251, -1, -1, -1, -1, -1, + -1, -1, -1, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 44, 45, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 60, 61, + 62, 63, 64, 65, -1, -1, -1, -1, 70, 71, + 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, + 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, + 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, + 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, + 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, + 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, + 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, + 202, 203, 204, 205, -1, 207, 208, 209, 210, 211, + 212, 213, 214, 215, -1, -1, 218, 219, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 237, -1, -1, -1, 241, + -1, -1, -1, -1, -1, -1, 248, 249, 250, 251, + 6, 7, 8, 9, 10, 11, 12, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 60, 61, 62, 63, 64, 65, + -1, -1, -1, -1, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, + 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, + 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, + 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, + 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, + 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, + 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, + 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, + 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, + 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, + -1, 207, 208, 209, 210, 211, 212, 213, 214, 215, + -1, -1, 218, 219, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 237, -1, -1, 240, 6, 7, 8, 9, 10, + 11, 12, 248, 249, 250, 251, -1, -1, -1, -1, + -1, -1, -1, -1, 25, 26, 27, 28, 29, 30, + 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 60, + 61, 62, 63, 64, 65, -1, -1, -1, -1, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, + 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, + 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, + 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, + 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, + 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, + 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, + 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, + 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, + 201, 202, 203, 204, 205, -1, 207, 208, 209, 210, + 211, 212, 213, 214, 215, -1, -1, 218, 219, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 237, 6, 7, 8, + 9, 10, 11, 12, -1, -1, 247, 248, 249, 250, + 251, -1, -1, -1, -1, -1, 25, 26, 27, 28, + 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, + 39, 40, 41, 42, 43, 44, 45, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 60, 61, 62, 63, 64, 65, -1, -1, -1, + -1, 70, 71, 72, 73, 74, 75, 76, 77, 78, + 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, + 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, + 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, + 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, + 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, + 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, + 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, + 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, + 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, + 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, + 199, 200, 201, 202, 203, 204, 205, -1, 207, 208, + 209, 210, 211, 212, 213, 214, 215, -1, -1, 218, + 219, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 237, 6, + 7, 8, 9, 10, 11, 12, -1, -1, -1, 248, + 249, 250, 251, -1, -1, -1, -1, -1, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 45, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 60, 61, 62, 63, 64, 65, -1, + -1, -1, -1, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, + 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, + 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, + 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, + 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, + 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, + 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, + 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, + 197, 198, 199, 200, 201, 202, 203, 204, 205, -1, + 207, 208, 209, 210, 211, 212, 213, 214, 215, -1, + -1, 218, 219, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 237, 6, 7, 8, 9, 10, 11, 12, -1, -1, + -1, 248, 249, 250, 251, -1, -1, -1, -1, -1, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 60, 61, 62, 63, 64, + 65, -1, -1, -1, -1, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, + 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, + 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, + 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, + 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, + 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, + 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, + 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, + 205, -1, -1, 208 +}; + + /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing + symbol of state STATE-NUM. */ +static const yytype_uint16 yystos[] = +{ + 0, 3, 4, 5, 6, 7, 8, 9, 10, 11, + 12, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, + 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, + 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, + 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, + 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, + 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, + 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, + 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, + 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, + 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, + 203, 204, 205, 208, 261, 262, 263, 264, 265, 266, + 301, 302, 305, 306, 307, 308, 312, 313, 314, 315, + 316, 317, 320, 321, 322, 323, 325, 327, 328, 329, + 366, 367, 368, 237, 237, 207, 241, 328, 207, 247, + 247, 369, 238, 244, 309, 310, 311, 321, 325, 244, + 247, 207, 207, 247, 322, 325, 239, 326, 0, 367, + 208, 324, 54, 207, 318, 319, 241, 331, 325, 247, + 326, 241, 348, 310, 309, 311, 207, 207, 237, 246, + 326, 241, 244, 247, 304, 207, 209, 210, 211, 212, + 213, 214, 215, 218, 219, 237, 240, 248, 249, 250, + 251, 271, 272, 273, 275, 276, 277, 278, 279, 280, + 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, + 291, 292, 293, 294, 295, 325, 239, 238, 244, 246, + 238, 244, 330, 321, 325, 332, 333, 247, 247, 13, + 14, 15, 17, 18, 19, 20, 21, 22, 23, 206, + 241, 242, 247, 282, 295, 297, 299, 301, 305, 325, + 338, 339, 340, 341, 349, 350, 351, 354, 357, 358, + 365, 326, 246, 326, 241, 297, 336, 246, 303, 207, + 244, 247, 282, 282, 299, 218, 219, 239, 243, 238, + 238, 244, 205, 297, 237, 282, 252, 253, 254, 249, + 251, 216, 217, 220, 221, 255, 256, 222, 223, 259, + 258, 257, 224, 226, 225, 260, 240, 240, 295, 208, + 295, 300, 319, 332, 325, 207, 334, 335, 242, 333, + 247, 247, 360, 237, 237, 247, 247, 299, 237, 299, + 245, 237, 242, 342, 227, 228, 229, 230, 231, 232, + 233, 234, 235, 236, 246, 298, 244, 247, 242, 339, + 336, 246, 336, 337, 336, 332, 207, 238, 274, 299, + 207, 297, 282, 282, 282, 284, 284, 285, 285, 286, + 286, 286, 286, 287, 287, 288, 289, 290, 291, 292, + 293, 296, 240, 242, 334, 326, 244, 247, 339, 361, + 299, 247, 299, 245, 359, 349, 297, 297, 336, 242, + 244, 242, 240, 299, 247, 335, 206, 338, 350, 362, + 238, 238, 299, 314, 321, 353, 343, 242, 336, 245, + 237, 353, 363, 364, 345, 346, 347, 352, 355, 207, + 238, 242, 297, 299, 247, 238, 16, 341, 340, 241, + 246, 340, 344, 348, 238, 299, 344, 345, 349, 356, + 336, 247, 242 +}; + + /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ +static const yytype_uint16 yyr1[] = +{ + 0, 270, 271, 272, 272, 272, 272, 272, 272, 272, + 272, 272, 273, 273, 273, 273, 273, 273, 274, 275, + 276, 277, 277, 278, 278, 279, 279, 280, 281, 281, + 282, 282, 282, 282, 283, 283, 283, 283, 284, 284, + 284, 284, 285, 285, 285, 286, 286, 286, 287, 287, + 287, 287, 287, 288, 288, 288, 289, 289, 290, 290, + 291, 291, 292, 292, 293, 293, 294, 294, 295, 296, + 295, 297, 297, 298, 298, 298, 298, 298, 298, 298, + 298, 298, 298, 298, 299, 299, 300, 301, 301, 301, + 301, 301, 301, 301, 301, 301, 303, 302, 304, 304, + 305, 306, 306, 307, 307, 308, 309, 309, 310, 310, + 310, 310, 311, 312, 312, 312, 312, 312, 313, 313, + 313, 313, 313, 314, 314, 315, 316, 316, 316, 317, + 318, 318, 319, 319, 319, 320, 321, 321, 322, 322, + 322, 322, 322, 322, 323, 323, 323, 323, 323, 323, + 323, 323, 323, 323, 323, 323, 323, 323, 323, 323, + 323, 323, 323, 324, 324, 325, 325, 326, 326, 326, + 326, 327, 327, 327, 327, 327, 327, 327, 327, 327, + 327, 327, 327, 327, 327, 327, 327, 327, 327, 327, + 327, 327, 327, 327, 327, 327, 327, 327, 327, 327, + 327, 327, 327, 327, 327, 327, 327, 327, 327, 327, + 327, 327, 327, 327, 327, 327, 327, 327, 327, 327, + 327, 327, 327, 327, 327, 327, 327, 327, 327, 327, + 327, 327, 327, 327, 327, 327, 327, 327, 327, 327, + 327, 327, 327, 327, 327, 327, 327, 327, 327, 327, + 327, 327, 327, 327, 327, 327, 327, 327, 327, 327, + 327, 327, 327, 327, 327, 327, 327, 327, 327, 327, + 327, 327, 327, 327, 327, 327, 327, 327, 327, 327, + 327, 327, 327, 327, 327, 327, 327, 327, 327, 327, + 327, 327, 327, 327, 327, 327, 327, 327, 327, 327, + 327, 327, 327, 327, 327, 327, 327, 327, 327, 327, + 327, 327, 327, 327, 327, 327, 327, 327, 327, 327, + 327, 327, 327, 327, 327, 327, 327, 327, 327, 327, + 327, 327, 327, 327, 327, 327, 327, 327, 327, 327, + 327, 327, 328, 328, 328, 330, 329, 331, 329, 332, + 332, 333, 333, 334, 334, 335, 335, 336, 336, 336, + 337, 337, 338, 339, 339, 340, 340, 340, 340, 340, + 340, 340, 341, 342, 343, 341, 344, 344, 346, 345, + 347, 345, 348, 348, 349, 349, 350, 350, 351, 352, + 352, 353, 353, 355, 354, 356, 356, 357, 357, 359, + 358, 360, 358, 361, 358, 362, 362, 363, 363, 364, + 364, 365, 365, 365, 365, 365, 366, 366, 367, 367, + 369, 368 +}; + + /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ static const yytype_uint8 yyr2[] = { - 0, 2, 1, 1, 1, 1, 1, 1, 1, 3, - 1, 4, 1, 3, 2, 2, 1, 1, 1, 2, - 2, 2, 1, 2, 3, 2, 1, 1, 1, 2, - 2, 2, 1, 1, 1, 1, 1, 3, 3, 3, - 1, 3, 3, 1, 3, 3, 1, 3, 3, 3, - 3, 1, 3, 3, 1, 3, 1, 3, 1, 3, - 1, 3, 1, 3, 1, 3, 1, 0, 6, 1, - 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 3, 1, 2, 2, 4, 2, 3, - 4, 2, 3, 4, 0, 6, 2, 3, 2, 1, - 1, 2, 3, 3, 2, 3, 2, 1, 2, 1, - 1, 1, 3, 4, 6, 5, 1, 2, 3, 5, - 4, 1, 2, 1, 1, 1, 1, 4, 1, 3, - 1, 3, 1, 1, 1, 2, 1, 1, 1, 1, + 0, 2, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 3, 1, 4, 1, 3, 2, 2, 1, 1, + 1, 2, 2, 2, 1, 2, 3, 2, 1, 1, + 1, 2, 2, 2, 1, 1, 1, 1, 1, 3, + 3, 3, 1, 3, 3, 1, 3, 3, 1, 3, + 3, 3, 3, 1, 3, 3, 1, 3, 1, 3, + 1, 3, 1, 3, 1, 3, 1, 3, 1, 0, + 6, 1, 3, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 3, 1, 2, 2, 4, + 2, 3, 4, 2, 3, 4, 0, 6, 2, 3, + 2, 1, 1, 2, 3, 3, 2, 3, 2, 1, + 2, 1, 1, 1, 3, 4, 6, 5, 1, 2, + 3, 5, 4, 1, 2, 1, 1, 1, 1, 4, + 1, 3, 1, 3, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 4, 1, 3, 1, 2, 2, 3, 3, 4, 1, + 1, 1, 4, 1, 3, 1, 2, 2, 3, 3, + 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -1191,1395 +2486,16 @@ static const yytype_uint8 yyr2[] = 0, 3 }; -/* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM. - Performed when YYTABLE doesn't specify something else to do. Zero - means the default is an error. */ -static const yytype_uint16 yydefact[] = -{ - 0, 143, 144, 142, 174, 170, 171, 172, 173, 159, - 181, 182, 183, 184, 185, 186, 187, 188, 189, 175, - 176, 177, 190, 191, 192, 148, 146, 147, 145, 151, - 149, 150, 152, 153, 154, 155, 156, 157, 158, 178, - 179, 180, 202, 203, 204, 126, 125, 124, 0, 193, - 194, 195, 196, 197, 198, 199, 200, 201, 205, 206, - 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, - 217, 218, 219, 220, 221, 222, 223, 224, 225, 228, - 229, 230, 231, 232, 233, 235, 236, 237, 238, 239, - 240, 242, 243, 244, 245, 246, 247, 248, 226, 227, - 234, 241, 249, 250, 251, 252, 253, 254, 323, 255, - 256, 257, 258, 259, 260, 261, 262, 264, 265, 266, - 267, 268, 269, 271, 272, 273, 274, 275, 276, 278, - 279, 280, 281, 282, 283, 263, 270, 277, 284, 285, - 286, 287, 288, 289, 324, 325, 326, 327, 328, 329, - 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, - 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, - 320, 321, 322, 0, 169, 331, 123, 133, 332, 333, - 334, 0, 409, 0, 410, 0, 100, 99, 0, 111, - 116, 140, 139, 137, 141, 0, 134, 136, 121, 163, - 138, 330, 0, 406, 408, 0, 0, 0, 337, 0, - 0, 88, 85, 0, 98, 0, 107, 101, 109, 0, - 110, 0, 86, 117, 0, 91, 135, 122, 0, 164, - 1, 407, 161, 0, 132, 130, 0, 128, 335, 0, - 0, 89, 0, 0, 411, 102, 106, 108, 104, 112, - 103, 0, 118, 94, 0, 92, 0, 2, 6, 7, - 4, 5, 8, 0, 0, 0, 165, 34, 33, 35, - 32, 3, 10, 28, 12, 17, 18, 0, 0, 22, - 0, 36, 0, 40, 43, 46, 51, 54, 56, 58, - 60, 62, 64, 66, 0, 26, 0, 160, 0, 0, - 127, 0, 0, 0, 0, 0, 339, 87, 90, 0, - 0, 391, 0, 0, 0, 0, 0, 0, 0, 0, - 363, 372, 376, 36, 69, 82, 0, 352, 0, 121, - 355, 374, 354, 353, 0, 356, 357, 358, 359, 360, - 361, 105, 0, 113, 0, 347, 120, 0, 0, 96, - 0, 93, 29, 30, 0, 14, 15, 0, 0, 20, - 19, 0, 169, 23, 25, 31, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 67, 166, 167, 0, 162, - 84, 131, 129, 0, 0, 345, 0, 343, 338, 340, - 402, 401, 0, 393, 0, 405, 403, 0, 0, 0, - 388, 389, 362, 0, 72, 73, 75, 74, 77, 78, - 79, 80, 81, 76, 71, 0, 0, 377, 373, 375, - 115, 0, 350, 0, 119, 0, 97, 9, 0, 16, - 13, 24, 37, 38, 39, 42, 41, 44, 45, 49, - 50, 47, 48, 52, 53, 55, 57, 59, 61, 63, - 65, 0, 168, 336, 0, 346, 0, 341, 0, 0, - 0, 404, 0, 387, 0, 364, 70, 83, 114, 348, - 0, 95, 11, 0, 342, 344, 0, 396, 395, 398, - 370, 383, 381, 0, 0, 0, 0, 349, 351, 0, - 0, 397, 0, 0, 380, 0, 0, 378, 0, 0, - 0, 365, 68, 0, 399, 0, 370, 369, 371, 385, - 0, 367, 390, 366, 0, 400, 394, 379, 386, 0, - 382, 392, 384 -}; -/* YYDEFGOTO[NTERM-NUM]. */ -static const yytype_int16 yydefgoto[] = -{ - -1, 281, 282, 283, 448, 284, 285, 286, 287, 288, - 289, 290, 333, 292, 293, 294, 295, 296, 297, 298, - 299, 300, 301, 302, 303, 334, 471, 335, 435, 336, - 401, 337, 193, 358, 266, 338, 195, 196, 197, 226, - 227, 228, 198, 199, 200, 201, 202, 203, 246, 247, - 204, 205, 206, 207, 243, 305, 239, 209, 210, 211, - 312, 249, 315, 316, 406, 407, 356, 443, 340, 341, - 342, 343, 423, 506, 532, 514, 515, 516, 533, 344, - 345, 346, 517, 505, 347, 518, 539, 348, 349, 484, - 412, 479, 499, 512, 513, 350, 212, 213, 214, 223 -}; +#define yyerrok (yyerrstatus = 0) +#define yyclearin (yychar = YYEMPTY) +#define YYEMPTY (-2) +#define YYEOF 0 -/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ -#define YYPACT_NINF -466 -static const yytype_int16 yypact[] = -{ - 2275, -466, -466, -466, -466, -466, -466, -466, -466, -205, - -466, -466, -466, -466, -466, -466, -466, -466, -466, -466, - -466, -466, -466, -466, -466, -466, -466, -466, -466, -466, - -466, -466, -466, -466, -466, -466, -466, -466, -466, -466, - -466, -466, -466, -466, -466, -466, -466, -466, -192, -466, - -466, -466, -466, -466, -466, -466, -466, -466, -466, -466, - -466, -466, -466, -466, -466, -466, -466, -466, -466, -466, - -466, -466, -466, -466, -466, -466, -466, -466, -466, -466, - -466, -466, -466, -466, -466, -466, -466, -466, -466, -466, - -466, -466, -466, -466, -466, -466, -466, -466, -466, -466, - -466, -466, -466, -466, -466, -466, -466, -466, -466, -466, - -466, -466, -466, -466, -466, -466, -466, -466, -466, -466, - -466, -466, -466, -466, -466, -466, -466, -466, -466, -466, - -466, -466, -466, -466, -466, -466, -466, -466, -466, -466, - -466, -466, -466, -466, -466, -466, -466, -466, -466, -466, - -466, -466, -466, -466, -466, -466, -466, -466, -466, -466, - -466, -466, -466, -466, -466, -466, -466, -466, -466, -466, - -466, -466, -466, -466, -466, -466, -466, -466, -466, -466, - -466, -466, -466, -179, -466, -466, -466, -466, -466, -466, - -466, -122, -466, -186, -198, -173, -175, 3686, -194, -466, - -121, -466, -466, -466, -466, 2749, -466, -466, -466, -141, - -466, -466, 527, -466, -466, -97, -37, -117, -466, 5459, - -200, -466, -466, -112, -466, 3686, -466, -466, -466, 3686, - -71, -44, -466, -191, -142, -466, -466, -466, 4117, -82, - -466, -466, -466, -202, -466, -76, -137, -466, -466, 3686, - -73, -466, -196, 781, -466, -466, -466, -466, -141, -155, - -466, 4342, -152, -466, -38, -466, -177, -466, -466, -466, - -466, -466, -466, 5015, 5015, 5015, -466, -466, -466, -466, - -466, -466, -466, -185, -466, -466, -466, -63, -128, 5237, - -61, -466, 5015, -106, -100, -157, -183, -78, -81, -79, - -80, -43, -46, -197, -58, -466, 4568, -466, -27, 5015, - -466, -37, 3686, 3686, -25, 2984, -466, -466, -466, -62, - -57, -466, -51, -48, -56, 4793, -45, 5015, -50, -40, - -41, -466, -466, -153, -466, -466, -147, -466, -198, -39, - -466, -466, -466, -466, 1035, -466, -466, -466, -466, -466, - -466, -82, 4342, -143, 4342, -466, -466, 4342, 3686, -466, - -15, -466, -466, -466, -126, -466, -466, 5015, -10, -466, - -466, 5015, -36, -466, -466, -466, 5015, 5015, 5015, 5015, - 5015, 5015, 5015, 5015, 5015, 5015, 5015, 5015, 5015, 5015, - 5015, 5015, 5015, 5015, 5015, -466, -466, -466, -35, -466, - -466, -466, -466, 3218, -25, -141, -127, -466, -466, -466, - -466, -466, 1289, -466, 5015, -466, -466, -108, 5015, -91, - -466, -466, -466, 1289, -466, -466, -466, -466, -466, -466, - -466, -466, -466, -466, -466, 5015, 5015, -466, -466, -466, - -466, 4342, -466, -92, -466, 3452, -466, -466, -34, -31, - -466, -466, -466, -466, -466, -106, -106, -100, -100, -157, - -157, -157, -157, -183, -183, -78, -81, -79, -80, -43, - -46, 5015, -466, -466, -107, -82, -25, -466, -4, 2036, - -123, -466, -116, -466, 2510, 1289, -466, -466, -466, -466, - 3890, -466, -466, -83, -466, -466, -29, -466, -466, 2510, - -32, -466, -31, 1, 3686, -24, -26, -466, -466, 5015, - 5015, -466, -30, -19, 196, -20, 1797, -466, -18, -22, - 1543, -466, -466, -113, 5015, 1543, -32, -466, -466, 1289, - 4342, -466, -466, -466, -17, -31, -466, -466, 1289, -14, - -466, -466, -466 -}; +#define YYACCEPT goto yyacceptlab +#define YYABORT goto yyabortlab +#define YYERROR goto yyerrorlab -/* YYPGOTO[NTERM-NUM]. */ -static const yytype_int16 yypgoto[] = -{ - -466, -466, -466, -466, -466, -466, -466, -466, -466, -466, - -466, -466, -52, -466, -226, -225, -261, -229, -166, -164, - -167, -165, -162, -161, -466, -227, -466, -258, -466, -269, - -466, 4, -466, -466, -466, 5, -466, -466, -466, -1, - 9, 6, -466, -466, -465, -466, -466, -466, -466, -75, - -466, -195, -204, -466, -466, 0, -212, -466, 46, -466, - -466, -466, -297, -299, -160, -238, -340, -466, -240, -337, - -440, -273, -466, -466, -282, -281, -466, -466, 23, -413, - -232, -466, -466, -251, -466, -466, -466, -466, -466, -466, - -466, -466, -466, -466, -466, -466, -466, 40, -466, -466 -}; - -/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule which - number is the opposite. If YYTABLE_NINF, syntax error. */ -#define YYTABLE_NINF -369 -static const yytype_int16 yytable[] = -{ - 208, 236, 229, 355, 192, 194, 364, 439, 252, 244, - 485, 304, 440, 220, 442, 403, 409, 444, 394, 503, - 217, 262, 215, 365, 366, 236, 307, 383, 384, 238, - 229, 373, 308, 306, 503, 216, 260, 251, 238, 222, - 231, 318, -27, 232, 367, 261, 351, 353, 368, 381, - 382, 221, 218, 395, 313, 224, 417, 360, 419, 225, - 361, 445, 385, 386, 424, 425, 426, 427, 428, 429, - 430, 431, 432, 433, 238, 478, 528, 306, 233, 398, - 531, 352, 400, 434, 357, 531, 306, 436, 238, 263, - 437, 310, 264, 441, 355, 265, 355, 311, 449, 355, - 370, 488, 447, 242, 409, 500, 371, 476, 436, 236, - 477, 436, 501, 451, 248, 534, 538, 313, 436, 253, - 313, 436, 459, 460, 461, 462, 436, 476, 258, 481, - 494, 188, 189, 190, 387, 388, 376, 377, 378, 379, - 489, 380, 490, 436, 483, 480, 409, 306, 439, 482, - 508, 436, 509, 455, 456, 259, 457, 458, 463, 464, - 309, 359, 245, 313, 317, 369, 374, 391, 389, 390, - 393, 392, 396, 399, 405, 410, 413, 486, 487, 414, - 411, 415, 418, 355, 446, 420, 291, 421, -26, 450, - 540, 422, -21, 475, 496, 472, 492, 230, 510, -368, - 519, 439, 493, 436, 520, 237, 521, 524, 313, 525, - 526, 330, 208, 529, 530, 502, 192, 194, 542, 250, - 541, 362, 363, 465, 467, 230, 466, 468, 256, 230, - 502, 469, 355, 470, 255, 257, 402, 219, 495, 497, - 375, 523, 527, 536, 474, 537, 254, 498, 511, 314, - 313, 522, 241, 339, 291, 535, 0, 291, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 355, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 504, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 236, 0, 0, 0, 504, 0, 0, 0, 0, 0, - 0, 0, 314, 404, 0, 314, 0, 0, 0, 0, - 0, 0, 0, 0, 452, 453, 454, 291, 291, 291, - 291, 291, 291, 291, 291, 291, 291, 291, 291, 291, - 291, 291, 291, 0, 339, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 314, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 314, 0, 0, 0, 0, 0, 0, - 0, 0, 339, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 339, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 314, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 339, - 0, 0, 0, 0, 339, 339, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 339, - 0, 0, 0, 0, 237, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 339, 0, 0, 0, - 339, 0, 0, 0, 0, 339, 0, 240, 0, 339, - 1, 2, 3, 4, 5, 6, 7, 8, 339, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, - 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, - 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, - 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, - 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, - 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, - 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, - 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, - 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, - 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 0, 0, 185, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 186, 187, - 188, 189, 190, 191, 1, 2, 3, 4, 5, 6, - 7, 8, 319, 320, 321, 0, 322, 323, 324, 325, - 326, 327, 328, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, - 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, - 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, - 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, - 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, - 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, - 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, - 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, - 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, - 176, 177, 178, 179, 180, 181, 182, 183, 184, 329, - 267, 185, 268, 269, 270, 271, 272, 0, 0, 273, - 274, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 275, 0, - 0, 0, 330, 331, 0, 0, 0, 0, 332, 277, - 278, 279, 280, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 186, 187, 188, 189, 190, 191, 1, 2, - 3, 4, 5, 6, 7, 8, 319, 320, 321, 0, - 322, 323, 324, 325, 326, 327, 328, 9, 10, 11, - 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, - 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, - 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, - 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, - 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, - 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, - 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, - 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, - 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, - 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, - 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, - 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, - 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, - 182, 183, 184, 329, 267, 185, 268, 269, 270, 271, - 272, 0, 0, 273, 274, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 275, 0, 0, 0, 330, 438, 0, 0, - 0, 0, 332, 277, 278, 279, 280, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 186, 187, 188, 189, - 190, 191, 1, 2, 3, 4, 5, 6, 7, 8, - 319, 320, 321, 0, 322, 323, 324, 325, 326, 327, - 328, 9, 10, 11, 12, 13, 14, 15, 16, 17, - 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, - 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, - 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, - 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, - 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, - 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, - 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, - 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, - 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, - 178, 179, 180, 181, 182, 183, 184, 329, 267, 185, - 268, 269, 270, 271, 272, 0, 0, 273, 274, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 275, 0, 0, 0, - 330, 0, 0, 0, 0, 0, 332, 277, 278, 279, - 280, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 186, 187, 188, 189, 190, 191, 1, 2, 3, 4, - 5, 6, 7, 8, 319, 320, 321, 0, 322, 323, - 324, 325, 326, 327, 328, 9, 10, 11, 12, 13, - 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, - 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, - 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, - 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, - 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, - 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, - 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, - 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, - 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, - 184, 329, 267, 185, 268, 269, 270, 271, 272, 0, - 0, 273, 274, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 275, 0, 0, 0, 253, 0, 0, 0, 0, 0, - 332, 277, 278, 279, 280, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 186, 187, 188, 189, 190, 191, - 1, 2, 3, 4, 5, 6, 7, 8, 319, 320, - 321, 0, 322, 323, 324, 325, 326, 327, 328, 9, - 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, - 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, - 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, - 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, - 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, - 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, - 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, - 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, - 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 329, 267, 185, 268, 269, - 270, 271, 272, 0, 0, 273, 274, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 275, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 332, 277, 278, 279, 280, 1, - 2, 3, 4, 5, 6, 7, 8, 0, 186, 187, - 188, 189, 190, 191, 0, 0, 0, 0, 9, 10, - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, - 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, - 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, - 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, - 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, - 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, - 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, - 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, - 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, - 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, - 181, 182, 183, 184, 0, 267, 185, 268, 269, 270, - 271, 272, 0, 0, 273, 274, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 275, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 332, 277, 278, 279, 280, 1, 2, - 3, 4, 5, 6, 7, 8, 0, 186, 187, 188, - 189, 190, 191, 0, 0, 0, 0, 9, 10, 11, - 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, - 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, - 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, - 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, - 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, - 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, - 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, - 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, - 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, - 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, - 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, - 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, - 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, - 182, 183, 184, 0, 0, 185, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, - 8, 0, 0, 0, 0, 0, 186, 187, 188, 189, - 190, 191, 9, 10, 11, 12, 13, 14, 15, 16, - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, - 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, - 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, - 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, - 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, - 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, - 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, - 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, - 177, 178, 179, 180, 181, 182, 183, 184, 0, 267, - 185, 268, 269, 270, 271, 272, 0, 0, 273, 274, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 275, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 277, 278, - 279, 280, 1, 2, 3, 4, 5, 6, 7, 8, - 0, 186, 187, 188, 189, 190, 0, 0, 0, 0, - 0, 9, 10, 11, 12, 13, 14, 15, 16, 17, - 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, - 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, - 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, - 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, - 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, - 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, - 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, - 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, - 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, - 178, 179, 180, 181, 182, 183, 184, 0, 234, 185, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 235, 1, 2, 3, - 4, 5, 6, 7, 8, 0, 0, 0, 0, 0, - 186, 187, 188, 189, 190, 0, 9, 10, 11, 12, - 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, - 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, - 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, - 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, - 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, - 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, - 183, 184, 0, 0, 185, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 408, 0, 0, 0, - 0, 1, 2, 3, 4, 5, 6, 7, 8, 0, - 0, 0, 0, 0, 0, 186, 187, 188, 189, 190, - 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, - 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, - 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, - 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, - 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, - 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, - 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, - 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, - 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, - 179, 180, 181, 182, 183, 184, 0, 0, 185, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 473, 0, 0, 0, 0, 1, 2, 3, 4, 5, - 6, 7, 8, 0, 0, 0, 0, 0, 0, 186, - 187, 188, 189, 190, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, - 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, - 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, - 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 0, 0, 185, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 491, 0, 0, 0, 0, 1, - 2, 3, 4, 5, 6, 7, 8, 0, 0, 0, - 0, 0, 0, 186, 187, 188, 189, 190, 9, 10, - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, - 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, - 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, - 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, - 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, - 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, - 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, - 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, - 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, - 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, - 181, 182, 183, 184, 0, 0, 185, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 4, 5, 6, 7, - 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 10, 11, 12, 13, 14, 15, 16, - 17, 18, 19, 20, 21, 22, 23, 24, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 186, 187, 188, - 189, 190, 39, 40, 41, 42, 43, 44, 0, 0, - 0, 0, 49, 50, 51, 52, 53, 54, 55, 56, - 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, - 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, - 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, - 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, - 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, - 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, - 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, - 177, 178, 179, 180, 181, 182, 183, 184, 0, 267, - 185, 268, 269, 270, 271, 272, 0, 0, 273, 274, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 275, 0, 0, - 0, 354, 507, 4, 5, 6, 7, 8, 277, 278, - 279, 280, 0, 0, 0, 0, 0, 0, 0, 0, - 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, - 20, 21, 22, 23, 24, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 39, - 40, 41, 42, 43, 44, 0, 0, 0, 0, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, - 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, - 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, - 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, - 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, - 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, - 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, - 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 0, 267, 185, 268, 269, - 270, 271, 272, 0, 0, 273, 274, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 275, 0, 0, 276, 4, 5, - 6, 7, 8, 0, 0, 277, 278, 279, 280, 0, - 0, 0, 0, 0, 0, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 39, 40, 41, 42, 43, 44, - 0, 0, 0, 0, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, - 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, - 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, - 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 0, 267, 185, 268, 269, 270, 271, 272, 0, 0, - 273, 274, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 275, - 0, 0, 0, 354, 4, 5, 6, 7, 8, 0, - 277, 278, 279, 280, 0, 0, 0, 0, 0, 0, - 0, 10, 11, 12, 13, 14, 15, 16, 17, 18, - 19, 20, 21, 22, 23, 24, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 39, 40, 41, 42, 43, 44, 0, 0, 0, 0, - 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, - 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, - 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, - 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, - 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, - 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, - 179, 180, 181, 182, 183, 184, 0, 267, 185, 268, - 269, 270, 271, 272, 0, 0, 273, 274, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 275, 0, 0, 397, 4, - 5, 6, 7, 8, 0, 0, 277, 278, 279, 280, - 0, 0, 0, 0, 0, 0, 10, 11, 12, 13, - 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, - 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 39, 40, 41, 42, 43, - 44, 0, 0, 0, 0, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, - 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, - 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, - 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, - 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, - 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, - 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, - 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, - 184, 0, 267, 185, 268, 269, 270, 271, 272, 0, - 0, 273, 274, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 275, 4, 5, 6, 7, 8, 0, 0, 0, 0, - 416, 277, 278, 279, 280, 0, 0, 0, 10, 11, - 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, - 22, 23, 24, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 39, 40, 41, - 42, 43, 44, 0, 0, 0, 0, 49, 50, 51, - 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, - 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, - 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, - 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, - 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, - 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, - 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, - 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, - 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, - 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, - 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, - 182, 183, 184, 0, 267, 185, 268, 269, 270, 271, - 272, 0, 0, 273, 274, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 275, 4, 5, 6, 7, 8, 0, 0, - 0, 0, 0, 277, 278, 279, 280, 0, 0, 0, - 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, - 20, 21, 22, 23, 24, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 39, - 40, 41, 42, 43, 44, 0, 0, 0, 0, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, - 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, - 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, - 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, - 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, - 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, - 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, - 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 372, 0, 267, 185, 268, 269, - 270, 271, 272, 0, 0, 273, 274, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 275, 4, 5, 6, 7, 8, - 0, 0, 0, 0, 0, 277, 278, 279, 280, 0, - 0, 0, 10, 11, 12, 13, 14, 15, 16, 17, - 18, 19, 20, 21, 22, 23, 24, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 39, 40, 41, 42, 43, 44, 0, 0, 0, - 0, 49, 50, 51, 52, 53, 54, 55, 56, 57, - 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, - 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, - 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, - 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, - 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, - 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, - 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, - 178, 179, 180, 181, 182, 183, 184, 0, 0, 185 -}; - -#define yypact_value_is_default(Yystate) \ - (!!((Yystate) == (-466))) - -#define yytable_value_is_error(Yytable_value) \ - YYID (0) - -static const yytype_int16 yycheck[] = -{ - 0, 205, 197, 261, 0, 0, 275, 344, 220, 46, - 423, 238, 352, 199, 354, 312, 315, 357, 215, 484, - 199, 233, 227, 208, 209, 229, 228, 210, 211, 229, - 225, 289, 234, 229, 499, 227, 227, 237, 229, 237, - 234, 237, 227, 237, 229, 236, 258, 259, 233, 206, - 207, 237, 231, 250, 249, 228, 325, 234, 327, 234, - 237, 358, 245, 246, 217, 218, 219, 220, 221, 222, - 223, 224, 225, 226, 229, 412, 516, 229, 199, 306, - 520, 236, 309, 236, 236, 525, 229, 234, 229, 231, - 237, 228, 234, 236, 352, 237, 354, 234, 367, 357, - 228, 441, 228, 200, 403, 228, 234, 234, 234, 313, - 237, 234, 228, 371, 231, 228, 529, 312, 234, 231, - 315, 234, 383, 384, 385, 386, 234, 234, 199, 237, - 237, 253, 254, 255, 212, 213, 242, 243, 244, 239, - 232, 241, 234, 234, 235, 414, 445, 229, 485, 418, - 490, 234, 235, 379, 380, 199, 381, 382, 387, 388, - 236, 199, 199, 358, 237, 228, 227, 247, 249, 248, - 216, 214, 230, 200, 199, 237, 227, 435, 436, 227, - 237, 237, 227, 441, 199, 235, 238, 227, 227, 199, - 530, 232, 228, 405, 198, 230, 230, 197, 227, 231, - 199, 538, 471, 234, 228, 205, 232, 237, 403, 228, - 14, 231, 212, 231, 236, 484, 212, 212, 232, 219, - 237, 273, 274, 389, 391, 225, 390, 392, 229, 229, - 499, 393, 490, 394, 225, 229, 311, 191, 476, 479, - 292, 510, 515, 525, 404, 526, 223, 479, 499, 249, - 445, 509, 212, 253, 306, 524, -1, 309, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 530, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 484, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 504, -1, -1, -1, 499, -1, -1, -1, -1, -1, - -1, -1, 312, 313, -1, 315, -1, -1, -1, -1, - -1, -1, -1, -1, 376, 377, 378, 379, 380, 381, - 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, - 392, 393, 394, -1, 344, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 358, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 403, -1, -1, -1, -1, -1, -1, - -1, -1, 412, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 423, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 445, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 479, - -1, -1, -1, -1, 484, 485, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 499, - -1, -1, -1, -1, 504, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 516, -1, -1, -1, - 520, -1, -1, -1, -1, 525, -1, 0, -1, 529, - 3, 4, 5, 6, 7, 8, 9, 10, 538, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 22, - 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, - 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, - 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, - 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, - 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, - 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, - 193, 194, 195, 196, 197, -1, -1, 200, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 251, 252, - 253, 254, 255, 256, 3, 4, 5, 6, 7, 8, - 9, 10, 11, 12, 13, -1, 15, 16, 17, 18, - 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, - 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, - 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, - 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, - 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, - 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, - 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, - 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, - 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, - 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, - 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, - 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, - 199, 200, 201, 202, 203, 204, 205, -1, -1, 208, - 209, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 227, -1, - -1, -1, 231, 232, -1, -1, -1, -1, 237, 238, - 239, 240, 241, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 251, 252, 253, 254, 255, 256, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13, -1, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, - 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, - 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, - 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, - 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, - 205, -1, -1, 208, 209, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 227, -1, -1, -1, 231, 232, -1, -1, - -1, -1, 237, 238, 239, 240, 241, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 251, 252, 253, 254, - 255, 256, 3, 4, 5, 6, 7, 8, 9, 10, - 11, 12, 13, -1, 15, 16, 17, 18, 19, 20, - 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, - 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, - 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, - 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, - 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, - 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, - 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, - 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, - 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, - 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, - 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, - 201, 202, 203, 204, 205, -1, -1, 208, 209, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 227, -1, -1, -1, - 231, -1, -1, -1, -1, -1, 237, 238, 239, 240, - 241, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 251, 252, 253, 254, 255, 256, 3, 4, 5, 6, - 7, 8, 9, 10, 11, 12, 13, -1, 15, 16, - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, - 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, - 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, - 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, - 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, - 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, - 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, - 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, - 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, - 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, - 197, 198, 199, 200, 201, 202, 203, 204, 205, -1, - -1, 208, 209, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 227, -1, -1, -1, 231, -1, -1, -1, -1, -1, - 237, 238, 239, 240, 241, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 251, 252, 253, 254, 255, 256, - 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, - 13, -1, 15, 16, 17, 18, 19, 20, 21, 22, - 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, - 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, - 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, - 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, - 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, - 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, - 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, - 203, 204, 205, -1, -1, 208, 209, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 227, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 237, 238, 239, 240, 241, 3, - 4, 5, 6, 7, 8, 9, 10, -1, 251, 252, - 253, 254, 255, 256, -1, -1, -1, -1, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, - 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, - 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, - 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, - 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, - 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, - 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, - 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, - 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, - 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, - 194, 195, 196, 197, -1, 199, 200, 201, 202, 203, - 204, 205, -1, -1, 208, 209, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 227, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 237, 238, 239, 240, 241, 3, 4, - 5, 6, 7, 8, 9, 10, -1, 251, 252, 253, - 254, 255, 256, -1, -1, -1, -1, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, - 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, - 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, - 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, - 195, 196, 197, -1, -1, 200, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 3, 4, 5, 6, 7, 8, 9, - 10, -1, -1, -1, -1, -1, 251, 252, 253, 254, - 255, 256, 22, 23, 24, 25, 26, 27, 28, 29, - 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, - 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, - 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, - 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, - 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, - 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, - 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, - 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, - 190, 191, 192, 193, 194, 195, 196, 197, -1, 199, - 200, 201, 202, 203, 204, 205, -1, -1, 208, 209, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 227, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 238, 239, - 240, 241, 3, 4, 5, 6, 7, 8, 9, 10, - -1, 251, 252, 253, 254, 255, -1, -1, -1, -1, - -1, 22, 23, 24, 25, 26, 27, 28, 29, 30, - 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, - 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, - 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, - 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, - 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, - 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, - 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, - 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, - 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, - 191, 192, 193, 194, 195, 196, 197, -1, 199, 200, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 237, 3, 4, 5, - 6, 7, 8, 9, 10, -1, -1, -1, -1, -1, - 251, 252, 253, 254, 255, -1, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, - 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, - 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, - 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, - 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, - 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, - 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, - 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, - 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, - 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, - 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, - 196, 197, -1, -1, 200, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 232, -1, -1, -1, - -1, 3, 4, 5, 6, 7, 8, 9, 10, -1, - -1, -1, -1, -1, -1, 251, 252, 253, 254, 255, - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, - 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, - 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, - 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, - 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, - 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, - 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, - 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, - 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, - 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, - 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, - 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, - 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, - 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, -1, -1, 200, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 232, -1, -1, -1, -1, 3, 4, 5, 6, 7, - 8, 9, 10, -1, -1, -1, -1, -1, -1, 251, - 252, 253, 254, 255, 22, 23, 24, 25, 26, 27, - 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, - 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, - 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, - 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, - 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, - 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, - 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, - 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, - 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, - 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, - -1, -1, 200, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 232, -1, -1, -1, -1, 3, - 4, 5, 6, 7, 8, 9, 10, -1, -1, -1, - -1, -1, -1, 251, 252, 253, 254, 255, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, - 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, - 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, - 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, - 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, - 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, - 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, - 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, - 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, - 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, - 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, - 194, 195, 196, 197, -1, -1, 200, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 6, 7, 8, 9, - 10, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 23, 24, 25, 26, 27, 28, 29, - 30, 31, 32, 33, 34, 35, 36, 37, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 251, 252, 253, - 254, 255, 52, 53, 54, 55, 56, 57, -1, -1, - -1, -1, 62, 63, 64, 65, 66, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, - 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, - 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, - 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, - 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, - 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, - 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, - 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, - 190, 191, 192, 193, 194, 195, 196, 197, -1, 199, - 200, 201, 202, 203, 204, 205, -1, -1, 208, 209, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 227, -1, -1, - -1, 231, 232, 6, 7, 8, 9, 10, 238, 239, - 240, 241, -1, -1, -1, -1, -1, -1, -1, -1, - 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, - 33, 34, 35, 36, 37, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 52, - 53, 54, 55, 56, 57, -1, -1, -1, -1, 62, - 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, - 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, - 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, - 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, - 193, 194, 195, 196, 197, -1, 199, 200, 201, 202, - 203, 204, 205, -1, -1, 208, 209, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 227, -1, -1, 230, 6, 7, - 8, 9, 10, -1, -1, 238, 239, 240, 241, -1, - -1, -1, -1, -1, -1, 23, 24, 25, 26, 27, - 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 52, 53, 54, 55, 56, 57, - -1, -1, -1, -1, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, - 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, - 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, - 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, - 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, - 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, - 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, - 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, - 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, - -1, 199, 200, 201, 202, 203, 204, 205, -1, -1, - 208, 209, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 227, - -1, -1, -1, 231, 6, 7, 8, 9, 10, -1, - 238, 239, 240, 241, -1, -1, -1, -1, -1, -1, - -1, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 52, 53, 54, 55, 56, 57, -1, -1, -1, -1, - 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, - 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, - 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, - 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, - 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, - 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, - 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, - 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, - 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, - 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, - 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, - 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, - 192, 193, 194, 195, 196, 197, -1, 199, 200, 201, - 202, 203, 204, 205, -1, -1, 208, 209, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 227, -1, -1, 230, 6, - 7, 8, 9, 10, -1, -1, 238, 239, 240, 241, - -1, -1, -1, -1, -1, -1, 23, 24, 25, 26, - 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, - 37, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 52, 53, 54, 55, 56, - 57, -1, -1, -1, -1, 62, 63, 64, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, - 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, - 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, - 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, - 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, - 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, - 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, - 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, - 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, - 197, -1, 199, 200, 201, 202, 203, 204, 205, -1, - -1, 208, 209, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 227, 6, 7, 8, 9, 10, -1, -1, -1, -1, - 237, 238, 239, 240, 241, -1, -1, -1, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 52, 53, 54, - 55, 56, 57, -1, -1, -1, -1, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, - 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, - 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, - 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, - 195, 196, 197, -1, 199, 200, 201, 202, 203, 204, - 205, -1, -1, 208, 209, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 227, 6, 7, 8, 9, 10, -1, -1, - -1, -1, -1, 238, 239, 240, 241, -1, -1, -1, - 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, - 33, 34, 35, 36, 37, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 52, - 53, 54, 55, 56, 57, -1, -1, -1, -1, 62, - 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, - 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, - 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, - 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, - 193, 194, 195, 196, 197, -1, 199, 200, 201, 202, - 203, 204, 205, -1, -1, 208, 209, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 227, 6, 7, 8, 9, 10, - -1, -1, -1, -1, -1, 238, 239, 240, 241, -1, - -1, -1, 23, 24, 25, 26, 27, 28, 29, 30, - 31, 32, 33, 34, 35, 36, 37, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 52, 53, 54, 55, 56, 57, -1, -1, -1, - -1, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, - 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, - 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, - 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, - 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, - 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, - 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, - 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, - 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, - 191, 192, 193, 194, 195, 196, 197, -1, -1, 200 -}; - -/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ -static const yytype_uint16 yystos[] = -{ - 0, 3, 4, 5, 6, 7, 8, 9, 10, 22, - 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, - 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, - 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, - 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, - 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, - 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, - 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, - 193, 194, 195, 196, 197, 200, 251, 252, 253, 254, - 255, 256, 291, 292, 295, 296, 297, 298, 302, 303, - 304, 305, 306, 307, 310, 311, 312, 313, 315, 317, - 318, 319, 356, 357, 358, 227, 227, 199, 231, 318, - 199, 237, 237, 359, 228, 234, 299, 300, 301, 311, - 315, 234, 237, 199, 199, 237, 312, 315, 229, 316, - 0, 357, 200, 314, 46, 199, 308, 309, 231, 321, - 315, 237, 316, 231, 338, 300, 299, 301, 199, 199, - 227, 236, 316, 231, 234, 237, 294, 199, 201, 202, - 203, 204, 205, 208, 209, 227, 230, 238, 239, 240, - 241, 261, 262, 263, 265, 266, 267, 268, 269, 270, - 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, - 281, 282, 283, 284, 285, 315, 229, 228, 234, 236, - 228, 234, 320, 311, 315, 322, 323, 237, 237, 11, - 12, 13, 15, 16, 17, 18, 19, 20, 21, 198, - 231, 232, 237, 272, 285, 287, 289, 291, 295, 315, - 328, 329, 330, 331, 339, 340, 341, 344, 347, 348, - 355, 316, 236, 316, 231, 287, 326, 236, 293, 199, - 234, 237, 272, 272, 289, 208, 209, 229, 233, 228, - 228, 234, 197, 287, 227, 272, 242, 243, 244, 239, - 241, 206, 207, 210, 211, 245, 246, 212, 213, 249, - 248, 247, 214, 216, 215, 250, 230, 230, 285, 200, - 285, 290, 309, 322, 315, 199, 324, 325, 232, 323, - 237, 237, 350, 227, 227, 237, 237, 289, 227, 289, - 235, 227, 232, 332, 217, 218, 219, 220, 221, 222, - 223, 224, 225, 226, 236, 288, 234, 237, 232, 329, - 326, 236, 326, 327, 326, 322, 199, 228, 264, 289, - 199, 287, 272, 272, 272, 274, 274, 275, 275, 276, - 276, 276, 276, 277, 277, 278, 279, 280, 281, 282, - 283, 286, 230, 232, 324, 316, 234, 237, 329, 351, - 289, 237, 289, 235, 349, 339, 287, 287, 326, 232, - 234, 232, 230, 289, 237, 325, 198, 328, 340, 352, - 228, 228, 289, 304, 311, 343, 333, 232, 326, 235, - 227, 343, 353, 354, 335, 336, 337, 342, 345, 199, - 228, 232, 287, 289, 237, 228, 14, 331, 330, 231, - 236, 330, 334, 338, 228, 289, 334, 335, 339, 346, - 326, 237, 232 -}; - -#define yyerrok (yyerrstatus = 0) -#define yyclearin (yychar = YYEMPTY) -#define YYEMPTY (-2) -#define YYEOF 0 - -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrorlab - - -/* Like YYERROR except do call yyerror. This remains here temporarily - to ease the transition to the new meaning of YYERROR, for GCC. - Once GCC version 2 has supplanted version 1, this can go. However, - YYFAIL appears to be in use. Nevertheless, it is formally deprecated - in Bison 2.4.2's NEWS entry, where a plan to phase it out is - discussed. */ - -#define YYFAIL goto yyerrlab -#if defined YYFAIL - /* This is here to suppress warnings from the GCC cpp's - -Wunused-macros. Normally we don't worry about that warning, but - some users do, and we want to make it easy for users to remove - YYFAIL uses, which will produce warnings from Bison 2.5. */ -#endif #define YYRECOVERING() (!!yyerrstatus) @@ -2596,27 +2512,15 @@ do \ else \ { \ yyerror (pParseContext, YY_("syntax error: cannot back up")); \ - YYERROR; \ - } \ -while (YYID (0)) + YYERROR; \ + } \ +while (0) /* Error token number */ -#define YYTERROR 1 -#define YYERRCODE 256 +#define YYTERROR 1 +#define YYERRCODE 256 -/* This macro is provided for backward compatibility. */ -#ifndef YY_LOCATION_PRINT -# define YY_LOCATION_PRINT(File, Loc) ((void) 0) -#endif - - -/* YYLEX -- calling `yylex' with the right arguments. */ -#ifdef YYLEX_PARAM -# define YYLEX yylex (&yylval, YYLEX_PARAM) -#else -# define YYLEX yylex (&yylval, parseContext) -#endif /* Enable debugging if requested. */ #if YYDEBUG @@ -2626,58 +2530,47 @@ while (YYID (0)) # define YYFPRINTF fprintf # endif -# define YYDPRINTF(Args) \ -do { \ - if (yydebug) \ - YYFPRINTF Args; \ -} while (YYID (0)) +# define YYDPRINTF(Args) \ +do { \ + if (yydebug) \ + YYFPRINTF Args; \ +} while (0) -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ -do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yy_symbol_print (stderr, \ - Type, Value, pParseContext); \ - YYFPRINTF (stderr, "\n"); \ - } \ -} while (YYID (0)) +/* This macro is provided for backward compatibility. */ +#ifndef YY_LOCATION_PRINT +# define YY_LOCATION_PRINT(File, Loc) ((void) 0) +#endif -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ +do { \ + if (yydebug) \ + { \ + YYFPRINTF (stderr, "%s ", Title); \ + yy_symbol_print (stderr, \ + Type, Value, pParseContext); \ + YYFPRINTF (stderr, "\n"); \ + } \ +} while (0) + + +/*----------------------------------------. +| Print this symbol's value on YYOUTPUT. | +`----------------------------------------*/ -/*ARGSUSED*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static void yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, glslang::TParseContext* pParseContext) -#else -static void -yy_symbol_value_print (yyoutput, yytype, yyvaluep, pParseContext) - FILE *yyoutput; - int yytype; - YYSTYPE const * const yyvaluep; - glslang::TParseContext* pParseContext; -#endif { FILE *yyo = yyoutput; YYUSE (yyo); + YYUSE (pParseContext); if (!yyvaluep) return; - YYUSE (pParseContext); # ifdef YYPRINT if (yytype < YYNTOKENS) YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); -# else - YYUSE (yyoutput); # endif - switch (yytype) - { - default: - break; - } + YYUSE (yytype); } @@ -2685,23 +2578,11 @@ yy_symbol_value_print (yyoutput, yytype, yyvaluep, pParseContext) | Print this symbol on YYOUTPUT. | `--------------------------------*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static void yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, glslang::TParseContext* pParseContext) -#else -static void -yy_symbol_print (yyoutput, yytype, yyvaluep, pParseContext) - FILE *yyoutput; - int yytype; - YYSTYPE const * const yyvaluep; - glslang::TParseContext* pParseContext; -#endif { - if (yytype < YYNTOKENS) - YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); - else - YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); + YYFPRINTF (yyoutput, "%s %s (", + yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]); yy_symbol_value_print (yyoutput, yytype, yyvaluep, pParseContext); YYFPRINTF (yyoutput, ")"); @@ -2712,16 +2593,8 @@ yy_symbol_print (yyoutput, yytype, yyvaluep, pParseContext) | TOP (included). | `------------------------------------------------------------------*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static void yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) -#else -static void -yy_stack_print (yybottom, yytop) - yytype_int16 *yybottom; - yytype_int16 *yytop; -#endif { YYFPRINTF (stderr, "Stack now"); for (; yybottom <= yytop; yybottom++) @@ -2732,50 +2605,42 @@ yy_stack_print (yybottom, yytop) YYFPRINTF (stderr, "\n"); } -# define YY_STACK_PRINT(Bottom, Top) \ -do { \ - if (yydebug) \ - yy_stack_print ((Bottom), (Top)); \ -} while (YYID (0)) +# define YY_STACK_PRINT(Bottom, Top) \ +do { \ + if (yydebug) \ + yy_stack_print ((Bottom), (Top)); \ +} while (0) /*------------------------------------------------. | Report that the YYRULE is going to be reduced. | `------------------------------------------------*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static void -yy_reduce_print (YYSTYPE *yyvsp, int yyrule, glslang::TParseContext* pParseContext) -#else -static void -yy_reduce_print (yyvsp, yyrule, pParseContext) - YYSTYPE *yyvsp; - int yyrule; - glslang::TParseContext* pParseContext; -#endif +yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule, glslang::TParseContext* pParseContext) { + unsigned long int yylno = yyrline[yyrule]; int yynrhs = yyr2[yyrule]; int yyi; - unsigned long int yylno = yyrline[yyrule]; YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", - yyrule - 1, yylno); + yyrule - 1, yylno); /* The symbols being reduced. */ for (yyi = 0; yyi < yynrhs; yyi++) { YYFPRINTF (stderr, " $%d = ", yyi + 1); - yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], - &(yyvsp[(yyi + 1) - (yynrhs)]) - , pParseContext); + yy_symbol_print (stderr, + yystos[yyssp[yyi + 1 - yynrhs]], + &(yyvsp[(yyi + 1) - (yynrhs)]) + , pParseContext); YYFPRINTF (stderr, "\n"); } } -# define YY_REDUCE_PRINT(Rule) \ -do { \ - if (yydebug) \ - yy_reduce_print (yyvsp, Rule, pParseContext); \ -} while (YYID (0)) +# define YY_REDUCE_PRINT(Rule) \ +do { \ + if (yydebug) \ + yy_reduce_print (yyssp, yyvsp, Rule, pParseContext); \ +} while (0) /* Nonzero means print parse trace. It is left uninitialized so that multiple parsers can coexist. */ @@ -2789,7 +2654,7 @@ int yydebug; /* YYINITDEPTH -- initial size of the parser's stacks. */ -#ifndef YYINITDEPTH +#ifndef YYINITDEPTH # define YYINITDEPTH 200 #endif @@ -2812,15 +2677,8 @@ int yydebug; # define yystrlen strlen # else /* Return the length of YYSTR. */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static YYSIZE_T yystrlen (const char *yystr) -#else -static YYSIZE_T -yystrlen (yystr) - const char *yystr; -#endif { YYSIZE_T yylen; for (yylen = 0; yystr[yylen]; yylen++) @@ -2836,16 +2694,8 @@ yystrlen (yystr) # else /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in YYDEST. */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static char * yystpcpy (char *yydest, const char *yysrc) -#else -static char * -yystpcpy (yydest, yysrc) - char *yydest; - const char *yysrc; -#endif { char *yyd = yydest; const char *yys = yysrc; @@ -2875,27 +2725,27 @@ yytnamerr (char *yyres, const char *yystr) char const *yyp = yystr; for (;;) - switch (*++yyp) - { - case '\'': - case ',': - goto do_not_strip_quotes; + switch (*++yyp) + { + case '\'': + case ',': + goto do_not_strip_quotes; - case '\\': - if (*++yyp != '\\') - goto do_not_strip_quotes; - /* Fall through. */ - default: - if (yyres) - yyres[yyn] = *yyp; - yyn++; - break; + case '\\': + if (*++yyp != '\\') + goto do_not_strip_quotes; + /* Fall through. */ + default: + if (yyres) + yyres[yyn] = *yyp; + yyn++; + break; - case '"': - if (yyres) - yyres[yyn] = '\0'; - return yyn; - } + case '"': + if (yyres) + yyres[yyn] = '\0'; + return yyn; + } do_not_strip_quotes: ; } @@ -2918,11 +2768,11 @@ static int yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, yytype_int16 *yyssp, int yytoken) { - YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]); + YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]); YYSIZE_T yysize = yysize0; enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; /* Internationalized format string. */ - const char *yyformat = YY_NULL; + const char *yyformat = YY_NULLPTR; /* Arguments of yyformat. */ char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; /* Number of reported tokens (one for the "unexpected", one per @@ -2930,10 +2780,6 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, int yycount = 0; /* There are many possibilities here to consider: - - Assume YYFAIL is not used. It's too flawed to consider. See - - for details. YYERROR is fine as it does not invoke this - function. - If this state is a consistent state with a default action, then the only way this function was invoked is if the default action is an error action. In that case, don't check for expected @@ -2983,7 +2829,7 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, } yyarg[yycount++] = yytname[yyx]; { - YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]); + YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]); if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) return 2; @@ -3050,33 +2896,18 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, | Release the memory associated to this symbol. | `-----------------------------------------------*/ -/*ARGSUSED*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static void yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, glslang::TParseContext* pParseContext) -#else -static void -yydestruct (yymsg, yytype, yyvaluep, pParseContext) - const char *yymsg; - int yytype; - YYSTYPE *yyvaluep; - glslang::TParseContext* pParseContext; -#endif { YYUSE (yyvaluep); YYUSE (pParseContext); - if (!yymsg) yymsg = "Deleting"; YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); - switch (yytype) - { - - default: - break; - } + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN + YYUSE (yytype); + YY_IGNORE_MAYBE_UNINITIALIZED_END } @@ -3086,56 +2917,18 @@ yydestruct (yymsg, yytype, yyvaluep, pParseContext) | yyparse. | `----------*/ -#ifdef YYPARSE_PARAM -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -int -yyparse (void *YYPARSE_PARAM) -#else -int -yyparse (YYPARSE_PARAM) - void *YYPARSE_PARAM; -#endif -#else /* ! YYPARSE_PARAM */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) int yyparse (glslang::TParseContext* pParseContext) -#else -int -yyparse (pParseContext) - glslang::TParseContext* pParseContext; -#endif -#endif { /* The lookahead symbol. */ int yychar; -#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ -/* Suppress an incorrect diagnostic about yylval being uninitialized. */ -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ - _Pragma ("GCC diagnostic push") \ - _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\ - _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") -# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ - _Pragma ("GCC diagnostic pop") -#else +/* The semantic value of the lookahead symbol. */ /* Default value used for initialization, for pacifying older GCCs or non-GCC compilers. */ -static YYSTYPE yyval_default; -# define YY_INITIAL_VALUE(Value) = Value -#endif -#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN -# define YY_IGNORE_MAYBE_UNINITIALIZED_END -#endif -#ifndef YY_INITIAL_VALUE -# define YY_INITIAL_VALUE(Value) /* Nothing. */ -#endif - -/* The semantic value of the lookahead symbol. */ -YYSTYPE yylval YY_INITIAL_VALUE(yyval_default); +YY_INITIAL_VALUE (static YYSTYPE yyval_default;) +YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); /* Number of syntax errors so far. */ int yynerrs; @@ -3145,8 +2938,8 @@ YYSTYPE yylval YY_INITIAL_VALUE(yyval_default); int yyerrstatus; /* The stacks and their tools: - `yyss': related to states. - `yyvs': related to semantic values. + 'yyss': related to states. + 'yyvs': related to semantic values. Refer to the stacks through separate pointers, to allow yyoverflow to reallocate them elsewhere. */ @@ -3214,23 +3007,23 @@ YYSTYPE yylval YY_INITIAL_VALUE(yyval_default); #ifdef yyoverflow { - /* Give user a chance to reallocate the stack. Use copies of - these so that the &'s don't force the real ones into - memory. */ - YYSTYPE *yyvs1 = yyvs; - yytype_int16 *yyss1 = yyss; + /* Give user a chance to reallocate the stack. Use copies of + these so that the &'s don't force the real ones into + memory. */ + YYSTYPE *yyvs1 = yyvs; + yytype_int16 *yyss1 = yyss; - /* Each stack pointer address is followed by the size of the - data in use in that stack, in bytes. This used to be a - conditional around just the two extra args, but that might - be undefined if yyoverflow is a macro. */ - yyoverflow (YY_("memory exhausted"), - &yyss1, yysize * sizeof (*yyssp), - &yyvs1, yysize * sizeof (*yyvsp), - &yystacksize); + /* Each stack pointer address is followed by the size of the + data in use in that stack, in bytes. This used to be a + conditional around just the two extra args, but that might + be undefined if yyoverflow is a macro. */ + yyoverflow (YY_("memory exhausted"), + &yyss1, yysize * sizeof (*yyssp), + &yyvs1, yysize * sizeof (*yyvsp), + &yystacksize); - yyss = yyss1; - yyvs = yyvs1; + yyss = yyss1; + yyvs = yyvs1; } #else /* no yyoverflow */ # ifndef YYSTACK_RELOCATE @@ -3238,22 +3031,22 @@ YYSTYPE yylval YY_INITIAL_VALUE(yyval_default); # else /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) - goto yyexhaustedlab; + goto yyexhaustedlab; yystacksize *= 2; if (YYMAXDEPTH < yystacksize) - yystacksize = YYMAXDEPTH; + yystacksize = YYMAXDEPTH; { - yytype_int16 *yyss1 = yyss; - union yyalloc *yyptr = - (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); - if (! yyptr) - goto yyexhaustedlab; - YYSTACK_RELOCATE (yyss_alloc, yyss); - YYSTACK_RELOCATE (yyvs_alloc, yyvs); + yytype_int16 *yyss1 = yyss; + union yyalloc *yyptr = + (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); + if (! yyptr) + goto yyexhaustedlab; + YYSTACK_RELOCATE (yyss_alloc, yyss); + YYSTACK_RELOCATE (yyvs_alloc, yyvs); # undef YYSTACK_RELOCATE - if (yyss1 != yyssa) - YYSTACK_FREE (yyss1); + if (yyss1 != yyssa) + YYSTACK_FREE (yyss1); } # endif #endif /* no yyoverflow */ @@ -3262,10 +3055,10 @@ YYSTYPE yylval YY_INITIAL_VALUE(yyval_default); yyvsp = yyvs + yysize - 1; YYDPRINTF ((stderr, "Stack size increased to %lu\n", - (unsigned long int) yystacksize)); + (unsigned long int) yystacksize)); if (yyss + yystacksize - 1 <= yyssp) - YYABORT; + YYABORT; } YYDPRINTF ((stderr, "Entering state %d\n", yystate)); @@ -3294,7 +3087,7 @@ yybackup: if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); - yychar = YYLEX; + yychar = yylex (&yylval, parseContext); } if (yychar <= YYEOF) @@ -3359,7 +3152,7 @@ yyreduce: yylen = yyr2[yyn]; /* If YYLEN is nonzero, implement the default value of the action: - `$$ = $1'. + '$$ = $1'. Otherwise, the following line sets YYVAL to garbage. This behavior is undocumented and Bison @@ -3373,230 +3166,247 @@ yyreduce: switch (yyn) { case 2: -/* Line 1792 of yacc.c */ -#line 244 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 246 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.intermTypedNode) = parseContext.handleVariable((yyvsp[(1) - (1)].lex).loc, (yyvsp[(1) - (1)].lex).symbol, (yyvsp[(1) - (1)].lex).string); + (yyval.interm.intermTypedNode) = parseContext.handleVariable((yyvsp[0].lex).loc, (yyvsp[0].lex).symbol, (yyvsp[0].lex).string); } +#line 3174 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 3: -/* Line 1792 of yacc.c */ -#line 250 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 252 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); + (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } +#line 3182 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 4: -/* Line 1792 of yacc.c */ -#line 253 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 255 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[(1) - (1)].lex).i, (yyvsp[(1) - (1)].lex).loc, true); + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).i, (yyvsp[0].lex).loc, true); } +#line 3190 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 5: -/* Line 1792 of yacc.c */ -#line 256 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 258 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.fullIntegerCheck((yyvsp[(1) - (1)].lex).loc, "unsigned literal"); - (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[(1) - (1)].lex).u, (yyvsp[(1) - (1)].lex).loc, true); + parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "unsigned literal"); + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).u, (yyvsp[0].lex).loc, true); } +#line 3199 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 6: -/* Line 1792 of yacc.c */ -#line 260 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 262 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[(1) - (1)].lex).d, EbtFloat, (yyvsp[(1) - (1)].lex).loc, true); + parseContext.int64Check((yyvsp[0].lex).loc, "64-bit integer literal"); + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).i64, (yyvsp[0].lex).loc, true); } +#line 3208 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 7: -/* Line 1792 of yacc.c */ -#line 263 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 266 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.doubleCheck((yyvsp[(1) - (1)].lex).loc, "double literal"); - (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[(1) - (1)].lex).d, EbtDouble, (yyvsp[(1) - (1)].lex).loc, true); + parseContext.int64Check((yyvsp[0].lex).loc, "64-bit unsigned integer literal"); + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).u64, (yyvsp[0].lex).loc, true); } +#line 3217 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 8: -/* Line 1792 of yacc.c */ -#line 267 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 270 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[(1) - (1)].lex).b, (yyvsp[(1) - (1)].lex).loc, true); + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).d, EbtFloat, (yyvsp[0].lex).loc, true); } +#line 3225 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 9: -/* Line 1792 of yacc.c */ -#line 270 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 273 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.intermTypedNode) = (yyvsp[(2) - (3)].interm.intermTypedNode); - if ((yyval.interm.intermTypedNode)->getAsConstantUnion()) - (yyval.interm.intermTypedNode)->getAsConstantUnion()->setExpression(); + parseContext.doubleCheck((yyvsp[0].lex).loc, "double literal"); + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).d, EbtDouble, (yyvsp[0].lex).loc, true); } +#line 3234 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 10: -/* Line 1792 of yacc.c */ -#line 278 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 277 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).b, (yyvsp[0].lex).loc, true); } +#line 3242 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 11: -/* Line 1792 of yacc.c */ -#line 281 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 280 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.intermTypedNode) = parseContext.handleBracketDereference((yyvsp[(2) - (4)].lex).loc, (yyvsp[(1) - (4)].interm.intermTypedNode), (yyvsp[(3) - (4)].interm.intermTypedNode)); + (yyval.interm.intermTypedNode) = (yyvsp[-1].interm.intermTypedNode); + if ((yyval.interm.intermTypedNode)->getAsConstantUnion()) + (yyval.interm.intermTypedNode)->getAsConstantUnion()->setExpression(); } +#line 3252 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 12: -/* Line 1792 of yacc.c */ -#line 284 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 288 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); + (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } +#line 3260 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 13: -/* Line 1792 of yacc.c */ -#line 287 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 291 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.intermTypedNode) = parseContext.handleDotDereference((yyvsp[(3) - (3)].lex).loc, (yyvsp[(1) - (3)].interm.intermTypedNode), *(yyvsp[(3) - (3)].lex).string); + (yyval.interm.intermTypedNode) = parseContext.handleBracketDereference((yyvsp[-2].lex).loc, (yyvsp[-3].interm.intermTypedNode), (yyvsp[-1].interm.intermTypedNode)); } +#line 3268 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 14: -/* Line 1792 of yacc.c */ -#line 290 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 294 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.variableCheck((yyvsp[(1) - (2)].interm.intermTypedNode)); - parseContext.lValueErrorCheck((yyvsp[(2) - (2)].lex).loc, "++", (yyvsp[(1) - (2)].interm.intermTypedNode)); - (yyval.interm.intermTypedNode) = parseContext.handleUnaryMath((yyvsp[(2) - (2)].lex).loc, "++", EOpPostIncrement, (yyvsp[(1) - (2)].interm.intermTypedNode)); + (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } +#line 3276 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 15: -/* Line 1792 of yacc.c */ -#line 295 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 297 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.variableCheck((yyvsp[(1) - (2)].interm.intermTypedNode)); - parseContext.lValueErrorCheck((yyvsp[(2) - (2)].lex).loc, "--", (yyvsp[(1) - (2)].interm.intermTypedNode)); - (yyval.interm.intermTypedNode) = parseContext.handleUnaryMath((yyvsp[(2) - (2)].lex).loc, "--", EOpPostDecrement, (yyvsp[(1) - (2)].interm.intermTypedNode)); + (yyval.interm.intermTypedNode) = parseContext.handleDotDereference((yyvsp[0].lex).loc, (yyvsp[-2].interm.intermTypedNode), *(yyvsp[0].lex).string); } +#line 3284 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 16: -/* Line 1792 of yacc.c */ -#line 303 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 300 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.integerCheck((yyvsp[(1) - (1)].interm.intermTypedNode), "[]"); - (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); + parseContext.variableCheck((yyvsp[-1].interm.intermTypedNode)); + parseContext.lValueErrorCheck((yyvsp[0].lex).loc, "++", (yyvsp[-1].interm.intermTypedNode)); + (yyval.interm.intermTypedNode) = parseContext.handleUnaryMath((yyvsp[0].lex).loc, "++", EOpPostIncrement, (yyvsp[-1].interm.intermTypedNode)); } +#line 3294 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 17: -/* Line 1792 of yacc.c */ -#line 310 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 305 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.intermTypedNode) = parseContext.handleFunctionCall((yyvsp[(1) - (1)].interm).loc, (yyvsp[(1) - (1)].interm).function, (yyvsp[(1) - (1)].interm).intermNode); - delete (yyvsp[(1) - (1)].interm).function; + parseContext.variableCheck((yyvsp[-1].interm.intermTypedNode)); + parseContext.lValueErrorCheck((yyvsp[0].lex).loc, "--", (yyvsp[-1].interm.intermTypedNode)); + (yyval.interm.intermTypedNode) = parseContext.handleUnaryMath((yyvsp[0].lex).loc, "--", EOpPostDecrement, (yyvsp[-1].interm.intermTypedNode)); } +#line 3304 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 18: -/* Line 1792 of yacc.c */ -#line 317 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 313 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm) = (yyvsp[(1) - (1)].interm); + parseContext.integerCheck((yyvsp[0].interm.intermTypedNode), "[]"); + (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } +#line 3313 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 19: -/* Line 1792 of yacc.c */ -#line 323 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 320 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm) = (yyvsp[(1) - (2)].interm); - (yyval.interm).loc = (yyvsp[(2) - (2)].lex).loc; + (yyval.interm.intermTypedNode) = parseContext.handleFunctionCall((yyvsp[0].interm).loc, (yyvsp[0].interm).function, (yyvsp[0].interm).intermNode); + delete (yyvsp[0].interm).function; } +#line 3322 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 20: -/* Line 1792 of yacc.c */ -#line 327 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 327 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm) = (yyvsp[(1) - (2)].interm); - (yyval.interm).loc = (yyvsp[(2) - (2)].lex).loc; + (yyval.interm) = (yyvsp[0].interm); } +#line 3330 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 21: -/* Line 1792 of yacc.c */ -#line 334 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 333 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm) = (yyvsp[(1) - (2)].interm); + (yyval.interm) = (yyvsp[-1].interm); + (yyval.interm).loc = (yyvsp[0].lex).loc; } +#line 3339 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 22: -/* Line 1792 of yacc.c */ -#line 337 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 337 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm) = (yyvsp[(1) - (1)].interm); + (yyval.interm) = (yyvsp[-1].interm); + (yyval.interm).loc = (yyvsp[0].lex).loc; } +#line 3348 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 23: -/* Line 1792 of yacc.c */ -#line 343 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 344 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - TParameter param = { 0, new TType }; - param.type->shallowCopy((yyvsp[(2) - (2)].interm.intermTypedNode)->getType()); - (yyvsp[(1) - (2)].interm).function->addParameter(param); - (yyval.interm).function = (yyvsp[(1) - (2)].interm).function; - (yyval.interm).intermNode = (yyvsp[(2) - (2)].interm.intermTypedNode); + (yyval.interm) = (yyvsp[-1].interm); } +#line 3356 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 24: -/* Line 1792 of yacc.c */ -#line 350 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 347 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - TParameter param = { 0, new TType }; - param.type->shallowCopy((yyvsp[(3) - (3)].interm.intermTypedNode)->getType()); - (yyvsp[(1) - (3)].interm).function->addParameter(param); - (yyval.interm).function = (yyvsp[(1) - (3)].interm).function; - (yyval.interm).intermNode = parseContext.intermediate.growAggregate((yyvsp[(1) - (3)].interm).intermNode, (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).loc); + (yyval.interm) = (yyvsp[0].interm); } +#line 3364 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 25: -/* Line 1792 of yacc.c */ -#line 360 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 353 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm) = (yyvsp[(1) - (2)].interm); + TParameter param = { 0, new TType }; + param.type->shallowCopy((yyvsp[0].interm.intermTypedNode)->getType()); + (yyvsp[-1].interm).function->addParameter(param); + (yyval.interm).function = (yyvsp[-1].interm).function; + (yyval.interm).intermNode = (yyvsp[0].interm.intermTypedNode); } +#line 3376 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 26: -/* Line 1792 of yacc.c */ -#line 368 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 360 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - // Constructor - (yyval.interm).intermNode = 0; - (yyval.interm).function = parseContext.handleConstructorCall((yyvsp[(1) - (1)].interm.type).loc, (yyvsp[(1) - (1)].interm.type)); + TParameter param = { 0, new TType }; + param.type->shallowCopy((yyvsp[0].interm.intermTypedNode)->getType()); + (yyvsp[-2].interm).function->addParameter(param); + (yyval.interm).function = (yyvsp[-2].interm).function; + (yyval.interm).intermNode = parseContext.intermediate.growAggregate((yyvsp[-2].interm).intermNode, (yyvsp[0].interm.intermTypedNode), (yyvsp[-1].lex).loc); } +#line 3388 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 27: -/* Line 1792 of yacc.c */ -#line 373 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 370 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm) = (yyvsp[-1].interm); + } +#line 3396 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 28: +#line 378 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + // Constructor + (yyval.interm).intermNode = 0; + (yyval.interm).function = parseContext.handleConstructorCall((yyvsp[0].interm.type).loc, (yyvsp[0].interm.type)); + } +#line 3406 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 29: +#line 383 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { // // Should be a method or subroutine call, but we haven't recognized the arguments yet. @@ -3604,18 +3414,18 @@ yyreduce: (yyval.interm).function = 0; (yyval.interm).intermNode = 0; - TIntermMethod* method = (yyvsp[(1) - (1)].interm.intermTypedNode)->getAsMethodNode(); + TIntermMethod* method = (yyvsp[0].interm.intermTypedNode)->getAsMethodNode(); if (method) { (yyval.interm).function = new TFunction(&method->getMethodName(), TType(EbtInt), EOpArrayLength); (yyval.interm).intermNode = method->getObject(); } else { - TIntermSymbol* symbol = (yyvsp[(1) - (1)].interm.intermTypedNode)->getAsSymbolNode(); + TIntermSymbol* symbol = (yyvsp[0].interm.intermTypedNode)->getAsSymbolNode(); if (symbol) { parseContext.reservedErrorCheck(symbol->getLoc(), symbol->getName()); TFunction *function = new TFunction(&symbol->getName(), TType(EbtVoid)); (yyval.interm).function = function; } else - parseContext.error((yyvsp[(1) - (1)].interm.intermTypedNode)->getLoc(), "function call, method, or subroutine call expected", "", ""); + parseContext.error((yyvsp[0].interm.intermTypedNode)->getLoc(), "function call, method, or subroutine call expected", "", ""); } if ((yyval.interm).function == 0) { @@ -3624,3607 +3434,3696 @@ yyreduce: (yyval.interm).function = new TFunction(&empty, TType(EbtVoid), EOpNull); } } - break; - - case 28: -/* Line 1792 of yacc.c */ -#line 403 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" - { - parseContext.variableCheck((yyvsp[(1) - (1)].interm.intermTypedNode)); - (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); - if (TIntermMethod* method = (yyvsp[(1) - (1)].interm.intermTypedNode)->getAsMethodNode()) - parseContext.error((yyvsp[(1) - (1)].interm.intermTypedNode)->getLoc(), "incomplete method syntax", method->getMethodName().c_str(), ""); - } - break; - - case 29: -/* Line 1792 of yacc.c */ -#line 409 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" - { - parseContext.lValueErrorCheck((yyvsp[(1) - (2)].lex).loc, "++", (yyvsp[(2) - (2)].interm.intermTypedNode)); - (yyval.interm.intermTypedNode) = parseContext.handleUnaryMath((yyvsp[(1) - (2)].lex).loc, "++", EOpPreIncrement, (yyvsp[(2) - (2)].interm.intermTypedNode)); - } +#line 3438 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 30: -/* Line 1792 of yacc.c */ -#line 413 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 413 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.lValueErrorCheck((yyvsp[(1) - (2)].lex).loc, "--", (yyvsp[(2) - (2)].interm.intermTypedNode)); - (yyval.interm.intermTypedNode) = parseContext.handleUnaryMath((yyvsp[(1) - (2)].lex).loc, "--", EOpPreDecrement, (yyvsp[(2) - (2)].interm.intermTypedNode)); + parseContext.variableCheck((yyvsp[0].interm.intermTypedNode)); + (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); + if (TIntermMethod* method = (yyvsp[0].interm.intermTypedNode)->getAsMethodNode()) + parseContext.error((yyvsp[0].interm.intermTypedNode)->getLoc(), "incomplete method syntax", method->getMethodName().c_str(), ""); } +#line 3449 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 31: -/* Line 1792 of yacc.c */ -#line 417 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 419 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - if ((yyvsp[(1) - (2)].interm).op != EOpNull) { + parseContext.lValueErrorCheck((yyvsp[-1].lex).loc, "++", (yyvsp[0].interm.intermTypedNode)); + (yyval.interm.intermTypedNode) = parseContext.handleUnaryMath((yyvsp[-1].lex).loc, "++", EOpPreIncrement, (yyvsp[0].interm.intermTypedNode)); + } +#line 3458 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 32: +#line 423 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.lValueErrorCheck((yyvsp[-1].lex).loc, "--", (yyvsp[0].interm.intermTypedNode)); + (yyval.interm.intermTypedNode) = parseContext.handleUnaryMath((yyvsp[-1].lex).loc, "--", EOpPreDecrement, (yyvsp[0].interm.intermTypedNode)); + } +#line 3467 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 33: +#line 427 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + if ((yyvsp[-1].interm).op != EOpNull) { char errorOp[2] = {0, 0}; - switch((yyvsp[(1) - (2)].interm).op) { + switch((yyvsp[-1].interm).op) { case EOpNegative: errorOp[0] = '-'; break; case EOpLogicalNot: errorOp[0] = '!'; break; case EOpBitwiseNot: errorOp[0] = '~'; break; default: break; // some compilers want this } - (yyval.interm.intermTypedNode) = parseContext.handleUnaryMath((yyvsp[(1) - (2)].interm).loc, errorOp, (yyvsp[(1) - (2)].interm).op, (yyvsp[(2) - (2)].interm.intermTypedNode)); + (yyval.interm.intermTypedNode) = parseContext.handleUnaryMath((yyvsp[-1].interm).loc, errorOp, (yyvsp[-1].interm).op, (yyvsp[0].interm.intermTypedNode)); } else { - (yyval.interm.intermTypedNode) = (yyvsp[(2) - (2)].interm.intermTypedNode); + (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); if ((yyval.interm.intermTypedNode)->getAsConstantUnion()) (yyval.interm.intermTypedNode)->getAsConstantUnion()->setExpression(); } } - break; - - case 32: -/* Line 1792 of yacc.c */ -#line 437 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" - { (yyval.interm).loc = (yyvsp[(1) - (1)].lex).loc; (yyval.interm).op = EOpNull; } - break; - - case 33: -/* Line 1792 of yacc.c */ -#line 438 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" - { (yyval.interm).loc = (yyvsp[(1) - (1)].lex).loc; (yyval.interm).op = EOpNegative; } +#line 3488 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 34: -/* Line 1792 of yacc.c */ -#line 439 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" - { (yyval.interm).loc = (yyvsp[(1) - (1)].lex).loc; (yyval.interm).op = EOpLogicalNot; } +#line 447 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpNull; } +#line 3494 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 35: -/* Line 1792 of yacc.c */ -#line 440 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" - { (yyval.interm).loc = (yyvsp[(1) - (1)].lex).loc; (yyval.interm).op = EOpBitwiseNot; - parseContext.fullIntegerCheck((yyvsp[(1) - (1)].lex).loc, "bitwise not"); } +#line 448 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpNegative; } +#line 3500 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 36: -/* Line 1792 of yacc.c */ -#line 446 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" - { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); } +#line 449 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpLogicalNot; } +#line 3506 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 37: -/* Line 1792 of yacc.c */ -#line 447 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" - { - (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[(2) - (3)].lex).loc, "*", EOpMul, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode)); - if ((yyval.interm.intermTypedNode) == 0) - (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode); - } +#line 450 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpBitwiseNot; + parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "bitwise not"); } +#line 3513 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 38: -/* Line 1792 of yacc.c */ -#line 452 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" - { - (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[(2) - (3)].lex).loc, "/", EOpDiv, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode)); - if ((yyval.interm.intermTypedNode) == 0) - (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode); - } +#line 456 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } +#line 3519 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 39: -/* Line 1792 of yacc.c */ -#line 457 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 457 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.fullIntegerCheck((yyvsp[(2) - (3)].lex).loc, "%"); - (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[(2) - (3)].lex).loc, "%", EOpMod, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode)); + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "*", EOpMul, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) - (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode); + (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } +#line 3529 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 40: -/* Line 1792 of yacc.c */ -#line 466 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" - { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); } +#line 462 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "/", EOpDiv, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); + if ((yyval.interm.intermTypedNode) == 0) + (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); + } +#line 3539 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 41: -/* Line 1792 of yacc.c */ -#line 467 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 467 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[(2) - (3)].lex).loc, "+", EOpAdd, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode)); + parseContext.fullIntegerCheck((yyvsp[-1].lex).loc, "%"); + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "%", EOpMod, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) - (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode); + (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } +#line 3550 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 42: -/* Line 1792 of yacc.c */ -#line 472 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" - { - (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[(2) - (3)].lex).loc, "-", EOpSub, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode)); - if ((yyval.interm.intermTypedNode) == 0) - (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode); - } +#line 476 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } +#line 3556 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 43: -/* Line 1792 of yacc.c */ -#line 480 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" - { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); } +#line 477 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "+", EOpAdd, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); + if ((yyval.interm.intermTypedNode) == 0) + (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); + } +#line 3566 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 44: -/* Line 1792 of yacc.c */ -#line 481 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 482 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.fullIntegerCheck((yyvsp[(2) - (3)].lex).loc, "bit shift left"); - (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[(2) - (3)].lex).loc, "<<", EOpLeftShift, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode)); + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "-", EOpSub, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) - (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode); + (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } +#line 3576 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 45: -/* Line 1792 of yacc.c */ -#line 487 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" - { - parseContext.fullIntegerCheck((yyvsp[(2) - (3)].lex).loc, "bit shift right"); - (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[(2) - (3)].lex).loc, ">>", EOpRightShift, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode)); - if ((yyval.interm.intermTypedNode) == 0) - (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode); - } +#line 490 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } +#line 3582 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 46: -/* Line 1792 of yacc.c */ -#line 496 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" - { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); } +#line 491 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.fullIntegerCheck((yyvsp[-1].lex).loc, "bit shift left"); + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "<<", EOpLeftShift, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); + if ((yyval.interm.intermTypedNode) == 0) + (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); + } +#line 3593 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 47: -/* Line 1792 of yacc.c */ -#line 497 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 497 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[(2) - (3)].lex).loc, "<", EOpLessThan, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode)); + parseContext.fullIntegerCheck((yyvsp[-1].lex).loc, "bit shift right"); + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, ">>", EOpRightShift, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) - (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[(2) - (3)].lex).loc); + (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } +#line 3604 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 48: -/* Line 1792 of yacc.c */ -#line 502 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" - { - (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[(2) - (3)].lex).loc, ">", EOpGreaterThan, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode)); - if ((yyval.interm.intermTypedNode) == 0) - (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[(2) - (3)].lex).loc); - } +#line 506 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } +#line 3610 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 49: -/* Line 1792 of yacc.c */ -#line 507 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 507 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[(2) - (3)].lex).loc, "<=", EOpLessThanEqual, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode)); + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "<", EOpLessThan, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) - (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[(2) - (3)].lex).loc); + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); } +#line 3620 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 50: -/* Line 1792 of yacc.c */ -#line 512 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 512 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[(2) - (3)].lex).loc, ">=", EOpGreaterThanEqual, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode)); + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, ">", EOpGreaterThan, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) - (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[(2) - (3)].lex).loc); + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); } +#line 3630 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 51: -/* Line 1792 of yacc.c */ -#line 520 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" - { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); } +#line 517 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "<=", EOpLessThanEqual, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); + if ((yyval.interm.intermTypedNode) == 0) + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); + } +#line 3640 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 52: -/* Line 1792 of yacc.c */ -#line 521 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 522 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.arrayObjectCheck((yyvsp[(2) - (3)].lex).loc, (yyvsp[(1) - (3)].interm.intermTypedNode)->getType(), "array comparison"); - parseContext.opaqueCheck((yyvsp[(2) - (3)].lex).loc, (yyvsp[(1) - (3)].interm.intermTypedNode)->getType(), "=="); - parseContext.specializationCheck((yyvsp[(2) - (3)].lex).loc, (yyvsp[(1) - (3)].interm.intermTypedNode)->getType(), "=="); - (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[(2) - (3)].lex).loc, "==", EOpEqual, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode)); + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, ">=", EOpGreaterThanEqual, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) - (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[(2) - (3)].lex).loc); + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); } +#line 3650 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 53: -/* Line 1792 of yacc.c */ -#line 529 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" - { - parseContext.arrayObjectCheck((yyvsp[(2) - (3)].lex).loc, (yyvsp[(1) - (3)].interm.intermTypedNode)->getType(), "array comparison"); - parseContext.opaqueCheck((yyvsp[(2) - (3)].lex).loc, (yyvsp[(1) - (3)].interm.intermTypedNode)->getType(), "!="); - parseContext.specializationCheck((yyvsp[(2) - (3)].lex).loc, (yyvsp[(1) - (3)].interm.intermTypedNode)->getType(), "!="); - (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[(2) - (3)].lex).loc, "!=", EOpNotEqual, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode)); - if ((yyval.interm.intermTypedNode) == 0) - (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[(2) - (3)].lex).loc); - } +#line 530 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } +#line 3656 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 54: -/* Line 1792 of yacc.c */ -#line 540 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" - { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); } +#line 531 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.arrayObjectCheck((yyvsp[-1].lex).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "array comparison"); + parseContext.opaqueCheck((yyvsp[-1].lex).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "=="); + parseContext.specializationCheck((yyvsp[-1].lex).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "=="); + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "==", EOpEqual, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); + if ((yyval.interm.intermTypedNode) == 0) + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); + } +#line 3669 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 55: -/* Line 1792 of yacc.c */ -#line 541 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 539 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.fullIntegerCheck((yyvsp[(2) - (3)].lex).loc, "bitwise and"); - (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[(2) - (3)].lex).loc, "&", EOpAnd, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode)); + parseContext.arrayObjectCheck((yyvsp[-1].lex).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "array comparison"); + parseContext.opaqueCheck((yyvsp[-1].lex).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "!="); + parseContext.specializationCheck((yyvsp[-1].lex).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "!="); + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "!=", EOpNotEqual, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) - (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode); + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); } +#line 3682 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 56: -/* Line 1792 of yacc.c */ -#line 550 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" - { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); } +#line 550 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } +#line 3688 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 57: -/* Line 1792 of yacc.c */ -#line 551 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 551 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.fullIntegerCheck((yyvsp[(2) - (3)].lex).loc, "bitwise exclusive or"); - (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[(2) - (3)].lex).loc, "^", EOpExclusiveOr, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode)); + parseContext.fullIntegerCheck((yyvsp[-1].lex).loc, "bitwise and"); + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "&", EOpAnd, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) - (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode); + (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } +#line 3699 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 58: -/* Line 1792 of yacc.c */ -#line 560 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" - { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); } +#line 560 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } +#line 3705 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 59: -/* Line 1792 of yacc.c */ -#line 561 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 561 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.fullIntegerCheck((yyvsp[(2) - (3)].lex).loc, "bitwise inclusive or"); - (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[(2) - (3)].lex).loc, "|", EOpInclusiveOr, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode)); + parseContext.fullIntegerCheck((yyvsp[-1].lex).loc, "bitwise exclusive or"); + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "^", EOpExclusiveOr, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) - (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode); + (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } +#line 3716 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 60: -/* Line 1792 of yacc.c */ -#line 570 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" - { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); } +#line 570 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } +#line 3722 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 61: -/* Line 1792 of yacc.c */ -#line 571 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 571 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[(2) - (3)].lex).loc, "&&", EOpLogicalAnd, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode)); + parseContext.fullIntegerCheck((yyvsp[-1].lex).loc, "bitwise inclusive or"); + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "|", EOpInclusiveOr, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) - (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[(2) - (3)].lex).loc); + (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); } +#line 3733 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 62: -/* Line 1792 of yacc.c */ -#line 579 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" - { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); } +#line 580 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } +#line 3739 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 63: -/* Line 1792 of yacc.c */ -#line 580 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 581 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[(2) - (3)].lex).loc, "^^", EOpLogicalXor, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode)); + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "&&", EOpLogicalAnd, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) - (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[(2) - (3)].lex).loc); + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); } +#line 3749 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 64: -/* Line 1792 of yacc.c */ -#line 588 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" - { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); } +#line 589 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } +#line 3755 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 65: -/* Line 1792 of yacc.c */ -#line 589 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 590 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[(2) - (3)].lex).loc, "||", EOpLogicalOr, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode)); + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "^^", EOpLogicalXor, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); if ((yyval.interm.intermTypedNode) == 0) - (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[(2) - (3)].lex).loc); + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); } +#line 3765 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 66: -/* Line 1792 of yacc.c */ -#line 597 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" - { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); } +#line 598 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } +#line 3771 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 67: -/* Line 1792 of yacc.c */ -#line 598 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 599 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - ++parseContext.controlFlowNestingLevel; + (yyval.interm.intermTypedNode) = parseContext.handleBinaryMath((yyvsp[-1].lex).loc, "||", EOpLogicalOr, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); + if ((yyval.interm.intermTypedNode) == 0) + (yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc); } +#line 3781 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 68: -/* Line 1792 of yacc.c */ -#line 601 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" - { - --parseContext.controlFlowNestingLevel; - parseContext.boolCheck((yyvsp[(2) - (6)].lex).loc, (yyvsp[(1) - (6)].interm.intermTypedNode)); - parseContext.rValueErrorCheck((yyvsp[(2) - (6)].lex).loc, "?", (yyvsp[(1) - (6)].interm.intermTypedNode)); - parseContext.rValueErrorCheck((yyvsp[(5) - (6)].lex).loc, ":", (yyvsp[(4) - (6)].interm.intermTypedNode)); - parseContext.rValueErrorCheck((yyvsp[(5) - (6)].lex).loc, ":", (yyvsp[(6) - (6)].interm.intermTypedNode)); - (yyval.interm.intermTypedNode) = parseContext.intermediate.addSelection((yyvsp[(1) - (6)].interm.intermTypedNode), (yyvsp[(4) - (6)].interm.intermTypedNode), (yyvsp[(6) - (6)].interm.intermTypedNode), (yyvsp[(2) - (6)].lex).loc); - if ((yyval.interm.intermTypedNode) == 0) { - parseContext.binaryOpError((yyvsp[(2) - (6)].lex).loc, ":", (yyvsp[(4) - (6)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(6) - (6)].interm.intermTypedNode)->getCompleteString()); - (yyval.interm.intermTypedNode) = (yyvsp[(6) - (6)].interm.intermTypedNode); - } - } +#line 607 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } +#line 3787 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 69: -/* Line 1792 of yacc.c */ -#line 616 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" - { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); } +#line 608 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + ++parseContext.controlFlowNestingLevel; + } +#line 3795 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 70: -/* Line 1792 of yacc.c */ -#line 617 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 611 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.arrayObjectCheck((yyvsp[(2) - (3)].interm).loc, (yyvsp[(1) - (3)].interm.intermTypedNode)->getType(), "array assignment"); - parseContext.opaqueCheck((yyvsp[(2) - (3)].interm).loc, (yyvsp[(1) - (3)].interm.intermTypedNode)->getType(), "="); - parseContext.specializationCheck((yyvsp[(2) - (3)].interm).loc, (yyvsp[(1) - (3)].interm.intermTypedNode)->getType(), "="); - parseContext.lValueErrorCheck((yyvsp[(2) - (3)].interm).loc, "assign", (yyvsp[(1) - (3)].interm.intermTypedNode)); - parseContext.rValueErrorCheck((yyvsp[(2) - (3)].interm).loc, "assign", (yyvsp[(3) - (3)].interm.intermTypedNode)); - (yyval.interm.intermTypedNode) = parseContext.intermediate.addAssign((yyvsp[(2) - (3)].interm).op, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].interm).loc); + --parseContext.controlFlowNestingLevel; + parseContext.boolCheck((yyvsp[-4].lex).loc, (yyvsp[-5].interm.intermTypedNode)); + parseContext.rValueErrorCheck((yyvsp[-4].lex).loc, "?", (yyvsp[-5].interm.intermTypedNode)); + parseContext.rValueErrorCheck((yyvsp[-1].lex).loc, ":", (yyvsp[-2].interm.intermTypedNode)); + parseContext.rValueErrorCheck((yyvsp[-1].lex).loc, ":", (yyvsp[0].interm.intermTypedNode)); + (yyval.interm.intermTypedNode) = parseContext.intermediate.addSelection((yyvsp[-5].interm.intermTypedNode), (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode), (yyvsp[-4].lex).loc); if ((yyval.interm.intermTypedNode) == 0) { - parseContext.assignError((yyvsp[(2) - (3)].interm).loc, "assign", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString()); - (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode); + parseContext.binaryOpError((yyvsp[-4].lex).loc, ":", (yyvsp[-2].interm.intermTypedNode)->getCompleteString(), (yyvsp[0].interm.intermTypedNode)->getCompleteString()); + (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } } +#line 3812 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 71: -/* Line 1792 of yacc.c */ -#line 632 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" - { - (yyval.interm).loc = (yyvsp[(1) - (1)].lex).loc; - (yyval.interm).op = EOpAssign; - } +#line 626 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } +#line 3818 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 72: -/* Line 1792 of yacc.c */ -#line 636 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 627 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm).loc = (yyvsp[(1) - (1)].lex).loc; - (yyval.interm).op = EOpMulAssign; + parseContext.arrayObjectCheck((yyvsp[-1].interm).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "array assignment"); + parseContext.opaqueCheck((yyvsp[-1].interm).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "="); + parseContext.specializationCheck((yyvsp[-1].interm).loc, (yyvsp[-2].interm.intermTypedNode)->getType(), "="); + parseContext.lValueErrorCheck((yyvsp[-1].interm).loc, "assign", (yyvsp[-2].interm.intermTypedNode)); + parseContext.rValueErrorCheck((yyvsp[-1].interm).loc, "assign", (yyvsp[0].interm.intermTypedNode)); + (yyval.interm.intermTypedNode) = parseContext.intermediate.addAssign((yyvsp[-1].interm).op, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode), (yyvsp[-1].interm).loc); + if ((yyval.interm.intermTypedNode) == 0) { + parseContext.assignError((yyvsp[-1].interm).loc, "assign", (yyvsp[-2].interm.intermTypedNode)->getCompleteString(), (yyvsp[0].interm.intermTypedNode)->getCompleteString()); + (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); + } } +#line 3835 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 73: -/* Line 1792 of yacc.c */ -#line 640 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 642 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm).loc = (yyvsp[(1) - (1)].lex).loc; - (yyval.interm).op = EOpDivAssign; + (yyval.interm).loc = (yyvsp[0].lex).loc; + (yyval.interm).op = EOpAssign; } +#line 3844 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 74: -/* Line 1792 of yacc.c */ -#line 644 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 646 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.fullIntegerCheck((yyvsp[(1) - (1)].lex).loc, "%="); - (yyval.interm).loc = (yyvsp[(1) - (1)].lex).loc; - (yyval.interm).op = EOpModAssign; + (yyval.interm).loc = (yyvsp[0].lex).loc; + (yyval.interm).op = EOpMulAssign; } +#line 3853 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 75: -/* Line 1792 of yacc.c */ -#line 649 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 650 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm).loc = (yyvsp[(1) - (1)].lex).loc; - (yyval.interm).op = EOpAddAssign; + (yyval.interm).loc = (yyvsp[0].lex).loc; + (yyval.interm).op = EOpDivAssign; } +#line 3862 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 76: -/* Line 1792 of yacc.c */ -#line 653 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 654 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm).loc = (yyvsp[(1) - (1)].lex).loc; - (yyval.interm).op = EOpSubAssign; + parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "%="); + (yyval.interm).loc = (yyvsp[0].lex).loc; + (yyval.interm).op = EOpModAssign; } +#line 3872 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 77: -/* Line 1792 of yacc.c */ -#line 657 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 659 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.fullIntegerCheck((yyvsp[(1) - (1)].lex).loc, "bit-shift left assign"); - (yyval.interm).loc = (yyvsp[(1) - (1)].lex).loc; (yyval.interm).op = EOpLeftShiftAssign; + (yyval.interm).loc = (yyvsp[0].lex).loc; + (yyval.interm).op = EOpAddAssign; } +#line 3881 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 78: -/* Line 1792 of yacc.c */ -#line 661 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 663 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.fullIntegerCheck((yyvsp[(1) - (1)].lex).loc, "bit-shift right assign"); - (yyval.interm).loc = (yyvsp[(1) - (1)].lex).loc; (yyval.interm).op = EOpRightShiftAssign; + (yyval.interm).loc = (yyvsp[0].lex).loc; + (yyval.interm).op = EOpSubAssign; } +#line 3890 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 79: -/* Line 1792 of yacc.c */ -#line 665 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 667 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.fullIntegerCheck((yyvsp[(1) - (1)].lex).loc, "bitwise-and assign"); - (yyval.interm).loc = (yyvsp[(1) - (1)].lex).loc; (yyval.interm).op = EOpAndAssign; + parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "bit-shift left assign"); + (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpLeftShiftAssign; } +#line 3899 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 80: -/* Line 1792 of yacc.c */ -#line 669 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 671 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.fullIntegerCheck((yyvsp[(1) - (1)].lex).loc, "bitwise-xor assign"); - (yyval.interm).loc = (yyvsp[(1) - (1)].lex).loc; (yyval.interm).op = EOpExclusiveOrAssign; + parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "bit-shift right assign"); + (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpRightShiftAssign; } +#line 3908 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 81: -/* Line 1792 of yacc.c */ -#line 673 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 675 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.fullIntegerCheck((yyvsp[(1) - (1)].lex).loc, "bitwise-or assign"); - (yyval.interm).loc = (yyvsp[(1) - (1)].lex).loc; (yyval.interm).op = EOpInclusiveOrAssign; + parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "bitwise-and assign"); + (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpAndAssign; } +#line 3917 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 82: -/* Line 1792 of yacc.c */ -#line 680 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 679 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); + parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "bitwise-xor assign"); + (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpExclusiveOrAssign; } +#line 3926 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 83: -/* Line 1792 of yacc.c */ -#line 683 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 683 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.intermTypedNode) = parseContext.intermediate.addComma((yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).loc); - if ((yyval.interm.intermTypedNode) == 0) { - parseContext.binaryOpError((yyvsp[(2) - (3)].lex).loc, ",", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString()); - (yyval.interm.intermTypedNode) = (yyvsp[(3) - (3)].interm.intermTypedNode); - } + parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "bitwise-or assign"); + (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpInclusiveOrAssign; } +#line 3935 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 84: -/* Line 1792 of yacc.c */ -#line 693 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 690 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.constantValueCheck((yyvsp[(1) - (1)].interm.intermTypedNode), ""); - (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); + (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } +#line 3943 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 85: -/* Line 1792 of yacc.c */ -#line 700 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 693 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.handleFunctionDeclarator((yyvsp[(1) - (2)].interm).loc, *(yyvsp[(1) - (2)].interm).function, true /* prototype */); - (yyval.interm.intermNode) = 0; - // TODO: 4.0 functionality: subroutines: make the identifier a user type for this signature + (yyval.interm.intermTypedNode) = parseContext.intermediate.addComma((yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode), (yyvsp[-1].lex).loc); + if ((yyval.interm.intermTypedNode) == 0) { + parseContext.binaryOpError((yyvsp[-1].lex).loc, ",", (yyvsp[-2].interm.intermTypedNode)->getCompleteString(), (yyvsp[0].interm.intermTypedNode)->getCompleteString()); + (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); + } } +#line 3955 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 86: -/* Line 1792 of yacc.c */ -#line 705 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 703 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - if ((yyvsp[(1) - (2)].interm).intermNode && (yyvsp[(1) - (2)].interm).intermNode->getAsAggregate()) - (yyvsp[(1) - (2)].interm).intermNode->getAsAggregate()->setOperator(EOpSequence); - (yyval.interm.intermNode) = (yyvsp[(1) - (2)].interm).intermNode; + parseContext.constantValueCheck((yyvsp[0].interm.intermTypedNode), ""); + (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } +#line 3964 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 87: -/* Line 1792 of yacc.c */ -#line 710 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 710 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.profileRequires((yyvsp[(1) - (4)].lex).loc, ENoProfile, 130, 0, "precision statement"); - - // lazy setting of the previous scope's defaults, has effect only the first time it is called in a particular scope - parseContext.symbolTable.setPreviousDefaultPrecisions(&parseContext.defaultPrecision[0]); - parseContext.setDefaultPrecision((yyvsp[(1) - (4)].lex).loc, (yyvsp[(3) - (4)].interm.type), (yyvsp[(2) - (4)].interm.type).qualifier.precision); + parseContext.handleFunctionDeclarator((yyvsp[-1].interm).loc, *(yyvsp[-1].interm).function, true /* prototype */); (yyval.interm.intermNode) = 0; + // TODO: 4.0 functionality: subroutines: make the identifier a user type for this signature } +#line 3974 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 88: -/* Line 1792 of yacc.c */ -#line 718 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 715 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.declareBlock((yyvsp[(1) - (2)].interm).loc, *(yyvsp[(1) - (2)].interm).typeList); - (yyval.interm.intermNode) = 0; + if ((yyvsp[-1].interm).intermNode && (yyvsp[-1].interm).intermNode->getAsAggregate()) + (yyvsp[-1].interm).intermNode->getAsAggregate()->setOperator(EOpSequence); + (yyval.interm.intermNode) = (yyvsp[-1].interm).intermNode; } +#line 3984 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 89: -/* Line 1792 of yacc.c */ -#line 722 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 720 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.declareBlock((yyvsp[(1) - (3)].interm).loc, *(yyvsp[(1) - (3)].interm).typeList, (yyvsp[(2) - (3)].lex).string); + parseContext.profileRequires((yyvsp[-3].lex).loc, ENoProfile, 130, 0, "precision statement"); + + // lazy setting of the previous scope's defaults, has effect only the first time it is called in a particular scope + parseContext.symbolTable.setPreviousDefaultPrecisions(&parseContext.defaultPrecision[0]); + parseContext.setDefaultPrecision((yyvsp[-3].lex).loc, (yyvsp[-1].interm.type), (yyvsp[-2].interm.type).qualifier.precision); (yyval.interm.intermNode) = 0; } +#line 3997 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 90: -/* Line 1792 of yacc.c */ -#line 726 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 728 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.declareBlock((yyvsp[(1) - (4)].interm).loc, *(yyvsp[(1) - (4)].interm).typeList, (yyvsp[(2) - (4)].lex).string, (yyvsp[(3) - (4)].interm).arraySizes); + parseContext.declareBlock((yyvsp[-1].interm).loc, *(yyvsp[-1].interm).typeList); (yyval.interm.intermNode) = 0; } +#line 4006 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 91: -/* Line 1792 of yacc.c */ -#line 730 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 732 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.globalQualifierFixCheck((yyvsp[(1) - (2)].interm.type).loc, (yyvsp[(1) - (2)].interm.type).qualifier); - parseContext.updateStandaloneQualifierDefaults((yyvsp[(1) - (2)].interm.type).loc, (yyvsp[(1) - (2)].interm.type)); + parseContext.declareBlock((yyvsp[-2].interm).loc, *(yyvsp[-2].interm).typeList, (yyvsp[-1].lex).string); (yyval.interm.intermNode) = 0; } +#line 4015 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 92: -/* Line 1792 of yacc.c */ -#line 735 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 736 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.checkNoShaderLayouts((yyvsp[(1) - (3)].interm.type).loc, (yyvsp[(1) - (3)].interm.type).shaderQualifiers); - parseContext.addQualifierToExisting((yyvsp[(1) - (3)].interm.type).loc, (yyvsp[(1) - (3)].interm.type).qualifier, *(yyvsp[(2) - (3)].lex).string); + parseContext.declareBlock((yyvsp[-3].interm).loc, *(yyvsp[-3].interm).typeList, (yyvsp[-2].lex).string, (yyvsp[-1].interm).arraySizes); (yyval.interm.intermNode) = 0; } +#line 4024 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 93: -/* Line 1792 of yacc.c */ -#line 740 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 740 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.checkNoShaderLayouts((yyvsp[(1) - (4)].interm.type).loc, (yyvsp[(1) - (4)].interm.type).shaderQualifiers); - (yyvsp[(3) - (4)].interm.identifierList)->push_back((yyvsp[(2) - (4)].lex).string); - parseContext.addQualifierToExisting((yyvsp[(1) - (4)].interm.type).loc, (yyvsp[(1) - (4)].interm.type).qualifier, *(yyvsp[(3) - (4)].interm.identifierList)); + parseContext.globalQualifierFixCheck((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type).qualifier); + parseContext.updateStandaloneQualifierDefaults((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type)); (yyval.interm.intermNode) = 0; } +#line 4034 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 94: -/* Line 1792 of yacc.c */ -#line 749 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" - { parseContext.nestedBlockCheck((yyvsp[(1) - (3)].interm.type).loc); } +#line 745 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.checkNoShaderLayouts((yyvsp[-2].interm.type).loc, (yyvsp[-2].interm.type).shaderQualifiers); + parseContext.addQualifierToExisting((yyvsp[-2].interm.type).loc, (yyvsp[-2].interm.type).qualifier, *(yyvsp[-1].lex).string); + (yyval.interm.intermNode) = 0; + } +#line 4044 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 95: -/* Line 1792 of yacc.c */ -#line 749 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 750 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - --parseContext.structNestingLevel; - parseContext.blockName = (yyvsp[(2) - (6)].lex).string; - parseContext.globalQualifierFixCheck((yyvsp[(1) - (6)].interm.type).loc, (yyvsp[(1) - (6)].interm.type).qualifier); - parseContext.checkNoShaderLayouts((yyvsp[(1) - (6)].interm.type).loc, (yyvsp[(1) - (6)].interm.type).shaderQualifiers); - parseContext.currentBlockQualifier = (yyvsp[(1) - (6)].interm.type).qualifier; - (yyval.interm).loc = (yyvsp[(1) - (6)].interm.type).loc; - (yyval.interm).typeList = (yyvsp[(5) - (6)].interm.typeList); + parseContext.checkNoShaderLayouts((yyvsp[-3].interm.type).loc, (yyvsp[-3].interm.type).shaderQualifiers); + (yyvsp[-1].interm.identifierList)->push_back((yyvsp[-2].lex).string); + parseContext.addQualifierToExisting((yyvsp[-3].interm.type).loc, (yyvsp[-3].interm.type).qualifier, *(yyvsp[-1].interm.identifierList)); + (yyval.interm.intermNode) = 0; } +#line 4055 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 96: -/* Line 1792 of yacc.c */ -#line 760 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" - { - (yyval.interm.identifierList) = new TIdentifierList; - (yyval.interm.identifierList)->push_back((yyvsp[(2) - (2)].lex).string); - } +#line 759 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { parseContext.nestedBlockCheck((yyvsp[-2].interm.type).loc); } +#line 4061 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 97: -/* Line 1792 of yacc.c */ -#line 764 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 759 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.identifierList) = (yyvsp[(1) - (3)].interm.identifierList); - (yyval.interm.identifierList)->push_back((yyvsp[(3) - (3)].lex).string); + --parseContext.structNestingLevel; + parseContext.blockName = (yyvsp[-4].lex).string; + parseContext.globalQualifierFixCheck((yyvsp[-5].interm.type).loc, (yyvsp[-5].interm.type).qualifier); + parseContext.checkNoShaderLayouts((yyvsp[-5].interm.type).loc, (yyvsp[-5].interm.type).shaderQualifiers); + parseContext.currentBlockQualifier = (yyvsp[-5].interm.type).qualifier; + (yyval.interm).loc = (yyvsp[-5].interm.type).loc; + (yyval.interm).typeList = (yyvsp[-1].interm.typeList); } +#line 4075 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 98: -/* Line 1792 of yacc.c */ -#line 771 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 770 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm).function = (yyvsp[(1) - (2)].interm.function); - (yyval.interm).loc = (yyvsp[(2) - (2)].lex).loc; + (yyval.interm.identifierList) = new TIdentifierList; + (yyval.interm.identifierList)->push_back((yyvsp[0].lex).string); } +#line 4084 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 99: -/* Line 1792 of yacc.c */ -#line 778 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 774 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.function) = (yyvsp[(1) - (1)].interm.function); + (yyval.interm.identifierList) = (yyvsp[-2].interm.identifierList); + (yyval.interm.identifierList)->push_back((yyvsp[0].lex).string); } +#line 4093 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 100: -/* Line 1792 of yacc.c */ -#line 781 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 781 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.function) = (yyvsp[(1) - (1)].interm.function); + (yyval.interm).function = (yyvsp[-1].interm.function); + (yyval.interm).loc = (yyvsp[0].lex).loc; } +#line 4102 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 101: -/* Line 1792 of yacc.c */ -#line 788 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 788 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - // Add the parameter - (yyval.interm.function) = (yyvsp[(1) - (2)].interm.function); - if ((yyvsp[(2) - (2)].interm).param.type->getBasicType() != EbtVoid) - (yyvsp[(1) - (2)].interm.function)->addParameter((yyvsp[(2) - (2)].interm).param); - else - delete (yyvsp[(2) - (2)].interm).param.type; + (yyval.interm.function) = (yyvsp[0].interm.function); } +#line 4110 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 102: -/* Line 1792 of yacc.c */ -#line 796 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 791 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.function) = (yyvsp[0].interm.function); + } +#line 4118 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 103: +#line 798 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + // Add the parameter + (yyval.interm.function) = (yyvsp[-1].interm.function); + if ((yyvsp[0].interm).param.type->getBasicType() != EbtVoid) + (yyvsp[-1].interm.function)->addParameter((yyvsp[0].interm).param); + else + delete (yyvsp[0].interm).param.type; + } +#line 4131 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 104: +#line 806 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { // // Only first parameter of one-parameter functions can be void // The check for named parameters not being void is done in parameter_declarator // - if ((yyvsp[(3) - (3)].interm).param.type->getBasicType() == EbtVoid) { + if ((yyvsp[0].interm).param.type->getBasicType() == EbtVoid) { // // This parameter > first is void // - parseContext.error((yyvsp[(2) - (3)].lex).loc, "cannot be an argument type except for '(void)'", "void", ""); - delete (yyvsp[(3) - (3)].interm).param.type; + parseContext.error((yyvsp[-1].lex).loc, "cannot be an argument type except for '(void)'", "void", ""); + delete (yyvsp[0].interm).param.type; } else { // Add the parameter - (yyval.interm.function) = (yyvsp[(1) - (3)].interm.function); - (yyvsp[(1) - (3)].interm.function)->addParameter((yyvsp[(3) - (3)].interm).param); + (yyval.interm.function) = (yyvsp[-2].interm.function); + (yyvsp[-2].interm.function)->addParameter((yyvsp[0].interm).param); } } - break; - - case 103: -/* Line 1792 of yacc.c */ -#line 816 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" - { - if ((yyvsp[(1) - (3)].interm.type).qualifier.storage != EvqGlobal && (yyvsp[(1) - (3)].interm.type).qualifier.storage != EvqTemporary) { - parseContext.error((yyvsp[(2) - (3)].lex).loc, "no qualifiers allowed for function return", - GetStorageQualifierString((yyvsp[(1) - (3)].interm.type).qualifier.storage), ""); - } - if ((yyvsp[(1) - (3)].interm.type).arraySizes) - parseContext.arraySizeRequiredCheck((yyvsp[(1) - (3)].interm.type).loc, *(yyvsp[(1) - (3)].interm.type).arraySizes); - - // Add the function as a prototype after parsing it (we do not support recursion) - TFunction *function; - TType type((yyvsp[(1) - (3)].interm.type)); - function = new TFunction((yyvsp[(2) - (3)].lex).string, type); - (yyval.interm.function) = function; - } - break; - - case 104: -/* Line 1792 of yacc.c */ -#line 834 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" - { - if ((yyvsp[(1) - (2)].interm.type).arraySizes) { - parseContext.profileRequires((yyvsp[(1) - (2)].interm.type).loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type"); - parseContext.profileRequires((yyvsp[(1) - (2)].interm.type).loc, EEsProfile, 300, 0, "arrayed type"); - parseContext.arraySizeRequiredCheck((yyvsp[(1) - (2)].interm.type).loc, *(yyvsp[(1) - (2)].interm.type).arraySizes); - } - if ((yyvsp[(1) - (2)].interm.type).basicType == EbtVoid) { - parseContext.error((yyvsp[(2) - (2)].lex).loc, "illegal use of type 'void'", (yyvsp[(2) - (2)].lex).string->c_str(), ""); - } - parseContext.reservedErrorCheck((yyvsp[(2) - (2)].lex).loc, *(yyvsp[(2) - (2)].lex).string); - - TParameter param = {(yyvsp[(2) - (2)].lex).string, new TType((yyvsp[(1) - (2)].interm.type))}; - (yyval.interm).loc = (yyvsp[(2) - (2)].lex).loc; - (yyval.interm).param = param; - } +#line 4153 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 105: -/* Line 1792 of yacc.c */ -#line 849 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 826 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - if ((yyvsp[(1) - (3)].interm.type).arraySizes) { - parseContext.profileRequires((yyvsp[(1) - (3)].interm.type).loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type"); - parseContext.profileRequires((yyvsp[(1) - (3)].interm.type).loc, EEsProfile, 300, 0, "arrayed type"); - parseContext.arraySizeRequiredCheck((yyvsp[(1) - (3)].interm.type).loc, *(yyvsp[(1) - (3)].interm.type).arraySizes); + if ((yyvsp[-2].interm.type).qualifier.storage != EvqGlobal && (yyvsp[-2].interm.type).qualifier.storage != EvqTemporary) { + parseContext.error((yyvsp[-1].lex).loc, "no qualifiers allowed for function return", + GetStorageQualifierString((yyvsp[-2].interm.type).qualifier.storage), ""); } - parseContext.arrayDimCheck((yyvsp[(2) - (3)].lex).loc, (yyvsp[(1) - (3)].interm.type).arraySizes, (yyvsp[(3) - (3)].interm).arraySizes); + if ((yyvsp[-2].interm.type).arraySizes) + parseContext.arraySizeRequiredCheck((yyvsp[-2].interm.type).loc, *(yyvsp[-2].interm.type).arraySizes); - parseContext.arraySizeRequiredCheck((yyvsp[(3) - (3)].interm).loc, *(yyvsp[(3) - (3)].interm).arraySizes); - parseContext.reservedErrorCheck((yyvsp[(2) - (3)].lex).loc, *(yyvsp[(2) - (3)].lex).string); - - (yyvsp[(1) - (3)].interm.type).arraySizes = (yyvsp[(3) - (3)].interm).arraySizes; - - TParameter param = { (yyvsp[(2) - (3)].lex).string, new TType((yyvsp[(1) - (3)].interm.type))}; - (yyval.interm).loc = (yyvsp[(2) - (3)].lex).loc; - (yyval.interm).param = param; + // Add the function as a prototype after parsing it (we do not support recursion) + TFunction *function; + TType type((yyvsp[-2].interm.type)); + function = new TFunction((yyvsp[-1].lex).string, type); + (yyval.interm.function) = function; } +#line 4172 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 106: -/* Line 1792 of yacc.c */ -#line 872 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 844 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm) = (yyvsp[(2) - (2)].interm); - if ((yyvsp[(1) - (2)].interm.type).qualifier.precision != EpqNone) - (yyval.interm).param.type->getQualifier().precision = (yyvsp[(1) - (2)].interm.type).qualifier.precision; - parseContext.precisionQualifierCheck((yyval.interm).loc, (yyval.interm).param.type->getBasicType(), (yyval.interm).param.type->getQualifier()); - - parseContext.checkNoShaderLayouts((yyvsp[(1) - (2)].interm.type).loc, (yyvsp[(1) - (2)].interm.type).shaderQualifiers); - parseContext.parameterTypeCheck((yyvsp[(2) - (2)].interm).loc, (yyvsp[(1) - (2)].interm.type).qualifier.storage, *(yyval.interm).param.type); - parseContext.paramCheckFix((yyvsp[(1) - (2)].interm.type).loc, (yyvsp[(1) - (2)].interm.type).qualifier, *(yyval.interm).param.type); + if ((yyvsp[-1].interm.type).arraySizes) { + parseContext.profileRequires((yyvsp[-1].interm.type).loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type"); + parseContext.profileRequires((yyvsp[-1].interm.type).loc, EEsProfile, 300, 0, "arrayed type"); + parseContext.arraySizeRequiredCheck((yyvsp[-1].interm.type).loc, *(yyvsp[-1].interm.type).arraySizes); + } + if ((yyvsp[-1].interm.type).basicType == EbtVoid) { + parseContext.error((yyvsp[0].lex).loc, "illegal use of type 'void'", (yyvsp[0].lex).string->c_str(), ""); + } + parseContext.reservedErrorCheck((yyvsp[0].lex).loc, *(yyvsp[0].lex).string); + TParameter param = {(yyvsp[0].lex).string, new TType((yyvsp[-1].interm.type))}; + (yyval.interm).loc = (yyvsp[0].lex).loc; + (yyval.interm).param = param; } +#line 4192 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 107: -/* Line 1792 of yacc.c */ -#line 883 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 859 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm) = (yyvsp[(1) - (1)].interm); + if ((yyvsp[-2].interm.type).arraySizes) { + parseContext.profileRequires((yyvsp[-2].interm.type).loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type"); + parseContext.profileRequires((yyvsp[-2].interm.type).loc, EEsProfile, 300, 0, "arrayed type"); + parseContext.arraySizeRequiredCheck((yyvsp[-2].interm.type).loc, *(yyvsp[-2].interm.type).arraySizes); + } + parseContext.arrayDimCheck((yyvsp[-1].lex).loc, (yyvsp[-2].interm.type).arraySizes, (yyvsp[0].interm).arraySizes); - parseContext.parameterTypeCheck((yyvsp[(1) - (1)].interm).loc, EvqIn, *(yyvsp[(1) - (1)].interm).param.type); - parseContext.paramCheckFix((yyvsp[(1) - (1)].interm).loc, EvqTemporary, *(yyval.interm).param.type); - parseContext.precisionQualifierCheck((yyval.interm).loc, (yyval.interm).param.type->getBasicType(), (yyval.interm).param.type->getQualifier()); + parseContext.arraySizeRequiredCheck((yyvsp[0].interm).loc, *(yyvsp[0].interm).arraySizes); + parseContext.reservedErrorCheck((yyvsp[-1].lex).loc, *(yyvsp[-1].lex).string); + + (yyvsp[-2].interm.type).arraySizes = (yyvsp[0].interm).arraySizes; + + TParameter param = { (yyvsp[-1].lex).string, new TType((yyvsp[-2].interm.type))}; + (yyval.interm).loc = (yyvsp[-1].lex).loc; + (yyval.interm).param = param; } +#line 4214 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 108: -/* Line 1792 of yacc.c */ -#line 893 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 882 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm) = (yyvsp[(2) - (2)].interm); - if ((yyvsp[(1) - (2)].interm.type).qualifier.precision != EpqNone) - (yyval.interm).param.type->getQualifier().precision = (yyvsp[(1) - (2)].interm.type).qualifier.precision; - parseContext.precisionQualifierCheck((yyvsp[(1) - (2)].interm.type).loc, (yyval.interm).param.type->getBasicType(), (yyval.interm).param.type->getQualifier()); + (yyval.interm) = (yyvsp[0].interm); + if ((yyvsp[-1].interm.type).qualifier.precision != EpqNone) + (yyval.interm).param.type->getQualifier().precision = (yyvsp[-1].interm.type).qualifier.precision; + parseContext.precisionQualifierCheck((yyval.interm).loc, (yyval.interm).param.type->getBasicType(), (yyval.interm).param.type->getQualifier()); + + parseContext.checkNoShaderLayouts((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type).shaderQualifiers); + parseContext.parameterTypeCheck((yyvsp[0].interm).loc, (yyvsp[-1].interm.type).qualifier.storage, *(yyval.interm).param.type); + parseContext.paramCheckFix((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type).qualifier, *(yyval.interm).param.type); - parseContext.checkNoShaderLayouts((yyvsp[(1) - (2)].interm.type).loc, (yyvsp[(1) - (2)].interm.type).shaderQualifiers); - parseContext.parameterTypeCheck((yyvsp[(2) - (2)].interm).loc, (yyvsp[(1) - (2)].interm.type).qualifier.storage, *(yyval.interm).param.type); - parseContext.paramCheckFix((yyvsp[(1) - (2)].interm.type).loc, (yyvsp[(1) - (2)].interm.type).qualifier, *(yyval.interm).param.type); } +#line 4230 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 109: -/* Line 1792 of yacc.c */ -#line 903 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 893 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm) = (yyvsp[(1) - (1)].interm); + (yyval.interm) = (yyvsp[0].interm); - parseContext.parameterTypeCheck((yyvsp[(1) - (1)].interm).loc, EvqIn, *(yyvsp[(1) - (1)].interm).param.type); - parseContext.paramCheckFix((yyvsp[(1) - (1)].interm).loc, EvqTemporary, *(yyval.interm).param.type); + parseContext.parameterTypeCheck((yyvsp[0].interm).loc, EvqIn, *(yyvsp[0].interm).param.type); + parseContext.paramCheckFix((yyvsp[0].interm).loc, EvqTemporary, *(yyval.interm).param.type); parseContext.precisionQualifierCheck((yyval.interm).loc, (yyval.interm).param.type->getBasicType(), (yyval.interm).param.type->getQualifier()); } +#line 4242 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 110: -/* Line 1792 of yacc.c */ -#line 913 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 903 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - TParameter param = { 0, new TType((yyvsp[(1) - (1)].interm.type)) }; - (yyval.interm).param = param; - if ((yyvsp[(1) - (1)].interm.type).arraySizes) - parseContext.arraySizeRequiredCheck((yyvsp[(1) - (1)].interm.type).loc, *(yyvsp[(1) - (1)].interm.type).arraySizes); + (yyval.interm) = (yyvsp[0].interm); + if ((yyvsp[-1].interm.type).qualifier.precision != EpqNone) + (yyval.interm).param.type->getQualifier().precision = (yyvsp[-1].interm.type).qualifier.precision; + parseContext.precisionQualifierCheck((yyvsp[-1].interm.type).loc, (yyval.interm).param.type->getBasicType(), (yyval.interm).param.type->getQualifier()); + + parseContext.checkNoShaderLayouts((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type).shaderQualifiers); + parseContext.parameterTypeCheck((yyvsp[0].interm).loc, (yyvsp[-1].interm.type).qualifier.storage, *(yyval.interm).param.type); + parseContext.paramCheckFix((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type).qualifier, *(yyval.interm).param.type); } +#line 4257 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 111: -/* Line 1792 of yacc.c */ -#line 922 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 913 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm) = (yyvsp[(1) - (1)].interm); + (yyval.interm) = (yyvsp[0].interm); + + parseContext.parameterTypeCheck((yyvsp[0].interm).loc, EvqIn, *(yyvsp[0].interm).param.type); + parseContext.paramCheckFix((yyvsp[0].interm).loc, EvqTemporary, *(yyval.interm).param.type); + parseContext.precisionQualifierCheck((yyval.interm).loc, (yyval.interm).param.type->getBasicType(), (yyval.interm).param.type->getQualifier()); } +#line 4269 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 112: -/* Line 1792 of yacc.c */ -#line 925 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 923 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm) = (yyvsp[(1) - (3)].interm); - parseContext.declareVariable((yyvsp[(3) - (3)].lex).loc, *(yyvsp[(3) - (3)].lex).string, (yyvsp[(1) - (3)].interm).type); + TParameter param = { 0, new TType((yyvsp[0].interm.type)) }; + (yyval.interm).param = param; + if ((yyvsp[0].interm.type).arraySizes) + parseContext.arraySizeRequiredCheck((yyvsp[0].interm.type).loc, *(yyvsp[0].interm.type).arraySizes); } +#line 4280 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 113: -/* Line 1792 of yacc.c */ -#line 929 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 932 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm) = (yyvsp[(1) - (4)].interm); - parseContext.declareVariable((yyvsp[(3) - (4)].lex).loc, *(yyvsp[(3) - (4)].lex).string, (yyvsp[(1) - (4)].interm).type, (yyvsp[(4) - (4)].interm).arraySizes); + (yyval.interm) = (yyvsp[0].interm); } +#line 4288 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 114: -/* Line 1792 of yacc.c */ -#line 933 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 935 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm).type = (yyvsp[(1) - (6)].interm).type; - TIntermNode* initNode = parseContext.declareVariable((yyvsp[(3) - (6)].lex).loc, *(yyvsp[(3) - (6)].lex).string, (yyvsp[(1) - (6)].interm).type, (yyvsp[(4) - (6)].interm).arraySizes, (yyvsp[(6) - (6)].interm.intermTypedNode)); - (yyval.interm).intermNode = parseContext.intermediate.growAggregate((yyvsp[(1) - (6)].interm).intermNode, initNode, (yyvsp[(5) - (6)].lex).loc); + (yyval.interm) = (yyvsp[-2].interm); + parseContext.declareVariable((yyvsp[0].lex).loc, *(yyvsp[0].lex).string, (yyvsp[-2].interm).type); } +#line 4297 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 115: -/* Line 1792 of yacc.c */ -#line 938 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 939 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm).type = (yyvsp[(1) - (5)].interm).type; - TIntermNode* initNode = parseContext.declareVariable((yyvsp[(3) - (5)].lex).loc, *(yyvsp[(3) - (5)].lex).string, (yyvsp[(1) - (5)].interm).type, 0, (yyvsp[(5) - (5)].interm.intermTypedNode)); - (yyval.interm).intermNode = parseContext.intermediate.growAggregate((yyvsp[(1) - (5)].interm).intermNode, initNode, (yyvsp[(4) - (5)].lex).loc); + (yyval.interm) = (yyvsp[-3].interm); + parseContext.declareVariable((yyvsp[-1].lex).loc, *(yyvsp[-1].lex).string, (yyvsp[-3].interm).type, (yyvsp[0].interm).arraySizes); } +#line 4306 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 116: -/* Line 1792 of yacc.c */ -#line 946 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 943 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm).type = (yyvsp[(1) - (1)].interm.type); - (yyval.interm).intermNode = 0; - parseContext.declareTypeDefaults((yyval.interm).loc, (yyval.interm).type); + (yyval.interm).type = (yyvsp[-5].interm).type; + TIntermNode* initNode = parseContext.declareVariable((yyvsp[-3].lex).loc, *(yyvsp[-3].lex).string, (yyvsp[-5].interm).type, (yyvsp[-2].interm).arraySizes, (yyvsp[0].interm.intermTypedNode)); + (yyval.interm).intermNode = parseContext.intermediate.growAggregate((yyvsp[-5].interm).intermNode, initNode, (yyvsp[-1].lex).loc); } +#line 4316 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 117: -/* Line 1792 of yacc.c */ -#line 951 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 948 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm).type = (yyvsp[(1) - (2)].interm.type); - (yyval.interm).intermNode = 0; - parseContext.declareVariable((yyvsp[(2) - (2)].lex).loc, *(yyvsp[(2) - (2)].lex).string, (yyvsp[(1) - (2)].interm.type)); + (yyval.interm).type = (yyvsp[-4].interm).type; + TIntermNode* initNode = parseContext.declareVariable((yyvsp[-2].lex).loc, *(yyvsp[-2].lex).string, (yyvsp[-4].interm).type, 0, (yyvsp[0].interm.intermTypedNode)); + (yyval.interm).intermNode = parseContext.intermediate.growAggregate((yyvsp[-4].interm).intermNode, initNode, (yyvsp[-1].lex).loc); } +#line 4326 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 118: -/* Line 1792 of yacc.c */ -#line 956 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 956 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm).type = (yyvsp[(1) - (3)].interm.type); + (yyval.interm).type = (yyvsp[0].interm.type); (yyval.interm).intermNode = 0; - parseContext.declareVariable((yyvsp[(2) - (3)].lex).loc, *(yyvsp[(2) - (3)].lex).string, (yyvsp[(1) - (3)].interm.type), (yyvsp[(3) - (3)].interm).arraySizes); + parseContext.declareTypeDefaults((yyval.interm).loc, (yyval.interm).type); } +#line 4336 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 119: -/* Line 1792 of yacc.c */ -#line 961 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 961 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm).type = (yyvsp[(1) - (5)].interm.type); - TIntermNode* initNode = parseContext.declareVariable((yyvsp[(2) - (5)].lex).loc, *(yyvsp[(2) - (5)].lex).string, (yyvsp[(1) - (5)].interm.type), (yyvsp[(3) - (5)].interm).arraySizes, (yyvsp[(5) - (5)].interm.intermTypedNode)); - (yyval.interm).intermNode = parseContext.intermediate.growAggregate(0, initNode, (yyvsp[(4) - (5)].lex).loc); + (yyval.interm).type = (yyvsp[-1].interm.type); + (yyval.interm).intermNode = 0; + parseContext.declareVariable((yyvsp[0].lex).loc, *(yyvsp[0].lex).string, (yyvsp[-1].interm.type)); } +#line 4346 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 120: -/* Line 1792 of yacc.c */ -#line 966 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 966 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm).type = (yyvsp[(1) - (4)].interm.type); - TIntermNode* initNode = parseContext.declareVariable((yyvsp[(2) - (4)].lex).loc, *(yyvsp[(2) - (4)].lex).string, (yyvsp[(1) - (4)].interm.type), 0, (yyvsp[(4) - (4)].interm.intermTypedNode)); - (yyval.interm).intermNode = parseContext.intermediate.growAggregate(0, initNode, (yyvsp[(3) - (4)].lex).loc); + (yyval.interm).type = (yyvsp[-2].interm.type); + (yyval.interm).intermNode = 0; + parseContext.declareVariable((yyvsp[-1].lex).loc, *(yyvsp[-1].lex).string, (yyvsp[-2].interm.type), (yyvsp[0].interm).arraySizes); } +#line 4356 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 121: -/* Line 1792 of yacc.c */ -#line 975 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 971 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type); + (yyval.interm).type = (yyvsp[-4].interm.type); + TIntermNode* initNode = parseContext.declareVariable((yyvsp[-3].lex).loc, *(yyvsp[-3].lex).string, (yyvsp[-4].interm.type), (yyvsp[-2].interm).arraySizes, (yyvsp[0].interm.intermTypedNode)); + (yyval.interm).intermNode = parseContext.intermediate.growAggregate(0, initNode, (yyvsp[-1].lex).loc); + } +#line 4366 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; - parseContext.globalQualifierTypeCheck((yyvsp[(1) - (1)].interm.type).loc, (yyvsp[(1) - (1)].interm.type).qualifier, (yyval.interm.type)); - if ((yyvsp[(1) - (1)].interm.type).arraySizes) { - parseContext.profileRequires((yyvsp[(1) - (1)].interm.type).loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type"); - parseContext.profileRequires((yyvsp[(1) - (1)].interm.type).loc, EEsProfile, 300, 0, "arrayed type"); + case 122: +#line 976 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm).type = (yyvsp[-3].interm.type); + TIntermNode* initNode = parseContext.declareVariable((yyvsp[-2].lex).loc, *(yyvsp[-2].lex).string, (yyvsp[-3].interm.type), 0, (yyvsp[0].interm.intermTypedNode)); + (yyval.interm).intermNode = parseContext.intermediate.growAggregate(0, initNode, (yyvsp[-1].lex).loc); + } +#line 4376 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 123: +#line 985 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.type) = (yyvsp[0].interm.type); + + parseContext.globalQualifierTypeCheck((yyvsp[0].interm.type).loc, (yyvsp[0].interm.type).qualifier, (yyval.interm.type)); + if ((yyvsp[0].interm.type).arraySizes) { + parseContext.profileRequires((yyvsp[0].interm.type).loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type"); + parseContext.profileRequires((yyvsp[0].interm.type).loc, EEsProfile, 300, 0, "arrayed type"); } parseContext.precisionQualifierCheck((yyval.interm.type).loc, (yyval.interm.type).basicType, (yyval.interm.type).qualifier); } +#line 4392 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 122: -/* Line 1792 of yacc.c */ -#line 986 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + case 124: +#line 996 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.globalQualifierFixCheck((yyvsp[(1) - (2)].interm.type).loc, (yyvsp[(1) - (2)].interm.type).qualifier); - parseContext.globalQualifierTypeCheck((yyvsp[(1) - (2)].interm.type).loc, (yyvsp[(1) - (2)].interm.type).qualifier, (yyvsp[(2) - (2)].interm.type)); + parseContext.globalQualifierFixCheck((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type).qualifier); + parseContext.globalQualifierTypeCheck((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type).qualifier, (yyvsp[0].interm.type)); - if ((yyvsp[(2) - (2)].interm.type).arraySizes) { - parseContext.profileRequires((yyvsp[(2) - (2)].interm.type).loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type"); - parseContext.profileRequires((yyvsp[(2) - (2)].interm.type).loc, EEsProfile, 300, 0, "arrayed type"); + if ((yyvsp[0].interm.type).arraySizes) { + parseContext.profileRequires((yyvsp[0].interm.type).loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type"); + parseContext.profileRequires((yyvsp[0].interm.type).loc, EEsProfile, 300, 0, "arrayed type"); } - if ((yyvsp[(2) - (2)].interm.type).arraySizes && parseContext.arrayQualifierError((yyvsp[(2) - (2)].interm.type).loc, (yyvsp[(1) - (2)].interm.type).qualifier)) - (yyvsp[(2) - (2)].interm.type).arraySizes = 0; + if ((yyvsp[0].interm.type).arraySizes && parseContext.arrayQualifierError((yyvsp[0].interm.type).loc, (yyvsp[-1].interm.type).qualifier)) + (yyvsp[0].interm.type).arraySizes = 0; - parseContext.checkNoShaderLayouts((yyvsp[(2) - (2)].interm.type).loc, (yyvsp[(1) - (2)].interm.type).shaderQualifiers); - (yyvsp[(2) - (2)].interm.type).shaderQualifiers.merge((yyvsp[(1) - (2)].interm.type).shaderQualifiers); - parseContext.mergeQualifiers((yyvsp[(2) - (2)].interm.type).loc, (yyvsp[(2) - (2)].interm.type).qualifier, (yyvsp[(1) - (2)].interm.type).qualifier, true); - parseContext.precisionQualifierCheck((yyvsp[(2) - (2)].interm.type).loc, (yyvsp[(2) - (2)].interm.type).basicType, (yyvsp[(2) - (2)].interm.type).qualifier); + parseContext.checkNoShaderLayouts((yyvsp[0].interm.type).loc, (yyvsp[-1].interm.type).shaderQualifiers); + (yyvsp[0].interm.type).shaderQualifiers.merge((yyvsp[-1].interm.type).shaderQualifiers); + parseContext.mergeQualifiers((yyvsp[0].interm.type).loc, (yyvsp[0].interm.type).qualifier, (yyvsp[-1].interm.type).qualifier, true); + parseContext.precisionQualifierCheck((yyvsp[0].interm.type).loc, (yyvsp[0].interm.type).basicType, (yyvsp[0].interm.type).qualifier); - (yyval.interm.type) = (yyvsp[(2) - (2)].interm.type); + (yyval.interm.type) = (yyvsp[0].interm.type); if (! (yyval.interm.type).qualifier.isInterpolation() && ((parseContext.language == EShLangVertex && (yyval.interm.type).qualifier.storage == EvqVaryingOut) || (parseContext.language == EShLangFragment && (yyval.interm.type).qualifier.storage == EvqVaryingIn))) (yyval.interm.type).qualifier.smooth = true; } - break; - - case 123: -/* Line 1792 of yacc.c */ -#line 1013 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" - { - parseContext.globalCheck((yyvsp[(1) - (1)].lex).loc, "invariant"); - parseContext.profileRequires((yyval.interm.type).loc, ENoProfile, 120, 0, "invariant"); - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc); - (yyval.interm.type).qualifier.invariant = true; - } - break; - - case 124: -/* Line 1792 of yacc.c */ -#line 1022 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" - { - parseContext.globalCheck((yyvsp[(1) - (1)].lex).loc, "smooth"); - parseContext.profileRequires((yyvsp[(1) - (1)].lex).loc, ENoProfile, 130, 0, "smooth"); - parseContext.profileRequires((yyvsp[(1) - (1)].lex).loc, EEsProfile, 300, 0, "smooth"); - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc); - (yyval.interm.type).qualifier.smooth = true; - } +#line 4421 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 125: -/* Line 1792 of yacc.c */ -#line 1029 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1023 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.globalCheck((yyvsp[(1) - (1)].lex).loc, "flat"); - parseContext.profileRequires((yyvsp[(1) - (1)].lex).loc, ENoProfile, 130, 0, "flat"); - parseContext.profileRequires((yyvsp[(1) - (1)].lex).loc, EEsProfile, 300, 0, "flat"); - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc); - (yyval.interm.type).qualifier.flat = true; + parseContext.globalCheck((yyvsp[0].lex).loc, "invariant"); + parseContext.profileRequires((yyval.interm.type).loc, ENoProfile, 120, 0, "invariant"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.invariant = true; } +#line 4432 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 126: -/* Line 1792 of yacc.c */ -#line 1036 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1032 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.globalCheck((yyvsp[(1) - (1)].lex).loc, "noperspective"); - parseContext.requireProfile((yyvsp[(1) - (1)].lex).loc, ~EEsProfile, "noperspective"); - parseContext.profileRequires((yyvsp[(1) - (1)].lex).loc, ENoProfile, 130, 0, "noperspective"); - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc); - (yyval.interm.type).qualifier.nopersp = true; + parseContext.globalCheck((yyvsp[0].lex).loc, "smooth"); + parseContext.profileRequires((yyvsp[0].lex).loc, ENoProfile, 130, 0, "smooth"); + parseContext.profileRequires((yyvsp[0].lex).loc, EEsProfile, 300, 0, "smooth"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.smooth = true; } +#line 4444 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 127: -/* Line 1792 of yacc.c */ -#line 1046 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1039 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type) = (yyvsp[(3) - (4)].interm.type); + parseContext.globalCheck((yyvsp[0].lex).loc, "flat"); + parseContext.profileRequires((yyvsp[0].lex).loc, ENoProfile, 130, 0, "flat"); + parseContext.profileRequires((yyvsp[0].lex).loc, EEsProfile, 300, 0, "flat"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.flat = true; } +#line 4456 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 128: -/* Line 1792 of yacc.c */ -#line 1052 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1046 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type); + parseContext.globalCheck((yyvsp[0].lex).loc, "noperspective"); + parseContext.requireProfile((yyvsp[0].lex).loc, ~EEsProfile, "noperspective"); + parseContext.profileRequires((yyvsp[0].lex).loc, ENoProfile, 130, 0, "noperspective"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.nopersp = true; } +#line 4468 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 129: -/* Line 1792 of yacc.c */ -#line 1055 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1056 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type) = (yyvsp[(1) - (3)].interm.type); - (yyval.interm.type).shaderQualifiers.merge((yyvsp[(3) - (3)].interm.type).shaderQualifiers); - parseContext.mergeObjectLayoutQualifiers((yyval.interm.type).qualifier, (yyvsp[(3) - (3)].interm.type).qualifier, false); + (yyval.interm.type) = (yyvsp[-1].interm.type); } +#line 4476 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 130: -/* Line 1792 of yacc.c */ -#line 1062 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1062 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc); - parseContext.setLayoutQualifier((yyvsp[(1) - (1)].lex).loc, (yyval.interm.type), *(yyvsp[(1) - (1)].lex).string); + (yyval.interm.type) = (yyvsp[0].interm.type); } +#line 4484 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 131: -/* Line 1792 of yacc.c */ -#line 1066 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1065 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (3)].lex).loc); - parseContext.setLayoutQualifier((yyvsp[(1) - (3)].lex).loc, (yyval.interm.type), *(yyvsp[(1) - (3)].lex).string, (yyvsp[(3) - (3)].interm.intermTypedNode)); + (yyval.interm.type) = (yyvsp[-2].interm.type); + (yyval.interm.type).shaderQualifiers.merge((yyvsp[0].interm.type).shaderQualifiers); + parseContext.mergeObjectLayoutQualifiers((yyval.interm.type).qualifier, (yyvsp[0].interm.type).qualifier, false); } +#line 4494 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 132: -/* Line 1792 of yacc.c */ -#line 1070 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" - { // because "shared" is both an identifier and a keyword - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc); - TString strShared("shared"); - parseContext.setLayoutQualifier((yyvsp[(1) - (1)].lex).loc, (yyval.interm.type), strShared); +#line 1072 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.type).init((yyvsp[0].lex).loc); + parseContext.setLayoutQualifier((yyvsp[0].lex).loc, (yyval.interm.type), *(yyvsp[0].lex).string); } +#line 4503 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 133: -/* Line 1792 of yacc.c */ -#line 1078 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1076 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc); + (yyval.interm.type).init((yyvsp[-2].lex).loc); + parseContext.setLayoutQualifier((yyvsp[-2].lex).loc, (yyval.interm.type), *(yyvsp[-2].lex).string, (yyvsp[0].interm.intermTypedNode)); } +#line 4512 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 134: -/* Line 1792 of yacc.c */ -#line 1084 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" - { - (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type); +#line 1080 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { // because "shared" is both an identifier and a keyword + (yyval.interm.type).init((yyvsp[0].lex).loc); + TString strShared("shared"); + parseContext.setLayoutQualifier((yyvsp[0].lex).loc, (yyval.interm.type), strShared); } +#line 4522 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 135: -/* Line 1792 of yacc.c */ -#line 1087 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1088 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type) = (yyvsp[(1) - (2)].interm.type); - if ((yyval.interm.type).basicType == EbtVoid) - (yyval.interm.type).basicType = (yyvsp[(2) - (2)].interm.type).basicType; - - (yyval.interm.type).shaderQualifiers.merge((yyvsp[(2) - (2)].interm.type).shaderQualifiers); - parseContext.mergeQualifiers((yyval.interm.type).loc, (yyval.interm.type).qualifier, (yyvsp[(2) - (2)].interm.type).qualifier, false); + parseContext.profileRequires((yyval.interm.type).loc, ECoreProfile | ECompatibilityProfile, 400, E_GL_ARB_gpu_shader5, "precise"); + parseContext.profileRequires((yyvsp[0].lex).loc, EEsProfile, 320, Num_AEP_gpu_shader5, AEP_gpu_shader5, "precise"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.noContraction = true; } +#line 4533 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 136: -/* Line 1792 of yacc.c */ -#line 1098 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1097 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type); + (yyval.interm.type) = (yyvsp[0].interm.type); } +#line 4541 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 137: -/* Line 1792 of yacc.c */ -#line 1101 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1100 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type); + (yyval.interm.type) = (yyvsp[-1].interm.type); + if ((yyval.interm.type).basicType == EbtVoid) + (yyval.interm.type).basicType = (yyvsp[0].interm.type).basicType; + + (yyval.interm.type).shaderQualifiers.merge((yyvsp[0].interm.type).shaderQualifiers); + parseContext.mergeQualifiers((yyval.interm.type).loc, (yyval.interm.type).qualifier, (yyvsp[0].interm.type).qualifier, false); } +#line 4554 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 138: -/* Line 1792 of yacc.c */ -#line 1104 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1111 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type); + (yyval.interm.type) = (yyvsp[0].interm.type); } +#line 4562 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 139: -/* Line 1792 of yacc.c */ -#line 1107 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1114 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - // allow inheritance of storage qualifier from block declaration - (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type); + (yyval.interm.type) = (yyvsp[0].interm.type); } +#line 4570 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 140: -/* Line 1792 of yacc.c */ -#line 1111 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1117 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - // allow inheritance of storage qualifier from block declaration - (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type); + (yyval.interm.type) = (yyvsp[0].interm.type); } +#line 4578 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 141: -/* Line 1792 of yacc.c */ -#line 1115 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1120 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { // allow inheritance of storage qualifier from block declaration - (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type); + (yyval.interm.type) = (yyvsp[0].interm.type); } +#line 4587 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 142: -/* Line 1792 of yacc.c */ -#line 1122 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1124 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc); - (yyval.interm.type).qualifier.storage = EvqConst; // will later turn into EvqConstReadOnly, if the initializer is not constant + // allow inheritance of storage qualifier from block declaration + (yyval.interm.type) = (yyvsp[0].interm.type); } +#line 4596 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 143: -/* Line 1792 of yacc.c */ -#line 1126 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1128 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.requireStage((yyvsp[(1) - (1)].lex).loc, EShLangVertex, "attribute"); - parseContext.checkDeprecated((yyvsp[(1) - (1)].lex).loc, ECoreProfile, 130, "attribute"); - parseContext.checkDeprecated((yyvsp[(1) - (1)].lex).loc, ENoProfile, 130, "attribute"); - parseContext.requireNotRemoved((yyvsp[(1) - (1)].lex).loc, ECoreProfile, 420, "attribute"); - parseContext.requireNotRemoved((yyvsp[(1) - (1)].lex).loc, EEsProfile, 300, "attribute"); - - parseContext.globalCheck((yyvsp[(1) - (1)].lex).loc, "attribute"); - - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc); - (yyval.interm.type).qualifier.storage = EvqVaryingIn; + // allow inheritance of storage qualifier from block declaration + (yyval.interm.type) = (yyvsp[0].interm.type); } +#line 4605 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 144: -/* Line 1792 of yacc.c */ -#line 1138 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1135 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.checkDeprecated((yyvsp[(1) - (1)].lex).loc, ENoProfile, 130, "varying"); - parseContext.checkDeprecated((yyvsp[(1) - (1)].lex).loc, ECoreProfile, 130, "varying"); - parseContext.requireNotRemoved((yyvsp[(1) - (1)].lex).loc, ECoreProfile, 420, "varying"); - parseContext.requireNotRemoved((yyvsp[(1) - (1)].lex).loc, EEsProfile, 300, "varying"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.storage = EvqConst; // will later turn into EvqConstReadOnly, if the initializer is not constant + } +#line 4614 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; - parseContext.globalCheck((yyvsp[(1) - (1)].lex).loc, "varying"); + case 145: +#line 1139 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.requireStage((yyvsp[0].lex).loc, EShLangVertex, "attribute"); + parseContext.checkDeprecated((yyvsp[0].lex).loc, ECoreProfile, 130, "attribute"); + parseContext.checkDeprecated((yyvsp[0].lex).loc, ENoProfile, 130, "attribute"); + parseContext.requireNotRemoved((yyvsp[0].lex).loc, ECoreProfile, 420, "attribute"); + parseContext.requireNotRemoved((yyvsp[0].lex).loc, EEsProfile, 300, "attribute"); - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc); + parseContext.globalCheck((yyvsp[0].lex).loc, "attribute"); + + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.storage = EvqVaryingIn; + } +#line 4631 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 146: +#line 1151 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.checkDeprecated((yyvsp[0].lex).loc, ENoProfile, 130, "varying"); + parseContext.checkDeprecated((yyvsp[0].lex).loc, ECoreProfile, 130, "varying"); + parseContext.requireNotRemoved((yyvsp[0].lex).loc, ECoreProfile, 420, "varying"); + parseContext.requireNotRemoved((yyvsp[0].lex).loc, EEsProfile, 300, "varying"); + + parseContext.globalCheck((yyvsp[0].lex).loc, "varying"); + + (yyval.interm.type).init((yyvsp[0].lex).loc); if (parseContext.language == EShLangVertex) (yyval.interm.type).qualifier.storage = EvqVaryingOut; else (yyval.interm.type).qualifier.storage = EvqVaryingIn; } - break; - - case 145: -/* Line 1792 of yacc.c */ -#line 1152 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" - { - parseContext.globalCheck((yyvsp[(1) - (1)].lex).loc, "inout"); - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc); - (yyval.interm.type).qualifier.storage = EvqInOut; - } - break; - - case 146: -/* Line 1792 of yacc.c */ -#line 1157 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" - { - parseContext.globalCheck((yyvsp[(1) - (1)].lex).loc, "in"); - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc); - // whether this is a parameter "in" or a pipeline "in" will get sorted out a bit later - (yyval.interm.type).qualifier.storage = EvqIn; - } +#line 4650 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 147: -/* Line 1792 of yacc.c */ -#line 1163 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1165 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.globalCheck((yyvsp[(1) - (1)].lex).loc, "out"); - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc); - // whether this is a parameter "out" or a pipeline "out" will get sorted out a bit later - (yyval.interm.type).qualifier.storage = EvqOut; + parseContext.globalCheck((yyvsp[0].lex).loc, "inout"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.storage = EvqInOut; } +#line 4660 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 148: -/* Line 1792 of yacc.c */ -#line 1169 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1170 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.profileRequires((yyvsp[(1) - (1)].lex).loc, ENoProfile, 120, 0, "centroid"); - parseContext.profileRequires((yyvsp[(1) - (1)].lex).loc, EEsProfile, 300, 0, "centroid"); - parseContext.globalCheck((yyvsp[(1) - (1)].lex).loc, "centroid"); - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc); - (yyval.interm.type).qualifier.centroid = true; + parseContext.globalCheck((yyvsp[0].lex).loc, "in"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + // whether this is a parameter "in" or a pipeline "in" will get sorted out a bit later + (yyval.interm.type).qualifier.storage = EvqIn; } +#line 4671 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 149: -/* Line 1792 of yacc.c */ -#line 1176 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1176 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.globalCheck((yyvsp[(1) - (1)].lex).loc, "patch"); - parseContext.requireStage((yyvsp[(1) - (1)].lex).loc, (EShLanguageMask)(EShLangTessControlMask | EShLangTessEvaluationMask), "patch"); - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc); - (yyval.interm.type).qualifier.patch = true; + parseContext.globalCheck((yyvsp[0].lex).loc, "out"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + // whether this is a parameter "out" or a pipeline "out" will get sorted out a bit later + (yyval.interm.type).qualifier.storage = EvqOut; } +#line 4682 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 150: -/* Line 1792 of yacc.c */ -#line 1182 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1182 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.globalCheck((yyvsp[(1) - (1)].lex).loc, "sample"); - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc); - (yyval.interm.type).qualifier.sample = true; + parseContext.profileRequires((yyvsp[0].lex).loc, ENoProfile, 120, 0, "centroid"); + parseContext.profileRequires((yyvsp[0].lex).loc, EEsProfile, 300, 0, "centroid"); + parseContext.globalCheck((yyvsp[0].lex).loc, "centroid"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.centroid = true; } +#line 4694 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 151: -/* Line 1792 of yacc.c */ -#line 1187 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1189 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.globalCheck((yyvsp[(1) - (1)].lex).loc, "uniform"); - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc); - (yyval.interm.type).qualifier.storage = EvqUniform; + parseContext.globalCheck((yyvsp[0].lex).loc, "patch"); + parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangTessControlMask | EShLangTessEvaluationMask), "patch"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.patch = true; } +#line 4705 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 152: -/* Line 1792 of yacc.c */ -#line 1192 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1195 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.globalCheck((yyvsp[(1) - (1)].lex).loc, "buffer"); - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc); - (yyval.interm.type).qualifier.storage = EvqBuffer; + parseContext.globalCheck((yyvsp[0].lex).loc, "sample"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.sample = true; } +#line 4715 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 153: -/* Line 1792 of yacc.c */ -#line 1197 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1200 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.profileRequires((yyvsp[(1) - (1)].lex).loc, ECoreProfile | ECompatibilityProfile, 430, 0, "shared"); - parseContext.profileRequires((yyvsp[(1) - (1)].lex).loc, EEsProfile, 310, 0, "shared"); - parseContext.requireStage((yyvsp[(1) - (1)].lex).loc, EShLangCompute, "shared"); - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc); - (yyval.interm.type).qualifier.storage = EvqShared; + parseContext.globalCheck((yyvsp[0].lex).loc, "uniform"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.storage = EvqUniform; } +#line 4725 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 154: -/* Line 1792 of yacc.c */ -#line 1204 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1205 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc); - (yyval.interm.type).qualifier.coherent = true; + parseContext.globalCheck((yyvsp[0].lex).loc, "buffer"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.storage = EvqBuffer; } +#line 4735 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 155: -/* Line 1792 of yacc.c */ -#line 1208 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1210 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc); - (yyval.interm.type).qualifier.volatil = true; + parseContext.profileRequires((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, 430, E_GL_ARB_compute_shader, "shared"); + parseContext.profileRequires((yyvsp[0].lex).loc, EEsProfile, 310, 0, "shared"); + parseContext.requireStage((yyvsp[0].lex).loc, EShLangCompute, "shared"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.storage = EvqShared; } +#line 4747 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 156: -/* Line 1792 of yacc.c */ -#line 1212 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1217 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc); - (yyval.interm.type).qualifier.restrict = true; + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.coherent = true; } +#line 4756 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 157: -/* Line 1792 of yacc.c */ -#line 1216 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1221 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc); - (yyval.interm.type).qualifier.readonly = true; + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.volatil = true; } +#line 4765 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 158: -/* Line 1792 of yacc.c */ -#line 1220 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1225 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc); - (yyval.interm.type).qualifier.writeonly = true; + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.restrict = true; } +#line 4774 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 159: -/* Line 1792 of yacc.c */ -#line 1224 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1229 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.spvRemoved((yyvsp[(1) - (1)].lex).loc, "subroutine"); - parseContext.globalCheck((yyvsp[(1) - (1)].lex).loc, "subroutine"); - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc); - (yyval.interm.type).qualifier.storage = EvqUniform; + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.readonly = true; } +#line 4783 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 160: -/* Line 1792 of yacc.c */ -#line 1230 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1233 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.spvRemoved((yyvsp[(1) - (4)].lex).loc, "subroutine"); - parseContext.globalCheck((yyvsp[(1) - (4)].lex).loc, "subroutine"); - (yyval.interm.type).init((yyvsp[(1) - (4)].lex).loc); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.writeonly = true; + } +#line 4792 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 161: +#line 1237 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.spvRemoved((yyvsp[0].lex).loc, "subroutine"); + parseContext.globalCheck((yyvsp[0].lex).loc, "subroutine"); + (yyval.interm.type).init((yyvsp[0].lex).loc); + (yyval.interm.type).qualifier.storage = EvqUniform; + } +#line 4803 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 162: +#line 1243 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.spvRemoved((yyvsp[-3].lex).loc, "subroutine"); + parseContext.globalCheck((yyvsp[-3].lex).loc, "subroutine"); + (yyval.interm.type).init((yyvsp[-3].lex).loc); (yyval.interm.type).qualifier.storage = EvqUniform; // TODO: 4.0 semantics: subroutines // 1) make sure each identifier is a type declared earlier with SUBROUTINE // 2) save all of the identifiers for future comparison with the declared function } - break; - - case 161: -/* Line 1792 of yacc.c */ -#line 1242 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" - { - // TODO: 4.0 functionality: subroutine type to list - } - break; - - case 162: -/* Line 1792 of yacc.c */ -#line 1245 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" - { - } +#line 4817 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 163: -/* Line 1792 of yacc.c */ -#line 1250 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1255 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type); - (yyval.interm.type).qualifier.precision = parseContext.getDefaultPrecision((yyval.interm.type)); + // TODO: 4.0 functionality: subroutine type to list } +#line 4825 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 164: -/* Line 1792 of yacc.c */ -#line 1254 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1258 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.arrayDimCheck((yyvsp[(2) - (2)].interm).loc, (yyvsp[(2) - (2)].interm).arraySizes, 0); - (yyval.interm.type) = (yyvsp[(1) - (2)].interm.type); - (yyval.interm.type).qualifier.precision = parseContext.getDefaultPrecision((yyval.interm.type)); - (yyval.interm.type).arraySizes = (yyvsp[(2) - (2)].interm).arraySizes; } +#line 4832 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 165: -/* Line 1792 of yacc.c */ -#line 1263 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1263 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm).loc = (yyvsp[(1) - (2)].lex).loc; - (yyval.interm).arraySizes = new TArraySizes; - (yyval.interm).arraySizes->addInnerSize(); + (yyval.interm.type) = (yyvsp[0].interm.type); + (yyval.interm.type).qualifier.precision = parseContext.getDefaultPrecision((yyval.interm.type)); } +#line 4841 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 166: -/* Line 1792 of yacc.c */ -#line 1268 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1267 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm).loc = (yyvsp[(1) - (3)].lex).loc; - (yyval.interm).arraySizes = new TArraySizes; - - TArraySize size; - parseContext.arraySizeCheck((yyvsp[(2) - (3)].interm.intermTypedNode)->getLoc(), (yyvsp[(2) - (3)].interm.intermTypedNode), size); - (yyval.interm).arraySizes->addInnerSize(size); + parseContext.arrayDimCheck((yyvsp[0].interm).loc, (yyvsp[0].interm).arraySizes, 0); + (yyval.interm.type) = (yyvsp[-1].interm.type); + (yyval.interm.type).qualifier.precision = parseContext.getDefaultPrecision((yyval.interm.type)); + (yyval.interm.type).arraySizes = (yyvsp[0].interm).arraySizes; } +#line 4852 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 167: -/* Line 1792 of yacc.c */ -#line 1276 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1276 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm) = (yyvsp[(1) - (3)].interm); + (yyval.interm).loc = (yyvsp[-1].lex).loc; + (yyval.interm).arraySizes = new TArraySizes; (yyval.interm).arraySizes->addInnerSize(); } +#line 4862 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 168: -/* Line 1792 of yacc.c */ -#line 1280 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1281 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm) = (yyvsp[(1) - (4)].interm); + (yyval.interm).loc = (yyvsp[-2].lex).loc; + (yyval.interm).arraySizes = new TArraySizes; TArraySize size; - parseContext.arraySizeCheck((yyvsp[(3) - (4)].interm.intermTypedNode)->getLoc(), (yyvsp[(3) - (4)].interm.intermTypedNode), size); + parseContext.arraySizeCheck((yyvsp[-1].interm.intermTypedNode)->getLoc(), (yyvsp[-1].interm.intermTypedNode), size); (yyval.interm).arraySizes->addInnerSize(size); } +#line 4875 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 169: -/* Line 1792 of yacc.c */ -#line 1290 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1289 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtVoid; + (yyval.interm) = (yyvsp[-2].interm); + (yyval.interm).arraySizes->addInnerSize(); } +#line 4884 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 170: -/* Line 1792 of yacc.c */ -#line 1294 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1293 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat; + (yyval.interm) = (yyvsp[-3].interm); + + TArraySize size; + parseContext.arraySizeCheck((yyvsp[-1].interm.intermTypedNode)->getLoc(), (yyvsp[-1].interm.intermTypedNode), size); + (yyval.interm).arraySizes->addInnerSize(size); } +#line 4896 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 171: -/* Line 1792 of yacc.c */ -#line 1298 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1303 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.doubleCheck((yyvsp[(1) - (1)].lex).loc, "double"); - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtVoid; } +#line 4905 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 172: -/* Line 1792 of yacc.c */ -#line 1303 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1307 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtInt; + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; } +#line 4914 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 173: -/* Line 1792 of yacc.c */ -#line 1307 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1311 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.fullIntegerCheck((yyvsp[(1) - (1)].lex).loc, "unsigned integer"); - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtUint; + parseContext.doubleCheck((yyvsp[0].lex).loc, "double"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; } +#line 4924 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 174: -/* Line 1792 of yacc.c */ -#line 1312 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1316 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtBool; + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt; } +#line 4933 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 175: -/* Line 1792 of yacc.c */ -#line 1316 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1320 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat; - (yyval.interm.type).setVector(2); + parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "unsigned integer"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtUint; } +#line 4943 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 176: -/* Line 1792 of yacc.c */ -#line 1321 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1325 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat; - (yyval.interm.type).setVector(3); + parseContext.int64Check((yyvsp[0].lex).loc, "64-bit integer", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt64; } +#line 4953 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 177: -/* Line 1792 of yacc.c */ -#line 1326 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1330 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat; - (yyval.interm.type).setVector(4); + parseContext.int64Check((yyvsp[0].lex).loc, "64-bit unsigned integer", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtUint64; } +#line 4963 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 178: -/* Line 1792 of yacc.c */ -#line 1331 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1335 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.doubleCheck((yyvsp[(1) - (1)].lex).loc, "double vector"); - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtDouble; - (yyval.interm.type).setVector(2); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtBool; } +#line 4972 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 179: -/* Line 1792 of yacc.c */ -#line 1337 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1339 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.doubleCheck((yyvsp[(1) - (1)].lex).loc, "double vector"); - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtDouble; - (yyval.interm.type).setVector(3); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setVector(2); } +#line 4982 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 180: -/* Line 1792 of yacc.c */ -#line 1343 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1344 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.doubleCheck((yyvsp[(1) - (1)].lex).loc, "double vector"); - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtDouble; - (yyval.interm.type).setVector(4); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setVector(3); } +#line 4992 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 181: -/* Line 1792 of yacc.c */ -#line 1349 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1349 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtBool; - (yyval.interm.type).setVector(2); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setVector(4); } +#line 5002 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 182: -/* Line 1792 of yacc.c */ -#line 1354 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1354 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtBool; - (yyval.interm.type).setVector(3); + parseContext.doubleCheck((yyvsp[0].lex).loc, "double vector"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setVector(2); } +#line 5013 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 183: -/* Line 1792 of yacc.c */ -#line 1359 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1360 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtBool; - (yyval.interm.type).setVector(4); + parseContext.doubleCheck((yyvsp[0].lex).loc, "double vector"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setVector(3); } +#line 5024 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 184: -/* Line 1792 of yacc.c */ -#line 1364 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1366 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtInt; - (yyval.interm.type).setVector(2); + parseContext.doubleCheck((yyvsp[0].lex).loc, "double vector"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setVector(4); } +#line 5035 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 185: -/* Line 1792 of yacc.c */ -#line 1369 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1372 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtInt; - (yyval.interm.type).setVector(3); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtBool; + (yyval.interm.type).setVector(2); } +#line 5045 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 186: -/* Line 1792 of yacc.c */ -#line 1374 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1377 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtInt; - (yyval.interm.type).setVector(4); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtBool; + (yyval.interm.type).setVector(3); } +#line 5055 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 187: -/* Line 1792 of yacc.c */ -#line 1379 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1382 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.fullIntegerCheck((yyvsp[(1) - (1)].lex).loc, "unsigned integer vector"); - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtUint; - (yyval.interm.type).setVector(2); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtBool; + (yyval.interm.type).setVector(4); } +#line 5065 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 188: -/* Line 1792 of yacc.c */ -#line 1385 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1387 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.fullIntegerCheck((yyvsp[(1) - (1)].lex).loc, "unsigned integer vector"); - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtUint; - (yyval.interm.type).setVector(3); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt; + (yyval.interm.type).setVector(2); } +#line 5075 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 189: -/* Line 1792 of yacc.c */ -#line 1391 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1392 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.fullIntegerCheck((yyvsp[(1) - (1)].lex).loc, "unsigned integer vector"); - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtUint; - (yyval.interm.type).setVector(4); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt; + (yyval.interm.type).setVector(3); } +#line 5085 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 190: -/* Line 1792 of yacc.c */ -#line 1397 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1397 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat; - (yyval.interm.type).setMatrix(2, 2); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt; + (yyval.interm.type).setVector(4); } +#line 5095 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 191: -/* Line 1792 of yacc.c */ -#line 1402 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1402 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat; - (yyval.interm.type).setMatrix(3, 3); + parseContext.int64Check((yyvsp[0].lex).loc, "64-bit integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt64; + (yyval.interm.type).setVector(2); } +#line 5106 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 192: -/* Line 1792 of yacc.c */ -#line 1407 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1408 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat; - (yyval.interm.type).setMatrix(4, 4); + parseContext.int64Check((yyvsp[0].lex).loc, "64-bit integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt64; + (yyval.interm.type).setVector(3); } +#line 5117 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 193: -/* Line 1792 of yacc.c */ -#line 1412 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1414 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat; - (yyval.interm.type).setMatrix(2, 2); + parseContext.int64Check((yyvsp[0].lex).loc, "64-bit integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtInt64; + (yyval.interm.type).setVector(4); } +#line 5128 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 194: -/* Line 1792 of yacc.c */ -#line 1417 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1420 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat; - (yyval.interm.type).setMatrix(2, 3); + parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "unsigned integer vector"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtUint; + (yyval.interm.type).setVector(2); } +#line 5139 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 195: -/* Line 1792 of yacc.c */ -#line 1422 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1426 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat; - (yyval.interm.type).setMatrix(2, 4); + parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "unsigned integer vector"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtUint; + (yyval.interm.type).setVector(3); } +#line 5150 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 196: -/* Line 1792 of yacc.c */ -#line 1427 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1432 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat; - (yyval.interm.type).setMatrix(3, 2); + parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "unsigned integer vector"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtUint; + (yyval.interm.type).setVector(4); } +#line 5161 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 197: -/* Line 1792 of yacc.c */ -#line 1432 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1438 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat; - (yyval.interm.type).setMatrix(3, 3); + parseContext.int64Check((yyvsp[0].lex).loc, "64-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtUint64; + (yyval.interm.type).setVector(2); } +#line 5172 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 198: -/* Line 1792 of yacc.c */ -#line 1437 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1444 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat; - (yyval.interm.type).setMatrix(3, 4); + parseContext.int64Check((yyvsp[0].lex).loc, "64-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtUint64; + (yyval.interm.type).setVector(3); } +#line 5183 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 199: -/* Line 1792 of yacc.c */ -#line 1442 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1450 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtFloat; - (yyval.interm.type).setMatrix(4, 2); + parseContext.int64Check((yyvsp[0].lex).loc, "64-bit unsigned integer vector", parseContext.symbolTable.atBuiltInLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtUint64; + (yyval.interm.type).setVector(4); } +#line 5194 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 200: -/* Line 1792 of yacc.c */ -#line 1447 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1456 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; - (yyval.interm.type).setMatrix(4, 3); + (yyval.interm.type).setMatrix(2, 2); } +#line 5204 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 201: -/* Line 1792 of yacc.c */ -#line 1452 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1461 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtFloat; - (yyval.interm.type).setMatrix(4, 4); + (yyval.interm.type).setMatrix(3, 3); } +#line 5214 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 202: -/* Line 1792 of yacc.c */ -#line 1457 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1466 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.doubleCheck((yyvsp[(1) - (1)].lex).loc, "double matrix"); - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtDouble; - (yyval.interm.type).setMatrix(2, 2); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setMatrix(4, 4); } +#line 5224 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 203: -/* Line 1792 of yacc.c */ -#line 1463 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1471 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.doubleCheck((yyvsp[(1) - (1)].lex).loc, "double matrix"); - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtDouble; - (yyval.interm.type).setMatrix(3, 3); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setMatrix(2, 2); } +#line 5234 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 204: -/* Line 1792 of yacc.c */ -#line 1469 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1476 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.doubleCheck((yyvsp[(1) - (1)].lex).loc, "double matrix"); - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtDouble; - (yyval.interm.type).setMatrix(4, 4); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setMatrix(2, 3); } +#line 5244 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 205: -/* Line 1792 of yacc.c */ -#line 1475 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1481 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.doubleCheck((yyvsp[(1) - (1)].lex).loc, "double matrix"); - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtDouble; - (yyval.interm.type).setMatrix(2, 2); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setMatrix(2, 4); } +#line 5254 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 206: -/* Line 1792 of yacc.c */ -#line 1481 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1486 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.doubleCheck((yyvsp[(1) - (1)].lex).loc, "double matrix"); - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtDouble; - (yyval.interm.type).setMatrix(2, 3); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setMatrix(3, 2); } +#line 5264 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 207: -/* Line 1792 of yacc.c */ -#line 1487 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1491 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.doubleCheck((yyvsp[(1) - (1)].lex).loc, "double matrix"); - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtDouble; - (yyval.interm.type).setMatrix(2, 4); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setMatrix(3, 3); } +#line 5274 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 208: -/* Line 1792 of yacc.c */ -#line 1493 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1496 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.doubleCheck((yyvsp[(1) - (1)].lex).loc, "double matrix"); - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtDouble; - (yyval.interm.type).setMatrix(3, 2); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setMatrix(3, 4); } +#line 5284 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 209: -/* Line 1792 of yacc.c */ -#line 1499 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1501 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.doubleCheck((yyvsp[(1) - (1)].lex).loc, "double matrix"); - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtDouble; - (yyval.interm.type).setMatrix(3, 3); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setMatrix(4, 2); } +#line 5294 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 210: -/* Line 1792 of yacc.c */ -#line 1505 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1506 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.doubleCheck((yyvsp[(1) - (1)].lex).loc, "double matrix"); - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtDouble; - (yyval.interm.type).setMatrix(3, 4); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setMatrix(4, 3); } +#line 5304 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 211: -/* Line 1792 of yacc.c */ -#line 1511 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1511 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.doubleCheck((yyvsp[(1) - (1)].lex).loc, "double matrix"); - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtDouble; - (yyval.interm.type).setMatrix(4, 2); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtFloat; + (yyval.interm.type).setMatrix(4, 4); } +#line 5314 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 212: -/* Line 1792 of yacc.c */ -#line 1517 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1516 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.doubleCheck((yyvsp[(1) - (1)].lex).loc, "double matrix"); - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; - (yyval.interm.type).setMatrix(4, 3); + (yyval.interm.type).setMatrix(2, 2); } +#line 5325 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 213: -/* Line 1792 of yacc.c */ -#line 1523 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1522 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.doubleCheck((yyvsp[(1) - (1)].lex).loc, "double matrix"); - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtDouble; - (yyval.interm.type).setMatrix(4, 4); + (yyval.interm.type).setMatrix(3, 3); } +#line 5336 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 214: -/* Line 1792 of yacc.c */ -#line 1529 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1528 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.vulkanRemoved((yyvsp[(1) - (1)].lex).loc, "atomic counter types"); - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtAtomicUint; + parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setMatrix(4, 4); } +#line 5347 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 215: -/* Line 1792 of yacc.c */ -#line 1534 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1534 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtFloat, Esd1D); + parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setMatrix(2, 2); } +#line 5358 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 216: -/* Line 1792 of yacc.c */ -#line 1539 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1540 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtFloat, Esd2D); + parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setMatrix(2, 3); } +#line 5369 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 217: -/* Line 1792 of yacc.c */ -#line 1544 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1546 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtFloat, Esd3D); + parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setMatrix(2, 4); } +#line 5380 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 218: -/* Line 1792 of yacc.c */ -#line 1549 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1552 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtFloat, EsdCube); + parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setMatrix(3, 2); } +#line 5391 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 219: -/* Line 1792 of yacc.c */ -#line 1554 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1558 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtFloat, Esd1D, false, true); + parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setMatrix(3, 3); } +#line 5402 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 220: -/* Line 1792 of yacc.c */ -#line 1559 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1564 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtFloat, Esd2D, false, true); + parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setMatrix(3, 4); } +#line 5413 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 221: -/* Line 1792 of yacc.c */ -#line 1564 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1570 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtFloat, EsdCube, false, true); + parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setMatrix(4, 2); } +#line 5424 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 222: -/* Line 1792 of yacc.c */ -#line 1569 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1576 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtFloat, Esd1D, true); + parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setMatrix(4, 3); } +#line 5435 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 223: -/* Line 1792 of yacc.c */ -#line 1574 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1582 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtFloat, Esd2D, true); + parseContext.doubleCheck((yyvsp[0].lex).loc, "double matrix"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtDouble; + (yyval.interm.type).setMatrix(4, 4); } +#line 5446 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 224: -/* Line 1792 of yacc.c */ -#line 1579 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1588 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); - (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtFloat, Esd1D, true, true); + parseContext.vulkanRemoved((yyvsp[0].lex).loc, "atomic counter types"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtAtomicUint; } +#line 5456 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 225: -/* Line 1792 of yacc.c */ -#line 1584 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1593 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtFloat, Esd2D, true, true); + (yyval.interm.type).sampler.set(EbtFloat, Esd1D); } +#line 5466 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 226: -/* Line 1792 of yacc.c */ -#line 1589 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1598 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtFloat, EsdCube, true); + (yyval.interm.type).sampler.set(EbtFloat, Esd2D); } +#line 5476 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 227: -/* Line 1792 of yacc.c */ -#line 1594 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1603 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtFloat, EsdCube, true, true); + (yyval.interm.type).sampler.set(EbtFloat, Esd3D); } +#line 5486 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 228: -/* Line 1792 of yacc.c */ -#line 1599 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1608 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtInt, Esd1D); + (yyval.interm.type).sampler.set(EbtFloat, EsdCube); } +#line 5496 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 229: -/* Line 1792 of yacc.c */ -#line 1604 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1613 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtInt, Esd2D); + (yyval.interm.type).sampler.set(EbtFloat, Esd1D, false, true); } +#line 5506 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 230: -/* Line 1792 of yacc.c */ -#line 1609 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1618 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtInt, Esd3D); + (yyval.interm.type).sampler.set(EbtFloat, Esd2D, false, true); } +#line 5516 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 231: -/* Line 1792 of yacc.c */ -#line 1614 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1623 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtInt, EsdCube); + (yyval.interm.type).sampler.set(EbtFloat, EsdCube, false, true); } +#line 5526 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 232: -/* Line 1792 of yacc.c */ -#line 1619 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1628 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtInt, Esd1D, true); + (yyval.interm.type).sampler.set(EbtFloat, Esd1D, true); } +#line 5536 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 233: -/* Line 1792 of yacc.c */ -#line 1624 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1633 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtInt, Esd2D, true); + (yyval.interm.type).sampler.set(EbtFloat, Esd2D, true); } +#line 5546 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 234: -/* Line 1792 of yacc.c */ -#line 1629 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1638 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtInt, EsdCube, true); + (yyval.interm.type).sampler.set(EbtFloat, Esd1D, true, true); } +#line 5556 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 235: -/* Line 1792 of yacc.c */ -#line 1634 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1643 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtUint, Esd1D); + (yyval.interm.type).sampler.set(EbtFloat, Esd2D, true, true); } +#line 5566 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 236: -/* Line 1792 of yacc.c */ -#line 1639 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1648 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtUint, Esd2D); + (yyval.interm.type).sampler.set(EbtFloat, EsdCube, true); } +#line 5576 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 237: -/* Line 1792 of yacc.c */ -#line 1644 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1653 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtUint, Esd3D); + (yyval.interm.type).sampler.set(EbtFloat, EsdCube, true, true); } +#line 5586 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 238: -/* Line 1792 of yacc.c */ -#line 1649 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1658 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtUint, EsdCube); + (yyval.interm.type).sampler.set(EbtInt, Esd1D); } +#line 5596 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 239: -/* Line 1792 of yacc.c */ -#line 1654 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1663 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtUint, Esd1D, true); + (yyval.interm.type).sampler.set(EbtInt, Esd2D); } +#line 5606 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 240: -/* Line 1792 of yacc.c */ -#line 1659 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1668 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtUint, Esd2D, true); + (yyval.interm.type).sampler.set(EbtInt, Esd3D); } +#line 5616 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 241: -/* Line 1792 of yacc.c */ -#line 1664 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1673 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtUint, EsdCube, true); + (yyval.interm.type).sampler.set(EbtInt, EsdCube); } +#line 5626 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 242: -/* Line 1792 of yacc.c */ -#line 1669 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1678 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtFloat, EsdRect); + (yyval.interm.type).sampler.set(EbtInt, Esd1D, true); } +#line 5636 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 243: -/* Line 1792 of yacc.c */ -#line 1674 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1683 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtFloat, EsdRect, false, true); + (yyval.interm.type).sampler.set(EbtInt, Esd2D, true); } +#line 5646 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 244: -/* Line 1792 of yacc.c */ -#line 1679 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1688 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtInt, EsdRect); + (yyval.interm.type).sampler.set(EbtInt, EsdCube, true); } +#line 5656 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 245: -/* Line 1792 of yacc.c */ -#line 1684 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1693 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtUint, EsdRect); + (yyval.interm.type).sampler.set(EbtUint, Esd1D); } +#line 5666 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 246: -/* Line 1792 of yacc.c */ -#line 1689 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1698 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtFloat, EsdBuffer); + (yyval.interm.type).sampler.set(EbtUint, Esd2D); } +#line 5676 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 247: -/* Line 1792 of yacc.c */ -#line 1694 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1703 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtInt, EsdBuffer); + (yyval.interm.type).sampler.set(EbtUint, Esd3D); } +#line 5686 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 248: -/* Line 1792 of yacc.c */ -#line 1699 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1708 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtUint, EsdBuffer); + (yyval.interm.type).sampler.set(EbtUint, EsdCube); } +#line 5696 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 249: -/* Line 1792 of yacc.c */ -#line 1704 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1713 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtFloat, Esd2D, false, false, true); + (yyval.interm.type).sampler.set(EbtUint, Esd1D, true); } +#line 5706 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 250: -/* Line 1792 of yacc.c */ -#line 1709 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1718 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtInt, Esd2D, false, false, true); + (yyval.interm.type).sampler.set(EbtUint, Esd2D, true); } +#line 5716 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 251: -/* Line 1792 of yacc.c */ -#line 1714 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1723 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtUint, Esd2D, false, false, true); + (yyval.interm.type).sampler.set(EbtUint, EsdCube, true); } +#line 5726 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 252: -/* Line 1792 of yacc.c */ -#line 1719 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1728 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtFloat, Esd2D, true, false, true); + (yyval.interm.type).sampler.set(EbtFloat, EsdRect); } +#line 5736 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 253: -/* Line 1792 of yacc.c */ -#line 1724 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1733 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtInt, Esd2D, true, false, true); + (yyval.interm.type).sampler.set(EbtFloat, EsdRect, false, true); } +#line 5746 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 254: -/* Line 1792 of yacc.c */ -#line 1729 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1738 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.set(EbtUint, Esd2D, true, false, true); + (yyval.interm.type).sampler.set(EbtInt, EsdRect); } +#line 5756 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 255: -/* Line 1792 of yacc.c */ -#line 1734 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1743 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setPureSampler(false); + (yyval.interm.type).sampler.set(EbtUint, EsdRect); } +#line 5766 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 256: -/* Line 1792 of yacc.c */ -#line 1739 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1748 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setPureSampler(true); + (yyval.interm.type).sampler.set(EbtFloat, EsdBuffer); } +#line 5776 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 257: -/* Line 1792 of yacc.c */ -#line 1744 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1753 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setTexture(EbtFloat, Esd1D); + (yyval.interm.type).sampler.set(EbtInt, EsdBuffer); } +#line 5786 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 258: -/* Line 1792 of yacc.c */ -#line 1749 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1758 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setTexture(EbtFloat, Esd2D); + (yyval.interm.type).sampler.set(EbtUint, EsdBuffer); } +#line 5796 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 259: -/* Line 1792 of yacc.c */ -#line 1754 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1763 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setTexture(EbtFloat, Esd3D); + (yyval.interm.type).sampler.set(EbtFloat, Esd2D, false, false, true); } +#line 5806 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 260: -/* Line 1792 of yacc.c */ -#line 1759 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1768 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setTexture(EbtFloat, EsdCube); + (yyval.interm.type).sampler.set(EbtInt, Esd2D, false, false, true); } +#line 5816 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 261: -/* Line 1792 of yacc.c */ -#line 1764 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1773 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setTexture(EbtFloat, Esd1D, true); + (yyval.interm.type).sampler.set(EbtUint, Esd2D, false, false, true); } +#line 5826 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 262: -/* Line 1792 of yacc.c */ -#line 1769 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1778 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setTexture(EbtFloat, Esd2D, true); + (yyval.interm.type).sampler.set(EbtFloat, Esd2D, true, false, true); } +#line 5836 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 263: -/* Line 1792 of yacc.c */ -#line 1774 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1783 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setTexture(EbtFloat, EsdCube, true); + (yyval.interm.type).sampler.set(EbtInt, Esd2D, true, false, true); } +#line 5846 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 264: -/* Line 1792 of yacc.c */ -#line 1779 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1788 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setTexture(EbtInt, Esd1D); + (yyval.interm.type).sampler.set(EbtUint, Esd2D, true, false, true); } +#line 5856 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 265: -/* Line 1792 of yacc.c */ -#line 1784 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1793 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setTexture(EbtInt, Esd2D); + (yyval.interm.type).sampler.setPureSampler(false); } +#line 5866 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 266: -/* Line 1792 of yacc.c */ -#line 1789 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1798 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setTexture(EbtInt, Esd3D); + (yyval.interm.type).sampler.setPureSampler(true); } +#line 5876 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 267: -/* Line 1792 of yacc.c */ -#line 1794 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1803 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setTexture(EbtInt, EsdCube); + (yyval.interm.type).sampler.setTexture(EbtFloat, Esd1D); } +#line 5886 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 268: -/* Line 1792 of yacc.c */ -#line 1799 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1808 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setTexture(EbtInt, Esd1D, true); + (yyval.interm.type).sampler.setTexture(EbtFloat, Esd2D); } +#line 5896 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 269: -/* Line 1792 of yacc.c */ -#line 1804 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1813 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setTexture(EbtInt, Esd2D, true); + (yyval.interm.type).sampler.setTexture(EbtFloat, Esd3D); } +#line 5906 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 270: -/* Line 1792 of yacc.c */ -#line 1809 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1818 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setTexture(EbtInt, EsdCube, true); + (yyval.interm.type).sampler.setTexture(EbtFloat, EsdCube); } +#line 5916 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 271: -/* Line 1792 of yacc.c */ -#line 1814 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1823 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setTexture(EbtUint, Esd1D); + (yyval.interm.type).sampler.setTexture(EbtFloat, Esd1D, true); } +#line 5926 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 272: -/* Line 1792 of yacc.c */ -#line 1819 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1828 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setTexture(EbtUint, Esd2D); + (yyval.interm.type).sampler.setTexture(EbtFloat, Esd2D, true); } +#line 5936 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 273: -/* Line 1792 of yacc.c */ -#line 1824 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1833 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setTexture(EbtUint, Esd3D); + (yyval.interm.type).sampler.setTexture(EbtFloat, EsdCube, true); } +#line 5946 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 274: -/* Line 1792 of yacc.c */ -#line 1829 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1838 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setTexture(EbtUint, EsdCube); + (yyval.interm.type).sampler.setTexture(EbtInt, Esd1D); } +#line 5956 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 275: -/* Line 1792 of yacc.c */ -#line 1834 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1843 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setTexture(EbtUint, Esd1D, true); + (yyval.interm.type).sampler.setTexture(EbtInt, Esd2D); } +#line 5966 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 276: -/* Line 1792 of yacc.c */ -#line 1839 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1848 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setTexture(EbtUint, Esd2D, true); + (yyval.interm.type).sampler.setTexture(EbtInt, Esd3D); } +#line 5976 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 277: -/* Line 1792 of yacc.c */ -#line 1844 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1853 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setTexture(EbtUint, EsdCube, true); + (yyval.interm.type).sampler.setTexture(EbtInt, EsdCube); } +#line 5986 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 278: -/* Line 1792 of yacc.c */ -#line 1849 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1858 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setTexture(EbtFloat, EsdRect); + (yyval.interm.type).sampler.setTexture(EbtInt, Esd1D, true); } +#line 5996 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 279: -/* Line 1792 of yacc.c */ -#line 1854 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1863 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setTexture(EbtInt, EsdRect); + (yyval.interm.type).sampler.setTexture(EbtInt, Esd2D, true); } +#line 6006 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 280: -/* Line 1792 of yacc.c */ -#line 1859 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1868 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setTexture(EbtUint, EsdRect); + (yyval.interm.type).sampler.setTexture(EbtInt, EsdCube, true); } +#line 6016 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 281: -/* Line 1792 of yacc.c */ -#line 1864 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1873 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setTexture(EbtFloat, EsdBuffer); + (yyval.interm.type).sampler.setTexture(EbtUint, Esd1D); } +#line 6026 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 282: -/* Line 1792 of yacc.c */ -#line 1869 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1878 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setTexture(EbtInt, EsdBuffer); + (yyval.interm.type).sampler.setTexture(EbtUint, Esd2D); } +#line 6036 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 283: -/* Line 1792 of yacc.c */ -#line 1874 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1883 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setTexture(EbtUint, EsdBuffer); + (yyval.interm.type).sampler.setTexture(EbtUint, Esd3D); } +#line 6046 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 284: -/* Line 1792 of yacc.c */ -#line 1879 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1888 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setTexture(EbtFloat, Esd2D, false, false, true); + (yyval.interm.type).sampler.setTexture(EbtUint, EsdCube); } +#line 6056 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 285: -/* Line 1792 of yacc.c */ -#line 1884 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1893 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setTexture(EbtInt, Esd2D, false, false, true); + (yyval.interm.type).sampler.setTexture(EbtUint, Esd1D, true); } +#line 6066 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 286: -/* Line 1792 of yacc.c */ -#line 1889 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1898 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setTexture(EbtUint, Esd2D, false, false, true); + (yyval.interm.type).sampler.setTexture(EbtUint, Esd2D, true); } +#line 6076 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 287: -/* Line 1792 of yacc.c */ -#line 1894 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1903 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setTexture(EbtFloat, Esd2D, true, false, true); + (yyval.interm.type).sampler.setTexture(EbtUint, EsdCube, true); } +#line 6086 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 288: -/* Line 1792 of yacc.c */ -#line 1899 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1908 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setTexture(EbtInt, Esd2D, true, false, true); + (yyval.interm.type).sampler.setTexture(EbtFloat, EsdRect); } +#line 6096 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 289: -/* Line 1792 of yacc.c */ -#line 1904 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1913 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setTexture(EbtUint, Esd2D, true, false, true); + (yyval.interm.type).sampler.setTexture(EbtInt, EsdRect); } +#line 6106 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 290: -/* Line 1792 of yacc.c */ -#line 1909 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1918 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setImage(EbtFloat, Esd1D); + (yyval.interm.type).sampler.setTexture(EbtUint, EsdRect); } +#line 6116 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 291: -/* Line 1792 of yacc.c */ -#line 1914 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1923 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setImage(EbtInt, Esd1D); + (yyval.interm.type).sampler.setTexture(EbtFloat, EsdBuffer); } +#line 6126 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 292: -/* Line 1792 of yacc.c */ -#line 1919 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1928 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setImage(EbtUint, Esd1D); + (yyval.interm.type).sampler.setTexture(EbtInt, EsdBuffer); } +#line 6136 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 293: -/* Line 1792 of yacc.c */ -#line 1924 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1933 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setImage(EbtFloat, Esd2D); + (yyval.interm.type).sampler.setTexture(EbtUint, EsdBuffer); } +#line 6146 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 294: -/* Line 1792 of yacc.c */ -#line 1929 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1938 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setImage(EbtInt, Esd2D); + (yyval.interm.type).sampler.setTexture(EbtFloat, Esd2D, false, false, true); } +#line 6156 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 295: -/* Line 1792 of yacc.c */ -#line 1934 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1943 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setImage(EbtUint, Esd2D); + (yyval.interm.type).sampler.setTexture(EbtInt, Esd2D, false, false, true); } +#line 6166 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 296: -/* Line 1792 of yacc.c */ -#line 1939 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1948 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setImage(EbtFloat, Esd3D); + (yyval.interm.type).sampler.setTexture(EbtUint, Esd2D, false, false, true); } +#line 6176 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 297: -/* Line 1792 of yacc.c */ -#line 1944 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1953 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setImage(EbtInt, Esd3D); + (yyval.interm.type).sampler.setTexture(EbtFloat, Esd2D, true, false, true); } +#line 6186 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 298: -/* Line 1792 of yacc.c */ -#line 1949 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1958 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setImage(EbtUint, Esd3D); + (yyval.interm.type).sampler.setTexture(EbtInt, Esd2D, true, false, true); } +#line 6196 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 299: -/* Line 1792 of yacc.c */ -#line 1954 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1963 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setImage(EbtFloat, EsdRect); + (yyval.interm.type).sampler.setTexture(EbtUint, Esd2D, true, false, true); } +#line 6206 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 300: -/* Line 1792 of yacc.c */ -#line 1959 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1968 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setImage(EbtInt, EsdRect); + (yyval.interm.type).sampler.setImage(EbtFloat, Esd1D); } +#line 6216 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 301: -/* Line 1792 of yacc.c */ -#line 1964 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1973 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setImage(EbtUint, EsdRect); + (yyval.interm.type).sampler.setImage(EbtInt, Esd1D); } +#line 6226 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 302: -/* Line 1792 of yacc.c */ -#line 1969 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1978 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setImage(EbtFloat, EsdCube); + (yyval.interm.type).sampler.setImage(EbtUint, Esd1D); } +#line 6236 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 303: -/* Line 1792 of yacc.c */ -#line 1974 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1983 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setImage(EbtInt, EsdCube); + (yyval.interm.type).sampler.setImage(EbtFloat, Esd2D); } +#line 6246 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 304: -/* Line 1792 of yacc.c */ -#line 1979 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1988 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setImage(EbtUint, EsdCube); + (yyval.interm.type).sampler.setImage(EbtInt, Esd2D); } +#line 6256 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 305: -/* Line 1792 of yacc.c */ -#line 1984 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1993 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setImage(EbtFloat, EsdBuffer); + (yyval.interm.type).sampler.setImage(EbtUint, Esd2D); } +#line 6266 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 306: -/* Line 1792 of yacc.c */ -#line 1989 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 1998 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setImage(EbtInt, EsdBuffer); + (yyval.interm.type).sampler.setImage(EbtFloat, Esd3D); } +#line 6276 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 307: -/* Line 1792 of yacc.c */ -#line 1994 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 2003 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setImage(EbtUint, EsdBuffer); + (yyval.interm.type).sampler.setImage(EbtInt, Esd3D); } +#line 6286 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 308: -/* Line 1792 of yacc.c */ -#line 1999 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 2008 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setImage(EbtFloat, Esd1D, true); + (yyval.interm.type).sampler.setImage(EbtUint, Esd3D); } +#line 6296 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 309: -/* Line 1792 of yacc.c */ -#line 2004 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 2013 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setImage(EbtInt, Esd1D, true); + (yyval.interm.type).sampler.setImage(EbtFloat, EsdRect); } +#line 6306 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 310: -/* Line 1792 of yacc.c */ -#line 2009 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 2018 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setImage(EbtUint, Esd1D, true); + (yyval.interm.type).sampler.setImage(EbtInt, EsdRect); } +#line 6316 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 311: -/* Line 1792 of yacc.c */ -#line 2014 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 2023 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setImage(EbtFloat, Esd2D, true); + (yyval.interm.type).sampler.setImage(EbtUint, EsdRect); } +#line 6326 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 312: -/* Line 1792 of yacc.c */ -#line 2019 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 2028 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setImage(EbtInt, Esd2D, true); + (yyval.interm.type).sampler.setImage(EbtFloat, EsdCube); } +#line 6336 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 313: -/* Line 1792 of yacc.c */ -#line 2024 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 2033 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setImage(EbtUint, Esd2D, true); + (yyval.interm.type).sampler.setImage(EbtInt, EsdCube); } +#line 6346 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 314: -/* Line 1792 of yacc.c */ -#line 2029 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 2038 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setImage(EbtFloat, EsdCube, true); + (yyval.interm.type).sampler.setImage(EbtUint, EsdCube); } +#line 6356 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 315: -/* Line 1792 of yacc.c */ -#line 2034 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 2043 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setImage(EbtInt, EsdCube, true); + (yyval.interm.type).sampler.setImage(EbtFloat, EsdBuffer); } +#line 6366 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 316: -/* Line 1792 of yacc.c */ -#line 2039 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 2048 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setImage(EbtUint, EsdCube, true); + (yyval.interm.type).sampler.setImage(EbtInt, EsdBuffer); } +#line 6376 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 317: -/* Line 1792 of yacc.c */ -#line 2044 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 2053 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setImage(EbtFloat, Esd2D, false, false, true); + (yyval.interm.type).sampler.setImage(EbtUint, EsdBuffer); } +#line 6386 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 318: -/* Line 1792 of yacc.c */ -#line 2049 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 2058 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setImage(EbtInt, Esd2D, false, false, true); + (yyval.interm.type).sampler.setImage(EbtFloat, Esd1D, true); } +#line 6396 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 319: -/* Line 1792 of yacc.c */ -#line 2054 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 2063 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setImage(EbtUint, Esd2D, false, false, true); + (yyval.interm.type).sampler.setImage(EbtInt, Esd1D, true); } +#line 6406 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 320: -/* Line 1792 of yacc.c */ -#line 2059 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 2068 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setImage(EbtFloat, Esd2D, true, false, true); + (yyval.interm.type).sampler.setImage(EbtUint, Esd1D, true); } +#line 6416 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 321: -/* Line 1792 of yacc.c */ -#line 2064 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 2073 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setImage(EbtInt, Esd2D, true, false, true); + (yyval.interm.type).sampler.setImage(EbtFloat, Esd2D, true); } +#line 6426 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 322: -/* Line 1792 of yacc.c */ -#line 2069 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 2078 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; - (yyval.interm.type).sampler.setImage(EbtUint, Esd2D, true, false, true); + (yyval.interm.type).sampler.setImage(EbtInt, Esd2D, true); } +#line 6436 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 323: -/* Line 1792 of yacc.c */ -#line 2074 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 2083 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtUint, Esd2D, true); + } +#line 6446 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 324: +#line 2088 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtFloat, EsdCube, true); + } +#line 6456 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 325: +#line 2093 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtInt, EsdCube, true); + } +#line 6466 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 326: +#line 2098 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtUint, EsdCube, true); + } +#line 6476 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 327: +#line 2103 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtFloat, Esd2D, false, false, true); + } +#line 6486 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 328: +#line 2108 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtInt, Esd2D, false, false, true); + } +#line 6496 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 329: +#line 2113 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtUint, Esd2D, false, false, true); + } +#line 6506 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 330: +#line 2118 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtFloat, Esd2D, true, false, true); + } +#line 6516 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 331: +#line 2123 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtInt, Esd2D, true, false, true); + } +#line 6526 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 332: +#line 2128 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).basicType = EbtSampler; + (yyval.interm.type).sampler.setImage(EbtUint, Esd2D, true, false, true); + } +#line 6536 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 333: +#line 2133 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { // GL_OES_EGL_image_external - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.set(EbtFloat, Esd2D); (yyval.interm.type).sampler.external = true; } +#line 6547 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 324: -/* Line 1792 of yacc.c */ -#line 2080 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + case 334: +#line 2139 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.requireStage((yyvsp[(1) - (1)].lex).loc, EShLangFragment, "subpass input"); - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "subpass input"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setSubpass(EbtFloat); } +#line 6558 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 325: -/* Line 1792 of yacc.c */ -#line 2086 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + case 335: +#line 2145 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.requireStage((yyvsp[(1) - (1)].lex).loc, EShLangFragment, "subpass input"); - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "subpass input"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setSubpass(EbtFloat, true); } +#line 6569 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 326: -/* Line 1792 of yacc.c */ -#line 2092 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + case 336: +#line 2151 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.requireStage((yyvsp[(1) - (1)].lex).loc, EShLangFragment, "subpass input"); - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "subpass input"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setSubpass(EbtInt); } +#line 6580 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 327: -/* Line 1792 of yacc.c */ -#line 2098 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + case 337: +#line 2157 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.requireStage((yyvsp[(1) - (1)].lex).loc, EShLangFragment, "subpass input"); - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "subpass input"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setSubpass(EbtInt, true); } +#line 6591 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 328: -/* Line 1792 of yacc.c */ -#line 2104 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + case 338: +#line 2163 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.requireStage((yyvsp[(1) - (1)].lex).loc, EShLangFragment, "subpass input"); - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "subpass input"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setSubpass(EbtUint); } +#line 6602 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 329: -/* Line 1792 of yacc.c */ -#line 2110 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + case 339: +#line 2169 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.requireStage((yyvsp[(1) - (1)].lex).loc, EShLangFragment, "subpass input"); - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + parseContext.requireStage((yyvsp[0].lex).loc, EShLangFragment, "subpass input"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtSampler; (yyval.interm.type).sampler.setSubpass(EbtUint, true); } +#line 6613 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 330: -/* Line 1792 of yacc.c */ -#line 2116 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + case 340: +#line 2175 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type); + (yyval.interm.type) = (yyvsp[0].interm.type); (yyval.interm.type).qualifier.storage = parseContext.symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; parseContext.structTypeCheck((yyval.interm.type).loc, (yyval.interm.type)); } +#line 6623 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 331: -/* Line 1792 of yacc.c */ -#line 2121 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + case 341: +#line 2180 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { // // This is for user defined type names. The lexical phase looked up the // type. // - if (const TVariable* variable = ((yyvsp[(1) - (1)].lex).symbol)->getAsVariable()) { + if (const TVariable* variable = ((yyvsp[0].lex).symbol)->getAsVariable()) { const TType& structure = variable->getType(); - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); (yyval.interm.type).basicType = EbtStruct; (yyval.interm.type).userDef = &structure; } else - parseContext.error((yyvsp[(1) - (1)].lex).loc, "expected type name", (yyvsp[(1) - (1)].lex).string->c_str(), ""); - } - break; - - case 332: -/* Line 1792 of yacc.c */ -#line 2137 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" - { - parseContext.profileRequires((yyvsp[(1) - (1)].lex).loc, ENoProfile, 130, 0, "highp precision qualifier"); - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); - if (parseContext.profile == EEsProfile) - (yyval.interm.type).qualifier.precision = EpqHigh; - } - break; - - case 333: -/* Line 1792 of yacc.c */ -#line 2143 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" - { - parseContext.profileRequires((yyvsp[(1) - (1)].lex).loc, ENoProfile, 130, 0, "mediump precision qualifier"); - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); - if (parseContext.profile == EEsProfile) - (yyval.interm.type).qualifier.precision = EpqMedium; - } - break; - - case 334: -/* Line 1792 of yacc.c */ -#line 2149 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" - { - parseContext.profileRequires((yyvsp[(1) - (1)].lex).loc, ENoProfile, 130, 0, "lowp precision qualifier"); - (yyval.interm.type).init((yyvsp[(1) - (1)].lex).loc, parseContext.symbolTable.atGlobalLevel()); - if (parseContext.profile == EEsProfile) - (yyval.interm.type).qualifier.precision = EpqLow; - } - break; - - case 335: -/* Line 1792 of yacc.c */ -#line 2158 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" - { parseContext.nestedStructCheck((yyvsp[(1) - (3)].lex).loc); } - break; - - case 336: -/* Line 1792 of yacc.c */ -#line 2158 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" - { - TType* structure = new TType((yyvsp[(5) - (6)].interm.typeList), *(yyvsp[(2) - (6)].lex).string); - parseContext.structArrayCheck((yyvsp[(2) - (6)].lex).loc, *structure); - TVariable* userTypeDef = new TVariable((yyvsp[(2) - (6)].lex).string, *structure, true); - if (! parseContext.symbolTable.insert(*userTypeDef)) - parseContext.error((yyvsp[(2) - (6)].lex).loc, "redefinition", (yyvsp[(2) - (6)].lex).string->c_str(), "struct"); - (yyval.interm.type).init((yyvsp[(1) - (6)].lex).loc); - (yyval.interm.type).basicType = EbtStruct; - (yyval.interm.type).userDef = structure; - --parseContext.structNestingLevel; - } - break; - - case 337: -/* Line 1792 of yacc.c */ -#line 2169 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" - { parseContext.nestedStructCheck((yyvsp[(1) - (2)].lex).loc); } - break; - - case 338: -/* Line 1792 of yacc.c */ -#line 2169 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" - { - TType* structure = new TType((yyvsp[(4) - (5)].interm.typeList), TString("")); - (yyval.interm.type).init((yyvsp[(1) - (5)].lex).loc); - (yyval.interm.type).basicType = EbtStruct; - (yyval.interm.type).userDef = structure; - --parseContext.structNestingLevel; - } - break; - - case 339: -/* Line 1792 of yacc.c */ -#line 2179 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" - { - (yyval.interm.typeList) = (yyvsp[(1) - (1)].interm.typeList); - } - break; - - case 340: -/* Line 1792 of yacc.c */ -#line 2182 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" - { - (yyval.interm.typeList) = (yyvsp[(1) - (2)].interm.typeList); - for (unsigned int i = 0; i < (yyvsp[(2) - (2)].interm.typeList)->size(); ++i) { - for (unsigned int j = 0; j < (yyval.interm.typeList)->size(); ++j) { - if ((*(yyval.interm.typeList))[j].type->getFieldName() == (*(yyvsp[(2) - (2)].interm.typeList))[i].type->getFieldName()) - parseContext.error((*(yyvsp[(2) - (2)].interm.typeList))[i].loc, "duplicate member name:", "", (*(yyvsp[(2) - (2)].interm.typeList))[i].type->getFieldName().c_str()); - } - (yyval.interm.typeList)->push_back((*(yyvsp[(2) - (2)].interm.typeList))[i]); - } - } - break; - - case 341: -/* Line 1792 of yacc.c */ -#line 2195 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" - { - if ((yyvsp[(1) - (3)].interm.type).arraySizes) { - parseContext.profileRequires((yyvsp[(1) - (3)].interm.type).loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type"); - parseContext.profileRequires((yyvsp[(1) - (3)].interm.type).loc, EEsProfile, 300, 0, "arrayed type"); - if (parseContext.profile == EEsProfile) - parseContext.arraySizeRequiredCheck((yyvsp[(1) - (3)].interm.type).loc, *(yyvsp[(1) - (3)].interm.type).arraySizes); - } - - (yyval.interm.typeList) = (yyvsp[(2) - (3)].interm.typeList); - - parseContext.voidErrorCheck((yyvsp[(1) - (3)].interm.type).loc, (*(yyvsp[(2) - (3)].interm.typeList))[0].type->getFieldName(), (yyvsp[(1) - (3)].interm.type).basicType); - parseContext.precisionQualifierCheck((yyvsp[(1) - (3)].interm.type).loc, (yyvsp[(1) - (3)].interm.type).basicType, (yyvsp[(1) - (3)].interm.type).qualifier); - - for (unsigned int i = 0; i < (yyval.interm.typeList)->size(); ++i) { - parseContext.arrayDimCheck((yyvsp[(1) - (3)].interm.type).loc, (*(yyval.interm.typeList))[i].type, (yyvsp[(1) - (3)].interm.type).arraySizes); - (*(yyval.interm.typeList))[i].type->mergeType((yyvsp[(1) - (3)].interm.type)); - } + parseContext.error((yyvsp[0].lex).loc, "expected type name", (yyvsp[0].lex).string->c_str(), ""); } +#line 6641 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 342: -/* Line 1792 of yacc.c */ -#line 2213 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 2196 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.globalQualifierFixCheck((yyvsp[(1) - (4)].interm.type).loc, (yyvsp[(1) - (4)].interm.type).qualifier); - if ((yyvsp[(2) - (4)].interm.type).arraySizes) { - parseContext.profileRequires((yyvsp[(2) - (4)].interm.type).loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type"); - parseContext.profileRequires((yyvsp[(2) - (4)].interm.type).loc, EEsProfile, 300, 0, "arrayed type"); - if (parseContext.profile == EEsProfile) - parseContext.arraySizeRequiredCheck((yyvsp[(2) - (4)].interm.type).loc, *(yyvsp[(2) - (4)].interm.type).arraySizes); - } - - (yyval.interm.typeList) = (yyvsp[(3) - (4)].interm.typeList); - - parseContext.checkNoShaderLayouts((yyvsp[(1) - (4)].interm.type).loc, (yyvsp[(1) - (4)].interm.type).shaderQualifiers); - parseContext.voidErrorCheck((yyvsp[(2) - (4)].interm.type).loc, (*(yyvsp[(3) - (4)].interm.typeList))[0].type->getFieldName(), (yyvsp[(2) - (4)].interm.type).basicType); - parseContext.mergeQualifiers((yyvsp[(2) - (4)].interm.type).loc, (yyvsp[(2) - (4)].interm.type).qualifier, (yyvsp[(1) - (4)].interm.type).qualifier, true); - parseContext.precisionQualifierCheck((yyvsp[(2) - (4)].interm.type).loc, (yyvsp[(2) - (4)].interm.type).basicType, (yyvsp[(2) - (4)].interm.type).qualifier); - - for (unsigned int i = 0; i < (yyval.interm.typeList)->size(); ++i) { - parseContext.arrayDimCheck((yyvsp[(1) - (4)].interm.type).loc, (*(yyval.interm.typeList))[i].type, (yyvsp[(2) - (4)].interm.type).arraySizes); - (*(yyval.interm.typeList))[i].type->mergeType((yyvsp[(2) - (4)].interm.type)); - } + parseContext.profileRequires((yyvsp[0].lex).loc, ENoProfile, 130, 0, "highp precision qualifier"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + if (parseContext.profile == EEsProfile) + (yyval.interm.type).qualifier.precision = EpqHigh; } +#line 6652 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 343: -/* Line 1792 of yacc.c */ -#line 2237 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 2202 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.typeList) = new TTypeList; - (yyval.interm.typeList)->push_back((yyvsp[(1) - (1)].interm.typeLine)); + parseContext.profileRequires((yyvsp[0].lex).loc, ENoProfile, 130, 0, "mediump precision qualifier"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + if (parseContext.profile == EEsProfile) + (yyval.interm.type).qualifier.precision = EpqMedium; } +#line 6663 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 344: -/* Line 1792 of yacc.c */ -#line 2241 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 2208 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.typeList)->push_back((yyvsp[(3) - (3)].interm.typeLine)); + parseContext.profileRequires((yyvsp[0].lex).loc, ENoProfile, 130, 0, "lowp precision qualifier"); + (yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel()); + if (parseContext.profile == EEsProfile) + (yyval.interm.type).qualifier.precision = EpqLow; } +#line 6674 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 345: -/* Line 1792 of yacc.c */ -#line 2247 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" - { - (yyval.interm.typeLine).type = new TType(EbtVoid); - (yyval.interm.typeLine).loc = (yyvsp[(1) - (1)].lex).loc; - (yyval.interm.typeLine).type->setFieldName(*(yyvsp[(1) - (1)].lex).string); - } +#line 2217 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { parseContext.nestedStructCheck((yyvsp[-2].lex).loc); } +#line 6680 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 346: -/* Line 1792 of yacc.c */ -#line 2252 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 2217 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.arrayDimCheck((yyvsp[(1) - (2)].lex).loc, (yyvsp[(2) - (2)].interm).arraySizes, 0); - - (yyval.interm.typeLine).type = new TType(EbtVoid); - (yyval.interm.typeLine).loc = (yyvsp[(1) - (2)].lex).loc; - (yyval.interm.typeLine).type->setFieldName(*(yyvsp[(1) - (2)].lex).string); - (yyval.interm.typeLine).type->newArraySizes(*(yyvsp[(2) - (2)].interm).arraySizes); + TType* structure = new TType((yyvsp[-1].interm.typeList), *(yyvsp[-4].lex).string); + parseContext.structArrayCheck((yyvsp[-4].lex).loc, *structure); + TVariable* userTypeDef = new TVariable((yyvsp[-4].lex).string, *structure, true); + if (! parseContext.symbolTable.insert(*userTypeDef)) + parseContext.error((yyvsp[-4].lex).loc, "redefinition", (yyvsp[-4].lex).string->c_str(), "struct"); + (yyval.interm.type).init((yyvsp[-5].lex).loc); + (yyval.interm.type).basicType = EbtStruct; + (yyval.interm.type).userDef = structure; + --parseContext.structNestingLevel; } +#line 6696 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 347: -/* Line 1792 of yacc.c */ -#line 2263 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" - { - (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); - } +#line 2228 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { parseContext.nestedStructCheck((yyvsp[-1].lex).loc); } +#line 6702 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 348: -/* Line 1792 of yacc.c */ -#line 2266 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 2228 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - const char* initFeature = "{ } style initializers"; - parseContext.requireProfile((yyvsp[(1) - (3)].lex).loc, ~EEsProfile, initFeature); - parseContext.profileRequires((yyvsp[(1) - (3)].lex).loc, ~EEsProfile, 420, E_GL_ARB_shading_language_420pack, initFeature); - (yyval.interm.intermTypedNode) = (yyvsp[(2) - (3)].interm.intermTypedNode); + TType* structure = new TType((yyvsp[-1].interm.typeList), TString("")); + (yyval.interm.type).init((yyvsp[-4].lex).loc); + (yyval.interm.type).basicType = EbtStruct; + (yyval.interm.type).userDef = structure; + --parseContext.structNestingLevel; } +#line 6714 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 349: -/* Line 1792 of yacc.c */ -#line 2272 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 2238 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - const char* initFeature = "{ } style initializers"; - parseContext.requireProfile((yyvsp[(1) - (4)].lex).loc, ~EEsProfile, initFeature); - parseContext.profileRequires((yyvsp[(1) - (4)].lex).loc, ~EEsProfile, 420, E_GL_ARB_shading_language_420pack, initFeature); - (yyval.interm.intermTypedNode) = (yyvsp[(2) - (4)].interm.intermTypedNode); + (yyval.interm.typeList) = (yyvsp[0].interm.typeList); } +#line 6722 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 350: -/* Line 1792 of yacc.c */ -#line 2281 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 2241 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.intermTypedNode) = parseContext.intermediate.growAggregate(0, (yyvsp[(1) - (1)].interm.intermTypedNode), (yyvsp[(1) - (1)].interm.intermTypedNode)->getLoc()); + (yyval.interm.typeList) = (yyvsp[-1].interm.typeList); + for (unsigned int i = 0; i < (yyvsp[0].interm.typeList)->size(); ++i) { + for (unsigned int j = 0; j < (yyval.interm.typeList)->size(); ++j) { + if ((*(yyval.interm.typeList))[j].type->getFieldName() == (*(yyvsp[0].interm.typeList))[i].type->getFieldName()) + parseContext.error((*(yyvsp[0].interm.typeList))[i].loc, "duplicate member name:", "", (*(yyvsp[0].interm.typeList))[i].type->getFieldName().c_str()); + } + (yyval.interm.typeList)->push_back((*(yyvsp[0].interm.typeList))[i]); + } } +#line 6737 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 351: -/* Line 1792 of yacc.c */ -#line 2284 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 2254 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.intermTypedNode) = parseContext.intermediate.growAggregate((yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode)); + if ((yyvsp[-2].interm.type).arraySizes) { + parseContext.profileRequires((yyvsp[-2].interm.type).loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type"); + parseContext.profileRequires((yyvsp[-2].interm.type).loc, EEsProfile, 300, 0, "arrayed type"); + if (parseContext.profile == EEsProfile) + parseContext.arraySizeRequiredCheck((yyvsp[-2].interm.type).loc, *(yyvsp[-2].interm.type).arraySizes); + } + + (yyval.interm.typeList) = (yyvsp[-1].interm.typeList); + + parseContext.voidErrorCheck((yyvsp[-2].interm.type).loc, (*(yyvsp[-1].interm.typeList))[0].type->getFieldName(), (yyvsp[-2].interm.type).basicType); + parseContext.precisionQualifierCheck((yyvsp[-2].interm.type).loc, (yyvsp[-2].interm.type).basicType, (yyvsp[-2].interm.type).qualifier); + + for (unsigned int i = 0; i < (yyval.interm.typeList)->size(); ++i) { + parseContext.arrayDimCheck((yyvsp[-2].interm.type).loc, (*(yyval.interm.typeList))[i].type, (yyvsp[-2].interm.type).arraySizes); + (*(yyval.interm.typeList))[i].type->mergeType((yyvsp[-2].interm.type)); + } } +#line 6760 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 352: -/* Line 1792 of yacc.c */ -#line 2290 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" - { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); } +#line 2272 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.globalQualifierFixCheck((yyvsp[-3].interm.type).loc, (yyvsp[-3].interm.type).qualifier); + if ((yyvsp[-2].interm.type).arraySizes) { + parseContext.profileRequires((yyvsp[-2].interm.type).loc, ENoProfile, 120, E_GL_3DL_array_objects, "arrayed type"); + parseContext.profileRequires((yyvsp[-2].interm.type).loc, EEsProfile, 300, 0, "arrayed type"); + if (parseContext.profile == EEsProfile) + parseContext.arraySizeRequiredCheck((yyvsp[-2].interm.type).loc, *(yyvsp[-2].interm.type).arraySizes); + } + + (yyval.interm.typeList) = (yyvsp[-1].interm.typeList); + + parseContext.checkNoShaderLayouts((yyvsp[-3].interm.type).loc, (yyvsp[-3].interm.type).shaderQualifiers); + parseContext.voidErrorCheck((yyvsp[-2].interm.type).loc, (*(yyvsp[-1].interm.typeList))[0].type->getFieldName(), (yyvsp[-2].interm.type).basicType); + parseContext.mergeQualifiers((yyvsp[-2].interm.type).loc, (yyvsp[-2].interm.type).qualifier, (yyvsp[-3].interm.type).qualifier, true); + parseContext.precisionQualifierCheck((yyvsp[-2].interm.type).loc, (yyvsp[-2].interm.type).basicType, (yyvsp[-2].interm.type).qualifier); + + for (unsigned int i = 0; i < (yyval.interm.typeList)->size(); ++i) { + parseContext.arrayDimCheck((yyvsp[-3].interm.type).loc, (*(yyval.interm.typeList))[i].type, (yyvsp[-2].interm.type).arraySizes); + (*(yyval.interm.typeList))[i].type->mergeType((yyvsp[-2].interm.type)); + } + } +#line 6786 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 353: -/* Line 1792 of yacc.c */ -#line 2294 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" - { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); } +#line 2296 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.typeList) = new TTypeList; + (yyval.interm.typeList)->push_back((yyvsp[0].interm.typeLine)); + } +#line 6795 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 354: -/* Line 1792 of yacc.c */ -#line 2295 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" - { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); } +#line 2300 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.typeList)->push_back((yyvsp[0].interm.typeLine)); + } +#line 6803 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 355: -/* Line 1792 of yacc.c */ -#line 2301 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" - { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); } +#line 2306 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.typeLine).type = new TType(EbtVoid); + (yyval.interm.typeLine).loc = (yyvsp[0].lex).loc; + (yyval.interm.typeLine).type->setFieldName(*(yyvsp[0].lex).string); + } +#line 6813 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 356: -/* Line 1792 of yacc.c */ -#line 2302 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" - { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); } +#line 2311 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.arrayDimCheck((yyvsp[-1].lex).loc, (yyvsp[0].interm).arraySizes, 0); + + (yyval.interm.typeLine).type = new TType(EbtVoid); + (yyval.interm.typeLine).loc = (yyvsp[-1].lex).loc; + (yyval.interm.typeLine).type->setFieldName(*(yyvsp[-1].lex).string); + (yyval.interm.typeLine).type->newArraySizes(*(yyvsp[0].interm).arraySizes); + } +#line 6826 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 357: -/* Line 1792 of yacc.c */ -#line 2303 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" - { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); } +#line 2322 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); + } +#line 6834 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 358: -/* Line 1792 of yacc.c */ -#line 2304 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" - { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); } +#line 2325 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + const char* initFeature = "{ } style initializers"; + parseContext.requireProfile((yyvsp[-2].lex).loc, ~EEsProfile, initFeature); + parseContext.profileRequires((yyvsp[-2].lex).loc, ~EEsProfile, 420, E_GL_ARB_shading_language_420pack, initFeature); + (yyval.interm.intermTypedNode) = (yyvsp[-1].interm.intermTypedNode); + } +#line 6845 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 359: -/* Line 1792 of yacc.c */ -#line 2305 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" - { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); } +#line 2331 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + const char* initFeature = "{ } style initializers"; + parseContext.requireProfile((yyvsp[-3].lex).loc, ~EEsProfile, initFeature); + parseContext.profileRequires((yyvsp[-3].lex).loc, ~EEsProfile, 420, E_GL_ARB_shading_language_420pack, initFeature); + (yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode); + } +#line 6856 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 360: -/* Line 1792 of yacc.c */ -#line 2306 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" - { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); } +#line 2340 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.intermTypedNode) = parseContext.intermediate.growAggregate(0, (yyvsp[0].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)->getLoc()); + } +#line 6864 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 361: -/* Line 1792 of yacc.c */ -#line 2307 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" - { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); } +#line 2343 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.intermTypedNode) = parseContext.intermediate.growAggregate((yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode)); + } +#line 6872 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 362: -/* Line 1792 of yacc.c */ -#line 2311 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" - { (yyval.interm.intermNode) = 0; } +#line 2349 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } +#line 6878 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 363: -/* Line 1792 of yacc.c */ -#line 2312 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" - { - parseContext.symbolTable.push(); - ++parseContext.statementNestingLevel; - } +#line 2353 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } +#line 6884 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 364: -/* Line 1792 of yacc.c */ -#line 2316 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 2354 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } +#line 6890 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 365: +#line 2360 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } +#line 6896 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 366: +#line 2361 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } +#line 6902 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 367: +#line 2362 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } +#line 6908 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 368: +#line 2363 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } +#line 6914 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 369: +#line 2364 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } +#line 6920 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 370: +#line 2365 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } +#line 6926 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 371: +#line 2366 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } +#line 6932 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 372: +#line 2370 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { (yyval.interm.intermNode) = 0; } +#line 6938 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 373: +#line 2371 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.symbolTable.push(); + ++parseContext.statementNestingLevel; + } +#line 6947 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 374: +#line 2375 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]); --parseContext.statementNestingLevel; } +#line 6956 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 365: -/* Line 1792 of yacc.c */ -#line 2320 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + case 375: +#line 2379 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - if ((yyvsp[(3) - (5)].interm.intermNode) && (yyvsp[(3) - (5)].interm.intermNode)->getAsAggregate()) - (yyvsp[(3) - (5)].interm.intermNode)->getAsAggregate()->setOperator(EOpSequence); - (yyval.interm.intermNode) = (yyvsp[(3) - (5)].interm.intermNode); + if ((yyvsp[-2].interm.intermNode) && (yyvsp[-2].interm.intermNode)->getAsAggregate()) + (yyvsp[-2].interm.intermNode)->getAsAggregate()->setOperator(EOpSequence); + (yyval.interm.intermNode) = (yyvsp[-2].interm.intermNode); } +#line 6966 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 366: -/* Line 1792 of yacc.c */ -#line 2328 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" - { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); } + case 376: +#line 2387 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } +#line 6972 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 367: -/* Line 1792 of yacc.c */ -#line 2329 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" - { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); } + case 377: +#line 2388 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } +#line 6978 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 368: -/* Line 1792 of yacc.c */ -#line 2333 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + case 378: +#line 2392 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { ++parseContext.controlFlowNestingLevel; } +#line 6986 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 369: -/* Line 1792 of yacc.c */ -#line 2336 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + case 379: +#line 2395 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { --parseContext.controlFlowNestingLevel; - (yyval.interm.intermNode) = (yyvsp[(2) - (2)].interm.intermNode); + (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } +#line 6995 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 370: -/* Line 1792 of yacc.c */ -#line 2340 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + case 380: +#line 2399 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.symbolTable.push(); ++parseContext.statementNestingLevel; ++parseContext.controlFlowNestingLevel; } +#line 7005 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 371: -/* Line 1792 of yacc.c */ -#line 2345 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + case 381: +#line 2404 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]); --parseContext.statementNestingLevel; --parseContext.controlFlowNestingLevel; - (yyval.interm.intermNode) = (yyvsp[(2) - (2)].interm.intermNode); - } - break; - - case 372: -/* Line 1792 of yacc.c */ -#line 2354 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" - { - (yyval.interm.intermNode) = 0; - } - break; - - case 373: -/* Line 1792 of yacc.c */ -#line 2357 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" - { - if ((yyvsp[(2) - (3)].interm.intermNode) && (yyvsp[(2) - (3)].interm.intermNode)->getAsAggregate()) - (yyvsp[(2) - (3)].interm.intermNode)->getAsAggregate()->setOperator(EOpSequence); - (yyval.interm.intermNode) = (yyvsp[(2) - (3)].interm.intermNode); - } - break; - - case 374: -/* Line 1792 of yacc.c */ -#line 2365 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" - { - (yyval.interm.intermNode) = parseContext.intermediate.makeAggregate((yyvsp[(1) - (1)].interm.intermNode)); - if ((yyvsp[(1) - (1)].interm.intermNode) && (yyvsp[(1) - (1)].interm.intermNode)->getAsBranchNode() && ((yyvsp[(1) - (1)].interm.intermNode)->getAsBranchNode()->getFlowOp() == EOpCase || - (yyvsp[(1) - (1)].interm.intermNode)->getAsBranchNode()->getFlowOp() == EOpDefault)) { - parseContext.wrapupSwitchSubsequence(0, (yyvsp[(1) - (1)].interm.intermNode)); - (yyval.interm.intermNode) = 0; // start a fresh subsequence for what's after this case - } - } - break; - - case 375: -/* Line 1792 of yacc.c */ -#line 2373 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" - { - if ((yyvsp[(2) - (2)].interm.intermNode) && (yyvsp[(2) - (2)].interm.intermNode)->getAsBranchNode() && ((yyvsp[(2) - (2)].interm.intermNode)->getAsBranchNode()->getFlowOp() == EOpCase || - (yyvsp[(2) - (2)].interm.intermNode)->getAsBranchNode()->getFlowOp() == EOpDefault)) { - parseContext.wrapupSwitchSubsequence((yyvsp[(1) - (2)].interm.intermNode) ? (yyvsp[(1) - (2)].interm.intermNode)->getAsAggregate() : 0, (yyvsp[(2) - (2)].interm.intermNode)); - (yyval.interm.intermNode) = 0; // start a fresh subsequence for what's after this case - } else - (yyval.interm.intermNode) = parseContext.intermediate.growAggregate((yyvsp[(1) - (2)].interm.intermNode), (yyvsp[(2) - (2)].interm.intermNode)); - } - break; - - case 376: -/* Line 1792 of yacc.c */ -#line 2384 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" - { (yyval.interm.intermNode) = 0; } - break; - - case 377: -/* Line 1792 of yacc.c */ -#line 2385 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" - { (yyval.interm.intermNode) = static_cast((yyvsp[(1) - (2)].interm.intermTypedNode)); } - break; - - case 378: -/* Line 1792 of yacc.c */ -#line 2389 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" - { - parseContext.boolCheck((yyvsp[(1) - (5)].lex).loc, (yyvsp[(3) - (5)].interm.intermTypedNode)); - (yyval.interm.intermNode) = parseContext.intermediate.addSelection((yyvsp[(3) - (5)].interm.intermTypedNode), (yyvsp[(5) - (5)].interm.nodePair), (yyvsp[(1) - (5)].lex).loc); - } - break; - - case 379: -/* Line 1792 of yacc.c */ -#line 2396 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" - { - (yyval.interm.nodePair).node1 = (yyvsp[(1) - (3)].interm.intermNode); - (yyval.interm.nodePair).node2 = (yyvsp[(3) - (3)].interm.intermNode); - } - break; - - case 380: -/* Line 1792 of yacc.c */ -#line 2400 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" - { - (yyval.interm.nodePair).node1 = (yyvsp[(1) - (1)].interm.intermNode); - (yyval.interm.nodePair).node2 = 0; - } - break; - - case 381: -/* Line 1792 of yacc.c */ -#line 2408 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" - { - (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); - parseContext.boolCheck((yyvsp[(1) - (1)].interm.intermTypedNode)->getLoc(), (yyvsp[(1) - (1)].interm.intermTypedNode)); + (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } +#line 7016 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 382: -/* Line 1792 of yacc.c */ -#line 2412 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 2413 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.boolCheck((yyvsp[(2) - (4)].lex).loc, (yyvsp[(1) - (4)].interm.type)); + (yyval.interm.intermNode) = 0; + } +#line 7024 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; - TType type((yyvsp[(1) - (4)].interm.type)); - TIntermNode* initNode = parseContext.declareVariable((yyvsp[(2) - (4)].lex).loc, *(yyvsp[(2) - (4)].lex).string, (yyvsp[(1) - (4)].interm.type), 0, (yyvsp[(4) - (4)].interm.intermTypedNode)); + case 383: +#line 2416 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + if ((yyvsp[-1].interm.intermNode) && (yyvsp[-1].interm.intermNode)->getAsAggregate()) + (yyvsp[-1].interm.intermNode)->getAsAggregate()->setOperator(EOpSequence); + (yyval.interm.intermNode) = (yyvsp[-1].interm.intermNode); + } +#line 7034 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 384: +#line 2424 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.intermNode) = parseContext.intermediate.makeAggregate((yyvsp[0].interm.intermNode)); + if ((yyvsp[0].interm.intermNode) && (yyvsp[0].interm.intermNode)->getAsBranchNode() && ((yyvsp[0].interm.intermNode)->getAsBranchNode()->getFlowOp() == EOpCase || + (yyvsp[0].interm.intermNode)->getAsBranchNode()->getFlowOp() == EOpDefault)) { + parseContext.wrapupSwitchSubsequence(0, (yyvsp[0].interm.intermNode)); + (yyval.interm.intermNode) = 0; // start a fresh subsequence for what's after this case + } + } +#line 7047 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 385: +#line 2432 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + if ((yyvsp[0].interm.intermNode) && (yyvsp[0].interm.intermNode)->getAsBranchNode() && ((yyvsp[0].interm.intermNode)->getAsBranchNode()->getFlowOp() == EOpCase || + (yyvsp[0].interm.intermNode)->getAsBranchNode()->getFlowOp() == EOpDefault)) { + parseContext.wrapupSwitchSubsequence((yyvsp[-1].interm.intermNode) ? (yyvsp[-1].interm.intermNode)->getAsAggregate() : 0, (yyvsp[0].interm.intermNode)); + (yyval.interm.intermNode) = 0; // start a fresh subsequence for what's after this case + } else + (yyval.interm.intermNode) = parseContext.intermediate.growAggregate((yyvsp[-1].interm.intermNode), (yyvsp[0].interm.intermNode)); + } +#line 7060 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 386: +#line 2443 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { (yyval.interm.intermNode) = 0; } +#line 7066 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 387: +#line 2444 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { (yyval.interm.intermNode) = static_cast((yyvsp[-1].interm.intermTypedNode)); } +#line 7072 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 388: +#line 2448 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.boolCheck((yyvsp[-4].lex).loc, (yyvsp[-2].interm.intermTypedNode)); + (yyval.interm.intermNode) = parseContext.intermediate.addSelection((yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.nodePair), (yyvsp[-4].lex).loc); + } +#line 7081 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 389: +#line 2455 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.nodePair).node1 = (yyvsp[-2].interm.intermNode); + (yyval.interm.nodePair).node2 = (yyvsp[0].interm.intermNode); + } +#line 7090 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 390: +#line 2459 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.nodePair).node1 = (yyvsp[0].interm.intermNode); + (yyval.interm.nodePair).node2 = 0; + } +#line 7099 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 391: +#line 2467 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); + parseContext.boolCheck((yyvsp[0].interm.intermTypedNode)->getLoc(), (yyvsp[0].interm.intermTypedNode)); + } +#line 7108 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 392: +#line 2471 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.boolCheck((yyvsp[-2].lex).loc, (yyvsp[-3].interm.type)); + + TType type((yyvsp[-3].interm.type)); + TIntermNode* initNode = parseContext.declareVariable((yyvsp[-2].lex).loc, *(yyvsp[-2].lex).string, (yyvsp[-3].interm.type), 0, (yyvsp[0].interm.intermTypedNode)); if (initNode) (yyval.interm.intermTypedNode) = initNode->getAsTyped(); else (yyval.interm.intermTypedNode) = 0; } +#line 7123 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 383: -/* Line 1792 of yacc.c */ -#line 2425 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + case 393: +#line 2484 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { // start new switch sequence on the switch stack ++parseContext.controlFlowNestingLevel; @@ -7233,13 +7132,13 @@ yyreduce: parseContext.switchLevel.push_back(parseContext.statementNestingLevel); parseContext.symbolTable.push(); } +#line 7136 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 384: -/* Line 1792 of yacc.c */ -#line 2433 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + case 394: +#line 2492 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.intermNode) = parseContext.addSwitch((yyvsp[(1) - (8)].lex).loc, (yyvsp[(3) - (8)].interm.intermTypedNode), (yyvsp[(7) - (8)].interm.intermNode) ? (yyvsp[(7) - (8)].interm.intermNode)->getAsAggregate() : 0); + (yyval.interm.intermNode) = parseContext.addSwitch((yyvsp[-7].lex).loc, (yyvsp[-5].interm.intermTypedNode), (yyvsp[-1].interm.intermNode) ? (yyvsp[-1].interm.intermNode)->getAsAggregate() : 0); delete parseContext.switchSequenceStack.back(); parseContext.switchSequenceStack.pop_back(); parseContext.switchLevel.pop_back(); @@ -7247,302 +7146,302 @@ yyreduce: --parseContext.statementNestingLevel; --parseContext.controlFlowNestingLevel; } +#line 7150 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 385: -/* Line 1792 of yacc.c */ -#line 2445 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + case 395: +#line 2504 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = 0; } +#line 7158 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 386: -/* Line 1792 of yacc.c */ -#line 2448 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + case 396: +#line 2507 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); + (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } +#line 7166 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 387: -/* Line 1792 of yacc.c */ -#line 2454 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + case 397: +#line 2513 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = 0; if (parseContext.switchLevel.size() == 0) - parseContext.error((yyvsp[(1) - (3)].lex).loc, "cannot appear outside switch statement", "case", ""); + parseContext.error((yyvsp[-2].lex).loc, "cannot appear outside switch statement", "case", ""); else if (parseContext.switchLevel.back() != parseContext.statementNestingLevel) - parseContext.error((yyvsp[(1) - (3)].lex).loc, "cannot be nested inside control flow", "case", ""); + parseContext.error((yyvsp[-2].lex).loc, "cannot be nested inside control flow", "case", ""); else { - parseContext.constantValueCheck((yyvsp[(2) - (3)].interm.intermTypedNode), "case"); - parseContext.integerCheck((yyvsp[(2) - (3)].interm.intermTypedNode), "case"); - (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpCase, (yyvsp[(2) - (3)].interm.intermTypedNode), (yyvsp[(1) - (3)].lex).loc); + parseContext.constantValueCheck((yyvsp[-1].interm.intermTypedNode), "case"); + parseContext.integerCheck((yyvsp[-1].interm.intermTypedNode), "case"); + (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpCase, (yyvsp[-1].interm.intermTypedNode), (yyvsp[-2].lex).loc); } } +#line 7183 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 388: -/* Line 1792 of yacc.c */ -#line 2466 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + case 398: +#line 2525 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { (yyval.interm.intermNode) = 0; if (parseContext.switchLevel.size() == 0) - parseContext.error((yyvsp[(1) - (2)].lex).loc, "cannot appear outside switch statement", "default", ""); + parseContext.error((yyvsp[-1].lex).loc, "cannot appear outside switch statement", "default", ""); else if (parseContext.switchLevel.back() != parseContext.statementNestingLevel) - parseContext.error((yyvsp[(1) - (2)].lex).loc, "cannot be nested inside control flow", "default", ""); + parseContext.error((yyvsp[-1].lex).loc, "cannot be nested inside control flow", "default", ""); else - (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpDefault, (yyvsp[(1) - (2)].lex).loc); + (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpDefault, (yyvsp[-1].lex).loc); } +#line 7197 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 389: -/* Line 1792 of yacc.c */ -#line 2478 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + case 399: +#line 2537 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { if (! parseContext.limits.whileLoops) - parseContext.error((yyvsp[(1) - (2)].lex).loc, "while loops not available", "limitation", ""); + parseContext.error((yyvsp[-1].lex).loc, "while loops not available", "limitation", ""); parseContext.symbolTable.push(); ++parseContext.loopNestingLevel; ++parseContext.statementNestingLevel; ++parseContext.controlFlowNestingLevel; } +#line 7210 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 390: -/* Line 1792 of yacc.c */ -#line 2486 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + case 400: +#line 2545 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]); - (yyval.interm.intermNode) = parseContext.intermediate.addLoop((yyvsp[(6) - (6)].interm.intermNode), (yyvsp[(4) - (6)].interm.intermTypedNode), 0, true, (yyvsp[(1) - (6)].lex).loc); + (yyval.interm.intermNode) = parseContext.intermediate.addLoop((yyvsp[0].interm.intermNode), (yyvsp[-2].interm.intermTypedNode), 0, true, (yyvsp[-5].lex).loc); --parseContext.loopNestingLevel; --parseContext.statementNestingLevel; --parseContext.controlFlowNestingLevel; } +#line 7222 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 391: -/* Line 1792 of yacc.c */ -#line 2493 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + case 401: +#line 2552 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { ++parseContext.loopNestingLevel; ++parseContext.statementNestingLevel; ++parseContext.controlFlowNestingLevel; } +#line 7232 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 392: -/* Line 1792 of yacc.c */ -#line 2498 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + case 402: +#line 2557 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { if (! parseContext.limits.whileLoops) - parseContext.error((yyvsp[(1) - (8)].lex).loc, "do-while loops not available", "limitation", ""); + parseContext.error((yyvsp[-7].lex).loc, "do-while loops not available", "limitation", ""); - parseContext.boolCheck((yyvsp[(8) - (8)].lex).loc, (yyvsp[(6) - (8)].interm.intermTypedNode)); + parseContext.boolCheck((yyvsp[0].lex).loc, (yyvsp[-2].interm.intermTypedNode)); - (yyval.interm.intermNode) = parseContext.intermediate.addLoop((yyvsp[(3) - (8)].interm.intermNode), (yyvsp[(6) - (8)].interm.intermTypedNode), 0, false, (yyvsp[(4) - (8)].lex).loc); + (yyval.interm.intermNode) = parseContext.intermediate.addLoop((yyvsp[-5].interm.intermNode), (yyvsp[-2].interm.intermTypedNode), 0, false, (yyvsp[-4].lex).loc); --parseContext.loopNestingLevel; --parseContext.statementNestingLevel; --parseContext.controlFlowNestingLevel; } +#line 7248 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 393: -/* Line 1792 of yacc.c */ -#line 2509 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + case 403: +#line 2568 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.symbolTable.push(); ++parseContext.loopNestingLevel; ++parseContext.statementNestingLevel; ++parseContext.controlFlowNestingLevel; } +#line 7259 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; - case 394: -/* Line 1792 of yacc.c */ -#line 2515 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" + case 404: +#line 2574 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]); - (yyval.interm.intermNode) = parseContext.intermediate.makeAggregate((yyvsp[(4) - (7)].interm.intermNode), (yyvsp[(2) - (7)].lex).loc); - TIntermLoop* forLoop = parseContext.intermediate.addLoop((yyvsp[(7) - (7)].interm.intermNode), reinterpret_cast((yyvsp[(5) - (7)].interm.nodePair).node1), reinterpret_cast((yyvsp[(5) - (7)].interm.nodePair).node2), true, (yyvsp[(1) - (7)].lex).loc); + (yyval.interm.intermNode) = parseContext.intermediate.makeAggregate((yyvsp[-3].interm.intermNode), (yyvsp[-5].lex).loc); + TIntermLoop* forLoop = parseContext.intermediate.addLoop((yyvsp[0].interm.intermNode), reinterpret_cast((yyvsp[-2].interm.nodePair).node1), reinterpret_cast((yyvsp[-2].interm.nodePair).node2), true, (yyvsp[-6].lex).loc); if (! parseContext.limits.nonInductiveForLoops) - parseContext.inductiveLoopCheck((yyvsp[(1) - (7)].lex).loc, (yyvsp[(4) - (7)].interm.intermNode), forLoop); - (yyval.interm.intermNode) = parseContext.intermediate.growAggregate((yyval.interm.intermNode), forLoop, (yyvsp[(1) - (7)].lex).loc); + parseContext.inductiveLoopCheck((yyvsp[-6].lex).loc, (yyvsp[-3].interm.intermNode), forLoop); + (yyval.interm.intermNode) = parseContext.intermediate.growAggregate((yyval.interm.intermNode), forLoop, (yyvsp[-6].lex).loc); (yyval.interm.intermNode)->getAsAggregate()->setOperator(EOpSequence); --parseContext.loopNestingLevel; --parseContext.statementNestingLevel; --parseContext.controlFlowNestingLevel; } - break; - - case 395: -/* Line 1792 of yacc.c */ -#line 2530 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" - { - (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); - } - break; - - case 396: -/* Line 1792 of yacc.c */ -#line 2533 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" - { - (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); - } - break; - - case 397: -/* Line 1792 of yacc.c */ -#line 2539 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" - { - (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); - } - break; - - case 398: -/* Line 1792 of yacc.c */ -#line 2542 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" - { - (yyval.interm.intermTypedNode) = 0; - } - break; - - case 399: -/* Line 1792 of yacc.c */ -#line 2548 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" - { - (yyval.interm.nodePair).node1 = (yyvsp[(1) - (2)].interm.intermTypedNode); - (yyval.interm.nodePair).node2 = 0; - } - break; - - case 400: -/* Line 1792 of yacc.c */ -#line 2552 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" - { - (yyval.interm.nodePair).node1 = (yyvsp[(1) - (3)].interm.intermTypedNode); - (yyval.interm.nodePair).node2 = (yyvsp[(3) - (3)].interm.intermTypedNode); - } - break; - - case 401: -/* Line 1792 of yacc.c */ -#line 2559 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" - { - if (parseContext.loopNestingLevel <= 0) - parseContext.error((yyvsp[(1) - (2)].lex).loc, "continue statement only allowed in loops", "", ""); - (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpContinue, (yyvsp[(1) - (2)].lex).loc); - } - break; - - case 402: -/* Line 1792 of yacc.c */ -#line 2564 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" - { - if (parseContext.loopNestingLevel + parseContext.switchSequenceStack.size() <= 0) - parseContext.error((yyvsp[(1) - (2)].lex).loc, "break statement only allowed in switch and loops", "", ""); - (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpBreak, (yyvsp[(1) - (2)].lex).loc); - } - break; - - case 403: -/* Line 1792 of yacc.c */ -#line 2569 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" - { - (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpReturn, (yyvsp[(1) - (2)].lex).loc); - if (parseContext.currentFunctionType->getBasicType() != EbtVoid) - parseContext.error((yyvsp[(1) - (2)].lex).loc, "non-void function must return a value", "return", ""); - if (parseContext.inMain) - parseContext.postMainReturn = true; - } - break; - - case 404: -/* Line 1792 of yacc.c */ -#line 2576 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" - { - parseContext.functionReturnsValue = true; - if (parseContext.currentFunctionType->getBasicType() == EbtVoid) { - parseContext.error((yyvsp[(1) - (3)].lex).loc, "void function cannot return a value", "return", ""); - (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpReturn, (yyvsp[(1) - (3)].lex).loc); - } else if (*(parseContext.currentFunctionType) != (yyvsp[(2) - (3)].interm.intermTypedNode)->getType()) { - TIntermTyped* converted = parseContext.intermediate.addConversion(EOpReturn, *parseContext.currentFunctionType, (yyvsp[(2) - (3)].interm.intermTypedNode)); - if (converted) { - if (parseContext.version < 420) - parseContext.warn((yyvsp[(1) - (3)].lex).loc, "type conversion on return values was not explicitly allowed until version 420", "return", ""); - (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpReturn, converted, (yyvsp[(1) - (3)].lex).loc); - } else { - parseContext.error((yyvsp[(1) - (3)].lex).loc, "type does not match, or is not convertible to, the function's return type", "return", ""); - (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpReturn, (yyvsp[(2) - (3)].interm.intermTypedNode), (yyvsp[(1) - (3)].lex).loc); - } - } else - (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpReturn, (yyvsp[(2) - (3)].interm.intermTypedNode), (yyvsp[(1) - (3)].lex).loc); - } +#line 7276 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 405: -/* Line 1792 of yacc.c */ -#line 2594 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 2589 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - parseContext.requireStage((yyvsp[(1) - (2)].lex).loc, EShLangFragment, "discard"); - (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpKill, (yyvsp[(1) - (2)].lex).loc); + (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } +#line 7284 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 406: -/* Line 1792 of yacc.c */ -#line 2603 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 2592 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); - parseContext.intermediate.setTreeRoot((yyval.interm.intermNode)); + (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); } +#line 7292 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 407: -/* Line 1792 of yacc.c */ -#line 2607 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 2598 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.intermNode) = parseContext.intermediate.growAggregate((yyvsp[(1) - (2)].interm.intermNode), (yyvsp[(2) - (2)].interm.intermNode)); - parseContext.intermediate.setTreeRoot((yyval.interm.intermNode)); + (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); } +#line 7300 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 408: -/* Line 1792 of yacc.c */ -#line 2614 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 2601 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); + (yyval.interm.intermTypedNode) = 0; } +#line 7308 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 409: -/* Line 1792 of yacc.c */ -#line 2617 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 2607 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); + (yyval.interm.nodePair).node1 = (yyvsp[-1].interm.intermTypedNode); + (yyval.interm.nodePair).node2 = 0; } +#line 7317 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 410: -/* Line 1792 of yacc.c */ -#line 2623 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 2611 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { - (yyvsp[(1) - (1)].interm).function = parseContext.handleFunctionDeclarator((yyvsp[(1) - (1)].interm).loc, *(yyvsp[(1) - (1)].interm).function, false /* not prototype */); - (yyvsp[(1) - (1)].interm).intermNode = parseContext.handleFunctionDefinition((yyvsp[(1) - (1)].interm).loc, *(yyvsp[(1) - (1)].interm).function); + (yyval.interm.nodePair).node1 = (yyvsp[-2].interm.intermTypedNode); + (yyval.interm.nodePair).node2 = (yyvsp[0].interm.intermTypedNode); } +#line 7326 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; case 411: -/* Line 1792 of yacc.c */ -#line 2627 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 2618 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + if (parseContext.loopNestingLevel <= 0) + parseContext.error((yyvsp[-1].lex).loc, "continue statement only allowed in loops", "", ""); + (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpContinue, (yyvsp[-1].lex).loc); + } +#line 7336 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 412: +#line 2623 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + if (parseContext.loopNestingLevel + parseContext.switchSequenceStack.size() <= 0) + parseContext.error((yyvsp[-1].lex).loc, "break statement only allowed in switch and loops", "", ""); + (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpBreak, (yyvsp[-1].lex).loc); + } +#line 7346 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 413: +#line 2628 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpReturn, (yyvsp[-1].lex).loc); + if (parseContext.currentFunctionType->getBasicType() != EbtVoid) + parseContext.error((yyvsp[-1].lex).loc, "non-void function must return a value", "return", ""); + if (parseContext.inMain) + parseContext.postMainReturn = true; + } +#line 7358 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 414: +#line 2635 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.functionReturnsValue = true; + if (parseContext.currentFunctionType->getBasicType() == EbtVoid) { + parseContext.error((yyvsp[-2].lex).loc, "void function cannot return a value", "return", ""); + (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpReturn, (yyvsp[-2].lex).loc); + } else if (*(parseContext.currentFunctionType) != (yyvsp[-1].interm.intermTypedNode)->getType()) { + TIntermTyped* converted = parseContext.intermediate.addConversion(EOpReturn, *parseContext.currentFunctionType, (yyvsp[-1].interm.intermTypedNode)); + if (converted) { + if (parseContext.version < 420) + parseContext.warn((yyvsp[-2].lex).loc, "type conversion on return values was not explicitly allowed until version 420", "return", ""); + (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpReturn, converted, (yyvsp[-2].lex).loc); + } else { + parseContext.error((yyvsp[-2].lex).loc, "type does not match, or is not convertible to, the function's return type", "return", ""); + (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpReturn, (yyvsp[-1].interm.intermTypedNode), (yyvsp[-2].lex).loc); + } + } else + (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpReturn, (yyvsp[-1].interm.intermTypedNode), (yyvsp[-2].lex).loc); + } +#line 7381 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 415: +#line 2653 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + parseContext.requireStage((yyvsp[-1].lex).loc, EShLangFragment, "discard"); + (yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpKill, (yyvsp[-1].lex).loc); + } +#line 7390 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 416: +#line 2662 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); + parseContext.intermediate.setTreeRoot((yyval.interm.intermNode)); + } +#line 7399 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 417: +#line 2666 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.intermNode) = parseContext.intermediate.growAggregate((yyvsp[-1].interm.intermNode), (yyvsp[0].interm.intermNode)); + parseContext.intermediate.setTreeRoot((yyval.interm.intermNode)); + } +#line 7408 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 418: +#line 2673 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); + } +#line 7416 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 419: +#line 2676 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); + } +#line 7424 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 420: +#line 2682 "MachineIndependent/glslang.y" /* yacc.c:1646 */ + { + (yyvsp[0].interm).function = parseContext.handleFunctionDeclarator((yyvsp[0].interm).loc, *(yyvsp[0].interm).function, false /* not prototype */); + (yyvsp[0].interm).intermNode = parseContext.handleFunctionDefinition((yyvsp[0].interm).loc, *(yyvsp[0].interm).function); + } +#line 7433 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ + break; + + case 421: +#line 2686 "MachineIndependent/glslang.y" /* yacc.c:1646 */ { // May be best done as post process phase on intermediate code if (parseContext.currentFunctionType->getBasicType() != EbtVoid && ! parseContext.functionReturnsValue) - parseContext.error((yyvsp[(1) - (3)].interm).loc, "function does not return a value:", "", (yyvsp[(1) - (3)].interm).function->getName().c_str()); + parseContext.error((yyvsp[-2].interm).loc, "function does not return a value:", "", (yyvsp[-2].interm).function->getName().c_str()); parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]); - (yyval.interm.intermNode) = parseContext.intermediate.growAggregate((yyvsp[(1) - (3)].interm).intermNode, (yyvsp[(3) - (3)].interm.intermNode)); - parseContext.intermediate.setAggregateOperator((yyval.interm.intermNode), EOpFunction, (yyvsp[(1) - (3)].interm).function->getType(), (yyvsp[(1) - (3)].interm).loc); - (yyval.interm.intermNode)->getAsAggregate()->setName((yyvsp[(1) - (3)].interm).function->getMangledName().c_str()); + (yyval.interm.intermNode) = parseContext.intermediate.growAggregate((yyvsp[-2].interm).intermNode, (yyvsp[0].interm.intermNode)); + parseContext.intermediate.setAggregateOperator((yyval.interm.intermNode), EOpFunction, (yyvsp[-2].interm).function->getType(), (yyvsp[-2].interm).loc); + (yyval.interm.intermNode)->getAsAggregate()->setName((yyvsp[-2].interm).function->getMangledName().c_str()); // store the pragma information for debug and optimize and other vendor specific // information. This information can be queried from the parse tree @@ -7550,11 +7449,11 @@ yyreduce: (yyval.interm.intermNode)->getAsAggregate()->setDebug(parseContext.contextPragma.debug); (yyval.interm.intermNode)->getAsAggregate()->addToPragmaTable(parseContext.contextPragma.pragmaTable); } +#line 7453 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ break; -/* Line 1792 of yacc.c */ -#line 7558 "C:/Projects/glslang/glslang/MachineIndependent/glslang_tab.cpp" +#line 7457 "MachineIndependent/glslang_tab.cpp" /* yacc.c:1646 */ default: break; } /* User semantic actions sometimes alter yychar, and that requires @@ -7576,7 +7475,7 @@ yyreduce: *++yyvsp = yyval; - /* Now `shift' the result of the reduction. Determine what state + /* Now 'shift' the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule number reduced by. */ @@ -7591,9 +7490,9 @@ yyreduce: goto yynewstate; -/*------------------------------------. -| yyerrlab -- here on detecting error | -`------------------------------------*/ +/*--------------------------------------. +| yyerrlab -- here on detecting error. | +`--------------------------------------*/ yyerrlab: /* Make sure we have latest lookahead translation. See comments at user semantic actions for why this is necessary. */ @@ -7644,20 +7543,20 @@ yyerrlab: if (yyerrstatus == 3) { /* If just tried and failed to reuse lookahead token after an - error, discard it. */ + error, discard it. */ if (yychar <= YYEOF) - { - /* Return failure if at end of input. */ - if (yychar == YYEOF) - YYABORT; - } + { + /* Return failure if at end of input. */ + if (yychar == YYEOF) + YYABORT; + } else - { - yydestruct ("Error: discarding", - yytoken, &yylval, pParseContext); - yychar = YYEMPTY; - } + { + yydestruct ("Error: discarding", + yytoken, &yylval, pParseContext); + yychar = YYEMPTY; + } } /* Else will try to reuse lookahead token after shifting the error @@ -7676,7 +7575,7 @@ yyerrorlab: if (/*CONSTCOND*/ 0) goto yyerrorlab; - /* Do not reclaim the symbols of the rule which action triggered + /* Do not reclaim the symbols of the rule whose action triggered this YYERROR. */ YYPOPSTACK (yylen); yylen = 0; @@ -7689,29 +7588,29 @@ yyerrorlab: | yyerrlab1 -- common code for both syntax error and YYERROR. | `-------------------------------------------------------------*/ yyerrlab1: - yyerrstatus = 3; /* Each real token shifted decrements this. */ + yyerrstatus = 3; /* Each real token shifted decrements this. */ for (;;) { yyn = yypact[yystate]; if (!yypact_value_is_default (yyn)) - { - yyn += YYTERROR; - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) - { - yyn = yytable[yyn]; - if (0 < yyn) - break; - } - } + { + yyn += YYTERROR; + if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) + { + yyn = yytable[yyn]; + if (0 < yyn) + break; + } + } /* Pop the current state because it cannot handle the error token. */ if (yyssp == yyss) - YYABORT; + YYABORT; yydestruct ("Error: popping", - yystos[yystate], yyvsp, pParseContext); + yystos[yystate], yyvsp, pParseContext); YYPOPSTACK (1); yystate = *yyssp; YY_STACK_PRINT (yyss, yyssp); @@ -7762,14 +7661,14 @@ yyreturn: yydestruct ("Cleanup: discarding lookahead", yytoken, &yylval, pParseContext); } - /* Do not reclaim the symbols of the rule which action triggered + /* Do not reclaim the symbols of the rule whose action triggered this YYABORT or YYACCEPT. */ YYPOPSTACK (yylen); YY_STACK_PRINT (yyss, yyssp); while (yyssp != yyss) { yydestruct ("Cleanup: popping", - yystos[*yyssp], yyvsp, pParseContext); + yystos[*yyssp], yyvsp, pParseContext); YYPOPSTACK (1); } #ifndef yyoverflow @@ -7780,11 +7679,7 @@ yyreturn: if (yymsg != yymsgbuf) YYSTACK_FREE (yymsg); #endif - /* Make sure YYID is used. */ - return YYID (yyresult); + return yyresult; } - - -/* Line 2055 of yacc.c */ -#line 2644 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 2703 "MachineIndependent/glslang.y" /* yacc.c:1906 */ diff --git a/glslang/MachineIndependent/glslang_tab.cpp.h b/glslang/MachineIndependent/glslang_tab.cpp.h index 0c6ab3bc..e7d8fae8 100644 --- a/glslang/MachineIndependent/glslang_tab.cpp.h +++ b/glslang/MachineIndependent/glslang_tab.cpp.h @@ -1,19 +1,19 @@ -/* A Bison parser, made by GNU Bison 2.7. */ +/* A Bison parser, made by GNU Bison 3.0.4. */ /* Bison interface for Yacc-like parsers in C - - Copyright (C) 1984, 1989-1990, 2000-2012 Free Software Foundation, Inc. - + + Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc. + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program. If not, see . */ @@ -26,13 +26,13 @@ special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. - + This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ -#ifndef YY_YY_C_PROJECTS_GLSLANG_GLSLANG_MACHINEINDEPENDENT_GLSLANG_TAB_CPP_H_INCLUDED -# define YY_YY_C_PROJECTS_GLSLANG_GLSLANG_MACHINEINDEPENDENT_GLSLANG_TAB_CPP_H_INCLUDED -/* Enabling traces. */ +#ifndef YY_YY_MACHINEINDEPENDENT_GLSLANG_TAB_CPP_H_INCLUDED +# define YY_YY_MACHINEINDEPENDENT_GLSLANG_TAB_CPP_H_INCLUDED +/* Debug traces. */ #ifndef YYDEBUG # define YYDEBUG 1 #endif @@ -40,278 +40,287 @@ extern int yydebug; #endif -/* Tokens. */ +/* Token type. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - ATTRIBUTE = 258, - VARYING = 259, - CONST = 260, - BOOL = 261, - FLOAT = 262, - DOUBLE = 263, - INT = 264, - UINT = 265, - BREAK = 266, - CONTINUE = 267, - DO = 268, - ELSE = 269, - FOR = 270, - IF = 271, - DISCARD = 272, - RETURN = 273, - SWITCH = 274, - CASE = 275, - DEFAULT = 276, - SUBROUTINE = 277, - BVEC2 = 278, - BVEC3 = 279, - BVEC4 = 280, - IVEC2 = 281, - IVEC3 = 282, - IVEC4 = 283, - UVEC2 = 284, - UVEC3 = 285, - UVEC4 = 286, - VEC2 = 287, - VEC3 = 288, - VEC4 = 289, - MAT2 = 290, - MAT3 = 291, - MAT4 = 292, - CENTROID = 293, - IN = 294, - OUT = 295, - INOUT = 296, - UNIFORM = 297, - PATCH = 298, - SAMPLE = 299, - BUFFER = 300, - SHARED = 301, - COHERENT = 302, - VOLATILE = 303, - RESTRICT = 304, - READONLY = 305, - WRITEONLY = 306, - DVEC2 = 307, - DVEC3 = 308, - DVEC4 = 309, - DMAT2 = 310, - DMAT3 = 311, - DMAT4 = 312, - NOPERSPECTIVE = 313, - FLAT = 314, - SMOOTH = 315, - LAYOUT = 316, - MAT2X2 = 317, - MAT2X3 = 318, - MAT2X4 = 319, - MAT3X2 = 320, - MAT3X3 = 321, - MAT3X4 = 322, - MAT4X2 = 323, - MAT4X3 = 324, - MAT4X4 = 325, - DMAT2X2 = 326, - DMAT2X3 = 327, - DMAT2X4 = 328, - DMAT3X2 = 329, - DMAT3X3 = 330, - DMAT3X4 = 331, - DMAT4X2 = 332, - DMAT4X3 = 333, - DMAT4X4 = 334, - ATOMIC_UINT = 335, - SAMPLER1D = 336, - SAMPLER2D = 337, - SAMPLER3D = 338, - SAMPLERCUBE = 339, - SAMPLER1DSHADOW = 340, - SAMPLER2DSHADOW = 341, - SAMPLERCUBESHADOW = 342, - SAMPLER1DARRAY = 343, - SAMPLER2DARRAY = 344, - SAMPLER1DARRAYSHADOW = 345, - SAMPLER2DARRAYSHADOW = 346, - ISAMPLER1D = 347, - ISAMPLER2D = 348, - ISAMPLER3D = 349, - ISAMPLERCUBE = 350, - ISAMPLER1DARRAY = 351, - ISAMPLER2DARRAY = 352, - USAMPLER1D = 353, - USAMPLER2D = 354, - USAMPLER3D = 355, - USAMPLERCUBE = 356, - USAMPLER1DARRAY = 357, - USAMPLER2DARRAY = 358, - SAMPLER2DRECT = 359, - SAMPLER2DRECTSHADOW = 360, - ISAMPLER2DRECT = 361, - USAMPLER2DRECT = 362, - SAMPLERBUFFER = 363, - ISAMPLERBUFFER = 364, - USAMPLERBUFFER = 365, - SAMPLERCUBEARRAY = 366, - SAMPLERCUBEARRAYSHADOW = 367, - ISAMPLERCUBEARRAY = 368, - USAMPLERCUBEARRAY = 369, - SAMPLER2DMS = 370, - ISAMPLER2DMS = 371, - USAMPLER2DMS = 372, - SAMPLER2DMSARRAY = 373, - ISAMPLER2DMSARRAY = 374, - USAMPLER2DMSARRAY = 375, - SAMPLEREXTERNALOES = 376, - SAMPLER = 377, - SAMPLERSHADOW = 378, - TEXTURE1D = 379, - TEXTURE2D = 380, - TEXTURE3D = 381, - TEXTURECUBE = 382, - TEXTURE1DARRAY = 383, - TEXTURE2DARRAY = 384, - ITEXTURE1D = 385, - ITEXTURE2D = 386, - ITEXTURE3D = 387, - ITEXTURECUBE = 388, - ITEXTURE1DARRAY = 389, - ITEXTURE2DARRAY = 390, - UTEXTURE1D = 391, - UTEXTURE2D = 392, - UTEXTURE3D = 393, - UTEXTURECUBE = 394, - UTEXTURE1DARRAY = 395, - UTEXTURE2DARRAY = 396, - TEXTURE2DRECT = 397, - ITEXTURE2DRECT = 398, - UTEXTURE2DRECT = 399, - TEXTUREBUFFER = 400, - ITEXTUREBUFFER = 401, - UTEXTUREBUFFER = 402, - TEXTURECUBEARRAY = 403, - ITEXTURECUBEARRAY = 404, - UTEXTURECUBEARRAY = 405, - TEXTURE2DMS = 406, - ITEXTURE2DMS = 407, - UTEXTURE2DMS = 408, - TEXTURE2DMSARRAY = 409, - ITEXTURE2DMSARRAY = 410, - UTEXTURE2DMSARRAY = 411, - SUBPASSINPUT = 412, - SUBPASSINPUTMS = 413, - ISUBPASSINPUT = 414, - ISUBPASSINPUTMS = 415, - USUBPASSINPUT = 416, - USUBPASSINPUTMS = 417, - IMAGE1D = 418, - IIMAGE1D = 419, - UIMAGE1D = 420, - IMAGE2D = 421, - IIMAGE2D = 422, - UIMAGE2D = 423, - IMAGE3D = 424, - IIMAGE3D = 425, - UIMAGE3D = 426, - IMAGE2DRECT = 427, - IIMAGE2DRECT = 428, - UIMAGE2DRECT = 429, - IMAGECUBE = 430, - IIMAGECUBE = 431, - UIMAGECUBE = 432, - IMAGEBUFFER = 433, - IIMAGEBUFFER = 434, - UIMAGEBUFFER = 435, - IMAGE1DARRAY = 436, - IIMAGE1DARRAY = 437, - UIMAGE1DARRAY = 438, - IMAGE2DARRAY = 439, - IIMAGE2DARRAY = 440, - UIMAGE2DARRAY = 441, - IMAGECUBEARRAY = 442, - IIMAGECUBEARRAY = 443, - UIMAGECUBEARRAY = 444, - IMAGE2DMS = 445, - IIMAGE2DMS = 446, - UIMAGE2DMS = 447, - IMAGE2DMSARRAY = 448, - IIMAGE2DMSARRAY = 449, - UIMAGE2DMSARRAY = 450, - STRUCT = 451, - VOID = 452, - WHILE = 453, - IDENTIFIER = 454, - TYPE_NAME = 455, - FLOATCONSTANT = 456, - DOUBLECONSTANT = 457, - INTCONSTANT = 458, - UINTCONSTANT = 459, - BOOLCONSTANT = 460, - LEFT_OP = 461, - RIGHT_OP = 462, - INC_OP = 463, - DEC_OP = 464, - LE_OP = 465, - GE_OP = 466, - EQ_OP = 467, - NE_OP = 468, - AND_OP = 469, - OR_OP = 470, - XOR_OP = 471, - MUL_ASSIGN = 472, - DIV_ASSIGN = 473, - ADD_ASSIGN = 474, - MOD_ASSIGN = 475, - LEFT_ASSIGN = 476, - RIGHT_ASSIGN = 477, - AND_ASSIGN = 478, - XOR_ASSIGN = 479, - OR_ASSIGN = 480, - SUB_ASSIGN = 481, - LEFT_PAREN = 482, - RIGHT_PAREN = 483, - LEFT_BRACKET = 484, - RIGHT_BRACKET = 485, - LEFT_BRACE = 486, - RIGHT_BRACE = 487, - DOT = 488, - COMMA = 489, - COLON = 490, - EQUAL = 491, - SEMICOLON = 492, - BANG = 493, - DASH = 494, - TILDE = 495, - PLUS = 496, - STAR = 497, - SLASH = 498, - PERCENT = 499, - LEFT_ANGLE = 500, - RIGHT_ANGLE = 501, - VERTICAL_BAR = 502, - CARET = 503, - AMPERSAND = 504, - QUESTION = 505, - INVARIANT = 506, - PRECISE = 507, - HIGH_PRECISION = 508, - MEDIUM_PRECISION = 509, - LOW_PRECISION = 510, - PRECISION = 511, - PACKED = 512, - RESOURCE = 513, - SUPERP = 514 - }; + enum yytokentype + { + ATTRIBUTE = 258, + VARYING = 259, + CONST = 260, + BOOL = 261, + FLOAT = 262, + DOUBLE = 263, + INT = 264, + UINT = 265, + INT64_T = 266, + UINT64_T = 267, + BREAK = 268, + CONTINUE = 269, + DO = 270, + ELSE = 271, + FOR = 272, + IF = 273, + DISCARD = 274, + RETURN = 275, + SWITCH = 276, + CASE = 277, + DEFAULT = 278, + SUBROUTINE = 279, + BVEC2 = 280, + BVEC3 = 281, + BVEC4 = 282, + IVEC2 = 283, + IVEC3 = 284, + IVEC4 = 285, + I64VEC2 = 286, + I64VEC3 = 287, + I64VEC4 = 288, + UVEC2 = 289, + UVEC3 = 290, + UVEC4 = 291, + U64VEC2 = 292, + U64VEC3 = 293, + U64VEC4 = 294, + VEC2 = 295, + VEC3 = 296, + VEC4 = 297, + MAT2 = 298, + MAT3 = 299, + MAT4 = 300, + CENTROID = 301, + IN = 302, + OUT = 303, + INOUT = 304, + UNIFORM = 305, + PATCH = 306, + SAMPLE = 307, + BUFFER = 308, + SHARED = 309, + COHERENT = 310, + VOLATILE = 311, + RESTRICT = 312, + READONLY = 313, + WRITEONLY = 314, + DVEC2 = 315, + DVEC3 = 316, + DVEC4 = 317, + DMAT2 = 318, + DMAT3 = 319, + DMAT4 = 320, + NOPERSPECTIVE = 321, + FLAT = 322, + SMOOTH = 323, + LAYOUT = 324, + MAT2X2 = 325, + MAT2X3 = 326, + MAT2X4 = 327, + MAT3X2 = 328, + MAT3X3 = 329, + MAT3X4 = 330, + MAT4X2 = 331, + MAT4X3 = 332, + MAT4X4 = 333, + DMAT2X2 = 334, + DMAT2X3 = 335, + DMAT2X4 = 336, + DMAT3X2 = 337, + DMAT3X3 = 338, + DMAT3X4 = 339, + DMAT4X2 = 340, + DMAT4X3 = 341, + DMAT4X4 = 342, + ATOMIC_UINT = 343, + SAMPLER1D = 344, + SAMPLER2D = 345, + SAMPLER3D = 346, + SAMPLERCUBE = 347, + SAMPLER1DSHADOW = 348, + SAMPLER2DSHADOW = 349, + SAMPLERCUBESHADOW = 350, + SAMPLER1DARRAY = 351, + SAMPLER2DARRAY = 352, + SAMPLER1DARRAYSHADOW = 353, + SAMPLER2DARRAYSHADOW = 354, + ISAMPLER1D = 355, + ISAMPLER2D = 356, + ISAMPLER3D = 357, + ISAMPLERCUBE = 358, + ISAMPLER1DARRAY = 359, + ISAMPLER2DARRAY = 360, + USAMPLER1D = 361, + USAMPLER2D = 362, + USAMPLER3D = 363, + USAMPLERCUBE = 364, + USAMPLER1DARRAY = 365, + USAMPLER2DARRAY = 366, + SAMPLER2DRECT = 367, + SAMPLER2DRECTSHADOW = 368, + ISAMPLER2DRECT = 369, + USAMPLER2DRECT = 370, + SAMPLERBUFFER = 371, + ISAMPLERBUFFER = 372, + USAMPLERBUFFER = 373, + SAMPLERCUBEARRAY = 374, + SAMPLERCUBEARRAYSHADOW = 375, + ISAMPLERCUBEARRAY = 376, + USAMPLERCUBEARRAY = 377, + SAMPLER2DMS = 378, + ISAMPLER2DMS = 379, + USAMPLER2DMS = 380, + SAMPLER2DMSARRAY = 381, + ISAMPLER2DMSARRAY = 382, + USAMPLER2DMSARRAY = 383, + SAMPLEREXTERNALOES = 384, + SAMPLER = 385, + SAMPLERSHADOW = 386, + TEXTURE1D = 387, + TEXTURE2D = 388, + TEXTURE3D = 389, + TEXTURECUBE = 390, + TEXTURE1DARRAY = 391, + TEXTURE2DARRAY = 392, + ITEXTURE1D = 393, + ITEXTURE2D = 394, + ITEXTURE3D = 395, + ITEXTURECUBE = 396, + ITEXTURE1DARRAY = 397, + ITEXTURE2DARRAY = 398, + UTEXTURE1D = 399, + UTEXTURE2D = 400, + UTEXTURE3D = 401, + UTEXTURECUBE = 402, + UTEXTURE1DARRAY = 403, + UTEXTURE2DARRAY = 404, + TEXTURE2DRECT = 405, + ITEXTURE2DRECT = 406, + UTEXTURE2DRECT = 407, + TEXTUREBUFFER = 408, + ITEXTUREBUFFER = 409, + UTEXTUREBUFFER = 410, + TEXTURECUBEARRAY = 411, + ITEXTURECUBEARRAY = 412, + UTEXTURECUBEARRAY = 413, + TEXTURE2DMS = 414, + ITEXTURE2DMS = 415, + UTEXTURE2DMS = 416, + TEXTURE2DMSARRAY = 417, + ITEXTURE2DMSARRAY = 418, + UTEXTURE2DMSARRAY = 419, + SUBPASSINPUT = 420, + SUBPASSINPUTMS = 421, + ISUBPASSINPUT = 422, + ISUBPASSINPUTMS = 423, + USUBPASSINPUT = 424, + USUBPASSINPUTMS = 425, + IMAGE1D = 426, + IIMAGE1D = 427, + UIMAGE1D = 428, + IMAGE2D = 429, + IIMAGE2D = 430, + UIMAGE2D = 431, + IMAGE3D = 432, + IIMAGE3D = 433, + UIMAGE3D = 434, + IMAGE2DRECT = 435, + IIMAGE2DRECT = 436, + UIMAGE2DRECT = 437, + IMAGECUBE = 438, + IIMAGECUBE = 439, + UIMAGECUBE = 440, + IMAGEBUFFER = 441, + IIMAGEBUFFER = 442, + UIMAGEBUFFER = 443, + IMAGE1DARRAY = 444, + IIMAGE1DARRAY = 445, + UIMAGE1DARRAY = 446, + IMAGE2DARRAY = 447, + IIMAGE2DARRAY = 448, + UIMAGE2DARRAY = 449, + IMAGECUBEARRAY = 450, + IIMAGECUBEARRAY = 451, + UIMAGECUBEARRAY = 452, + IMAGE2DMS = 453, + IIMAGE2DMS = 454, + UIMAGE2DMS = 455, + IMAGE2DMSARRAY = 456, + IIMAGE2DMSARRAY = 457, + UIMAGE2DMSARRAY = 458, + STRUCT = 459, + VOID = 460, + WHILE = 461, + IDENTIFIER = 462, + TYPE_NAME = 463, + FLOATCONSTANT = 464, + DOUBLECONSTANT = 465, + INTCONSTANT = 466, + UINTCONSTANT = 467, + INT64CONSTANT = 468, + UINT64CONSTANT = 469, + BOOLCONSTANT = 470, + LEFT_OP = 471, + RIGHT_OP = 472, + INC_OP = 473, + DEC_OP = 474, + LE_OP = 475, + GE_OP = 476, + EQ_OP = 477, + NE_OP = 478, + AND_OP = 479, + OR_OP = 480, + XOR_OP = 481, + MUL_ASSIGN = 482, + DIV_ASSIGN = 483, + ADD_ASSIGN = 484, + MOD_ASSIGN = 485, + LEFT_ASSIGN = 486, + RIGHT_ASSIGN = 487, + AND_ASSIGN = 488, + XOR_ASSIGN = 489, + OR_ASSIGN = 490, + SUB_ASSIGN = 491, + LEFT_PAREN = 492, + RIGHT_PAREN = 493, + LEFT_BRACKET = 494, + RIGHT_BRACKET = 495, + LEFT_BRACE = 496, + RIGHT_BRACE = 497, + DOT = 498, + COMMA = 499, + COLON = 500, + EQUAL = 501, + SEMICOLON = 502, + BANG = 503, + DASH = 504, + TILDE = 505, + PLUS = 506, + STAR = 507, + SLASH = 508, + PERCENT = 509, + LEFT_ANGLE = 510, + RIGHT_ANGLE = 511, + VERTICAL_BAR = 512, + CARET = 513, + AMPERSAND = 514, + QUESTION = 515, + INVARIANT = 516, + PRECISE = 517, + HIGH_PRECISION = 518, + MEDIUM_PRECISION = 519, + LOW_PRECISION = 520, + PRECISION = 521, + PACKED = 522, + RESOURCE = 523, + SUPERP = 524 + }; #endif - +/* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef union YYSTYPE + +union YYSTYPE { -/* Line 2058 of yacc.c */ -#line 66 "C:/Projects/glslang/glslang/MachineIndependent/glslang.y" +#line 66 "MachineIndependent/glslang.y" /* yacc.c:1909 */ struct { glslang::TSourceLoc loc; @@ -319,6 +328,8 @@ typedef union YYSTYPE glslang::TString *string; int i; unsigned int u; + long long i64; + unsigned long long u64; bool b; double d; }; @@ -343,28 +354,16 @@ typedef union YYSTYPE }; } interm; +#line 358 "MachineIndependent/glslang_tab.cpp.h" /* yacc.c:1909 */ +}; -/* Line 2058 of yacc.c */ -#line 349 "C:/Projects/glslang/glslang/MachineIndependent/glslang_tab.cpp.h" -} YYSTYPE; +typedef union YYSTYPE YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 #endif -#ifdef YYPARSE_PARAM -#if defined __STDC__ || defined __cplusplus -int yyparse (void *YYPARSE_PARAM); -#else -int yyparse (); -#endif -#else /* ! YYPARSE_PARAM */ -#if defined __STDC__ || defined __cplusplus -int yyparse (glslang::TParseContext* pParseContext); -#else -int yyparse (); -#endif -#endif /* ! YYPARSE_PARAM */ -#endif /* !YY_YY_C_PROJECTS_GLSLANG_GLSLANG_MACHINEINDEPENDENT_GLSLANG_TAB_CPP_H_INCLUDED */ +int yyparse (glslang::TParseContext* pParseContext); + +#endif /* !YY_YY_MACHINEINDEPENDENT_GLSLANG_TAB_CPP_H_INCLUDED */ diff --git a/glslang/MachineIndependent/intermOut.cpp b/glslang/MachineIndependent/intermOut.cpp index eb6c30cd..d3d90c58 100644 --- a/glslang/MachineIndependent/intermOut.cpp +++ b/glslang/MachineIndependent/intermOut.cpp @@ -206,22 +206,44 @@ bool TOutputTraverser::visitUnary(TVisit /* visit */, TIntermUnary* node) case EOpConvUintToBool: out.debug << "Convert uint to bool"; break; case EOpConvFloatToBool: out.debug << "Convert float to bool"; break; case EOpConvDoubleToBool: out.debug << "Convert double to bool"; break; + case EOpConvInt64ToBool: out.debug << "Convert int64 to bool"; break; + case EOpConvUint64ToBool: out.debug << "Convert uint64 to bool"; break; case EOpConvIntToFloat: out.debug << "Convert int to float"; break; case EOpConvUintToFloat: out.debug << "Convert uint to float"; break; case EOpConvDoubleToFloat: out.debug << "Convert double to float"; break; + case EOpConvInt64ToFloat: out.debug << "Convert int64 to float"; break; + case EOpConvUint64ToFloat: out.debug << "Convert uint64 to float"; break; case EOpConvBoolToFloat: out.debug << "Convert bool to float"; break; case EOpConvUintToInt: out.debug << "Convert uint to int"; break; case EOpConvFloatToInt: out.debug << "Convert float to int"; break; case EOpConvDoubleToInt: out.debug << "Convert double to int"; break; case EOpConvBoolToInt: out.debug << "Convert bool to int"; break; + case EOpConvInt64ToInt: out.debug << "Convert int64 to int"; break; + case EOpConvUint64ToInt: out.debug << "Convert uint64 to int"; break; case EOpConvIntToUint: out.debug << "Convert int to uint"; break; case EOpConvFloatToUint: out.debug << "Convert float to uint"; break; case EOpConvDoubleToUint: out.debug << "Convert double to uint"; break; case EOpConvBoolToUint: out.debug << "Convert bool to uint"; break; + case EOpConvInt64ToUint: out.debug << "Convert int64 to uint"; break; + case EOpConvUint64ToUint: out.debug << "Convert uint64 to uint"; break; case EOpConvIntToDouble: out.debug << "Convert int to double"; break; case EOpConvUintToDouble: out.debug << "Convert uint to double"; break; case EOpConvFloatToDouble: out.debug << "Convert float to double"; break; case EOpConvBoolToDouble: out.debug << "Convert bool to double"; break; + case EOpConvInt64ToDouble: out.debug << "Convert int64 to double"; break; + case EOpConvUint64ToDouble: out.debug << "Convert uint64 to double"; break; + case EOpConvBoolToInt64: out.debug << "Convert bool to int64"; break; + case EOpConvIntToInt64: out.debug << "Convert int to int64"; break; + case EOpConvUintToInt64: out.debug << "Convert uint to int64"; break; + case EOpConvFloatToInt64: out.debug << "Convert float to int64"; break; + case EOpConvDoubleToInt64: out.debug << "Convert double to int64"; break; + case EOpConvUint64ToInt64: out.debug << "Convert uint64 to int64"; break; + case EOpConvBoolToUint64: out.debug << "Convert bool to uint64"; break; + case EOpConvIntToUint64: out.debug << "Convert int to uint64"; break; + case EOpConvUintToUint64: out.debug << "Convert uint to uint64"; break; + case EOpConvFloatToUint64: out.debug << "Convert float to uint64"; break; + case EOpConvDoubleToUint64: out.debug << "Convert double to uint64"; break; + case EOpConvInt64ToUint64: out.debug << "Convert uint64 to uint64"; break; case EOpRadians: out.debug << "radians"; break; case EOpDegrees: out.debug << "degrees"; break; @@ -261,6 +283,10 @@ bool TOutputTraverser::visitUnary(TVisit /* visit */, TIntermUnary* node) case EOpFloatBitsToUint:out.debug << "floatBitsToUint"; break; case EOpIntBitsToFloat: out.debug << "intBitsToFloat"; break; case EOpUintBitsToFloat:out.debug << "uintBitsToFloat"; break; + case EOpDoubleBitsToInt64: out.debug << "doubleBitsToInt64"; break; + case EOpDoubleBitsToUint64: out.debug << "doubleBitsToUint64"; break; + case EOpInt64BitsToDouble: out.debug << "int64BitsToDouble"; break; + case EOpUint64BitsToDouble: out.debug << "uint64BitsToDouble"; break; case EOpPackSnorm2x16: out.debug << "packSnorm2x16"; break; case EOpUnpackSnorm2x16:out.debug << "unpackSnorm2x16"; break; case EOpPackUnorm2x16: out.debug << "packUnorm2x16"; break; @@ -275,6 +301,11 @@ bool TOutputTraverser::visitUnary(TVisit /* visit */, TIntermUnary* node) case EOpPackDouble2x32: out.debug << "PackDouble2x32"; break; case EOpUnpackDouble2x32: out.debug << "UnpackDouble2x32"; break; + case EOpPackInt2x32: out.debug << "packInt2x32"; break; + case EOpUnpackInt2x32: out.debug << "unpackInt2x32"; break; + case EOpPackUint2x32: out.debug << "packUint2x32"; break; + case EOpUnpackUint2x32: out.debug << "unpackUint2x32"; break; + case EOpLength: out.debug << "length"; break; case EOpNormalize: out.debug << "normalize"; break; case EOpDPdx: out.debug << "dPdx"; break; @@ -320,6 +351,12 @@ bool TOutputTraverser::visitUnary(TVisit /* visit */, TIntermUnary* node) case EOpNoise: out.debug << "noise"; break; + case EOpBallot: out.debug << "ballot"; break; + case EOpReadFirstInvocation: out.debug << "readFirstInvocation"; break; + case EOpAnyInvocation: out.debug << "anyInvocation"; break; + case EOpAllInvocations: out.debug << "allInvocations"; break; + case EOpAllInvocationsEqual: out.debug << "allInvocationsEqual"; break; + default: out.debug.message(EPrefixError, "Bad unary op"); } @@ -366,6 +403,14 @@ bool TOutputTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node case EOpConstructUVec2: out.debug << "Construct uvec2"; break; case EOpConstructUVec3: out.debug << "Construct uvec3"; break; case EOpConstructUVec4: out.debug << "Construct uvec4"; break; + case EOpConstructInt64: out.debug << "Construct int64_t"; break; + case EOpConstructI64Vec2: out.debug << "Construct i64vec2"; break; + case EOpConstructI64Vec3: out.debug << "Construct i64vec3"; break; + case EOpConstructI64Vec4: out.debug << "Construct i64vec4"; break; + case EOpConstructUint64: out.debug << "Construct uint64_t"; break; + case EOpConstructU64Vec2: out.debug << "Construct u64vec2"; break; + case EOpConstructU64Vec3: out.debug << "Construct u64vec3"; break; + case EOpConstructU64Vec4: out.debug << "Construct u64vec4"; break; case EOpConstructMat2x2: out.debug << "Construct mat2"; break; case EOpConstructMat2x3: out.debug << "Construct mat2x3"; break; case EOpConstructMat2x4: out.debug << "Construct mat2x4"; break; @@ -427,6 +472,8 @@ bool TOutputTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node case EOpMemoryBarrierShared: out.debug << "MemoryBarrierShared"; break; case EOpGroupMemoryBarrier: out.debug << "GroupMemoryBarrier"; break; + case EOpReadInvocation: out.debug << "readInvocation"; break; + case EOpAtomicAdd: out.debug << "AtomicAdd"; break; case EOpAtomicMin: out.debug << "AtomicMin"; break; case EOpAtomicMax: out.debug << "AtomicMax"; break; @@ -582,6 +629,24 @@ static void OutputConstantUnion(TInfoSink& out, const TIntermTyped* node, const out.debug << buf << "\n"; } break; + case EbtInt64: + { + const int maxSize = 300; + char buf[maxSize]; + snprintf(buf, maxSize, "%lld (%s)", constUnion[i].getI64Const(), "const int64_t"); + + out.debug << buf << "\n"; + } + break; + case EbtUint64: + { + const int maxSize = 300; + char buf[maxSize]; + snprintf(buf, maxSize, "%llu (%s)", constUnion[i].getU64Const(), "const uint64_t"); + + out.debug << buf << "\n"; + } + break; default: out.info.message(EPrefixInternalError, "Unknown constant", node->getLoc()); break; diff --git a/glslang/MachineIndependent/linkValidate.cpp b/glslang/MachineIndependent/linkValidate.cpp index 6fef4fb7..1cda57d3 100644 --- a/glslang/MachineIndependent/linkValidate.cpp +++ b/glslang/MachineIndependent/linkValidate.cpp @@ -69,15 +69,23 @@ void TIntermediate::error(TInfoSink& infoSink, const char* message) // void TIntermediate::merge(TInfoSink& infoSink, TIntermediate& unit) { + if (source == EShSourceNone) + source = unit.source; + + if (source != unit.source) + error(infoSink, "can't link compilation units from different source languages"); + + if (source == EShSourceHlsl && unit.entryPoint.size() > 0) { + if (entryPoint.size() > 0) + error(infoSink, "can't handle multiple entry points per stage"); + else + entryPoint = unit.entryPoint; + } numMains += unit.numMains; numErrors += unit.numErrors; numPushConstants += unit.numPushConstants; callGraph.insert(callGraph.end(), unit.callGraph.begin(), unit.callGraph.end()); - if ((profile != EEsProfile && unit.profile == EEsProfile) || - (profile == EEsProfile && unit.profile != EEsProfile)) - error(infoSink, "Cannot mix ES profile with non-ES profile shaders\n"); - if (originUpperLeft != unit.originUpperLeft || pixelCenterInteger != unit.pixelCenterInteger) error(infoSink, "gl_FragCoord redeclarations must match across shaders\n"); @@ -297,6 +305,12 @@ void TIntermediate::mergeErrorCheck(TInfoSink& infoSink, const TIntermSymbol& sy writeTypeComparison = true; } + // Precise... + if (! crossStage && symbol.getQualifier().noContraction != unitSymbol.getQualifier().noContraction) { + error(infoSink, "Presence of precise qualifier must match:"); + writeTypeComparison = true; + } + // Auxiliary and interpolation... if (symbol.getQualifier().centroid != unitSymbol.getQualifier().centroid || symbol.getQualifier().smooth != unitSymbol.getQualifier().smooth || @@ -355,8 +369,8 @@ void TIntermediate::mergeErrorCheck(TInfoSink& infoSink, const TIntermSymbol& sy // Also, lock in defaults of things not set, including array sizes. // void TIntermediate::finalCheck(TInfoSink& infoSink) -{ - if (numMains < 1) +{ + if (source == EShSourceGlsl && numMains < 1) error(infoSink, "Missing entry point: Each stage requires one \"void main()\" entry point"); if (numPushConstants > 1) @@ -374,6 +388,8 @@ void TIntermediate::finalCheck(TInfoSink& infoSink) if (inIoAccessed("gl_ClipDistance") && inIoAccessed("gl_ClipVertex")) error(infoSink, "Can only use one of gl_ClipDistance or gl_ClipVertex (gl_ClipDistance is preferred)"); + if (inIoAccessed("gl_CullDistance") && inIoAccessed("gl_ClipVertex")) + error(infoSink, "Can only use one of gl_CullDistance or gl_ClipVertex (gl_ClipDistance is preferred)"); if (userOutputUsed() && (inIoAccessed("gl_FragColor") || inIoAccessed("gl_FragData"))) error(infoSink, "Cannot use gl_FragColor or gl_FragData when using user-defined outputs"); @@ -868,6 +884,8 @@ const int baseAlignmentVec4Std140 = 16; int TIntermediate::getBaseAlignmentScalar(const TType& type, int& size) { switch (type.getBasicType()) { + case EbtInt64: + case EbtUint64: case EbtDouble: size = 8; return 8; default: size = 4; return 4; } diff --git a/glslang/MachineIndependent/localintermediate.h b/glslang/MachineIndependent/localintermediate.h index 5e5a2e77..7445dee0 100644 --- a/glslang/MachineIndependent/localintermediate.h +++ b/glslang/MachineIndependent/localintermediate.h @@ -124,7 +124,8 @@ class TVariable; // class TIntermediate { public: - explicit TIntermediate(EShLanguage l, int v = 0, EProfile p = ENoProfile) : language(l), treeRoot(0), profile(p), version(v), spv(0), + explicit TIntermediate(EShLanguage l, int v = 0, EProfile p = ENoProfile) : + source(EShSourceNone), language(l), profile(p), version(v), spv(0), treeRoot(0), numMains(0), numErrors(0), numPushConstants(0), recursive(false), invocations(TQualifier::layoutNotSet), vertices(TQualifier::layoutNotSet), inputPrimitive(ElgNone), outputPrimitive(ElgNone), pixelCenterInteger(false), originUpperLeft(false), @@ -143,8 +144,12 @@ public: bool postProcess(TIntermNode*, EShLanguage); void output(TInfoSink&, bool tree); - void removeTree(); + void removeTree(); + void setSource(EShSource s) { source = s; } + EShSource getSource() const { return source; } + void setEntryPoint(const char* ep) { entryPoint = ep; } + const std::string& getEntryPoint() const { return entryPoint; } void setVersion(int v) { version = v; } int getVersion() const { return version; } void setProfile(EProfile p) { profile = p; } @@ -186,11 +191,14 @@ public: TIntermConstantUnion* addConstantUnion(const TConstUnionArray&, const TType&, const TSourceLoc&, bool literal = false) const; TIntermConstantUnion* addConstantUnion(int, const TSourceLoc&, bool literal = false) const; TIntermConstantUnion* addConstantUnion(unsigned int, const TSourceLoc&, bool literal = false) const; + TIntermConstantUnion* addConstantUnion(long long, const TSourceLoc&, bool literal = false) const; + TIntermConstantUnion* addConstantUnion(unsigned long long, const TSourceLoc&, bool literal = false) const; TIntermConstantUnion* addConstantUnion(bool, const TSourceLoc&, bool literal = false) const; TIntermConstantUnion* addConstantUnion(double, TBasicType, const TSourceLoc&, bool literal = false) const; TIntermTyped* promoteConstantUnion(TBasicType, TIntermConstantUnion*) const; bool parseConstTree(TIntermNode*, TConstUnionArray, TOperator, const TType&, bool singleConstantParam = false); TIntermLoop* addLoop(TIntermNode*, TIntermTyped*, TIntermTyped*, bool testFirst, const TSourceLoc&); + TIntermAggregate* addForLoop(TIntermNode*, TIntermNode*, TIntermTyped*, TIntermTyped*, bool testFirst, const TSourceLoc&); TIntermBranch* addBranch(TOperator, const TSourceLoc&); TIntermBranch* addBranch(TOperator, TIntermTyped*, const TSourceLoc&); TIntermTyped* addSwizzle(TVectorFields&, const TSourceLoc&); @@ -337,12 +345,15 @@ protected: TIntermSequence& findLinkerObjects() const; bool userOutputUsed() const; static int getBaseAlignmentScalar(const TType&, int& size); + bool isSpecializationOperation(const TIntermOperator&) const; - const EShLanguage language; - TIntermNode* treeRoot; + const EShLanguage language; // stage, known at construction time + EShSource source; // source language, known a bit later + std::string entryPoint; EProfile profile; int version; int spv; + TIntermNode* treeRoot; std::set requestedExtensions; // cumulation of all enabled or required extensions; not connected to what subset of the shader used them TBuiltInResource resources; int numMains; diff --git a/glslang/MachineIndependent/parseVersions.h b/glslang/MachineIndependent/parseVersions.h new file mode 100755 index 00000000..0eebb10a --- /dev/null +++ b/glslang/MachineIndependent/parseVersions.h @@ -0,0 +1,135 @@ +// +//Copyright (C) 2016 Google, Inc. +// +//All rights reserved. +// +//Redistribution and use in source and binary forms, with or without +//modification, are permitted provided that the following conditions +//are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +//POSSIBILITY OF SUCH DAMAGE. +// + +// This is implemented in Versions.cpp + +#ifndef _PARSE_VERSIONS_INCLUDED_ +#define _PARSE_VERSIONS_INCLUDED_ + +#include "../Public/ShaderLang.h" +#include "../Include/InfoSink.h" +#include "Scan.h" + +#include + +namespace glslang { + +// +// Base class for parse helpers. +// This just has version-related information and checking. +// This class should be sufficient for preprocessing. +// +class TParseVersions { +public: + TParseVersions(TIntermediate& interm, int version, EProfile profile, + int spv, int vulkan, EShLanguage language, TInfoSink& infoSink, + bool forwardCompatible, EShMessages messages) + : infoSink(infoSink), version(version), profile(profile), language(language), + spv(spv), vulkan(vulkan), forwardCompatible(forwardCompatible), + intermediate(interm), messages(messages), numErrors(0), currentScanner(0) { } + virtual ~TParseVersions() { } + virtual void initializeExtensionBehavior(); + virtual void requireProfile(const TSourceLoc&, int queryProfiles, const char* featureDesc); + virtual void profileRequires(const TSourceLoc&, int queryProfiles, int minVersion, int numExtensions, const char* const extensions[], const char* featureDesc); + virtual void profileRequires(const TSourceLoc&, int queryProfiles, int minVersion, const char* const extension, const char* featureDesc); + virtual void requireStage(const TSourceLoc&, EShLanguageMask, const char* featureDesc); + virtual void requireStage(const TSourceLoc&, EShLanguage, const char* featureDesc); + virtual void checkDeprecated(const TSourceLoc&, int queryProfiles, int depVersion, const char* featureDesc); + virtual void requireNotRemoved(const TSourceLoc&, int queryProfiles, int removedVersion, const char* featureDesc); + virtual void requireExtensions(const TSourceLoc&, int numExtensions, const char* const extensions[], const char* featureDesc); + virtual void ppRequireExtensions(const TSourceLoc&, int numExtensions, const char* const extensions[], const char* featureDesc); + virtual TExtensionBehavior getExtensionBehavior(const char*); + virtual bool extensionTurnedOn(const char* const extension); + virtual bool extensionsTurnedOn(int numExtensions, const char* const extensions[]); + virtual void updateExtensionBehavior(int line, const char* const extension, const char* behavior); + virtual void fullIntegerCheck(const TSourceLoc&, const char* op); + virtual void doubleCheck(const TSourceLoc&, const char* op); + virtual void int64Check(const TSourceLoc&, const char* op, bool builtIn = false); + virtual void spvRemoved(const TSourceLoc&, const char* op); + virtual void vulkanRemoved(const TSourceLoc&, const char* op); + virtual void requireVulkan(const TSourceLoc&, const char* op); + virtual void requireSpv(const TSourceLoc&, const char* op); + virtual bool checkExtensionsRequested(const TSourceLoc&, int numExtensions, const char* const extensions[], const char* featureDesc); + virtual void updateExtensionBehavior(const char* const extension, TExtensionBehavior); + + virtual void C_DECL error(const TSourceLoc&, const char* szReason, const char* szToken, + const char* szExtraInfoFormat, ...) = 0; + virtual void C_DECL warn(const TSourceLoc&, const char* szReason, const char* szToken, + const char* szExtraInfoFormat, ...) = 0; + virtual void C_DECL ppError(const TSourceLoc&, const char* szReason, const char* szToken, + const char* szExtraInfoFormat, ...) = 0; + virtual void C_DECL ppWarn(const TSourceLoc&, const char* szReason, const char* szToken, + const char* szExtraInfoFormat, ...) = 0; + + void addError() { ++numErrors; } + int getNumErrors() const { return numErrors; } + + void setScanner(TInputScanner* scanner) { currentScanner = scanner; } + TInputScanner* getScanner() const { return currentScanner; } + const TSourceLoc& getCurrentLoc() const { return currentScanner->getSourceLoc(); } + void setCurrentLine(int line) { currentScanner->setLine(line); } + void setCurrentColumn(int col) { currentScanner->setColumn(col); } + void setCurrentSourceName(const char* name) { currentScanner->setFile(name); } + void setCurrentString(int string) { currentScanner->setString(string); } + + void getPreamble(std::string&); + bool relaxedErrors() const { return (messages & EShMsgRelaxedErrors) != 0; } + bool suppressWarnings() const { return (messages & EShMsgSuppressWarnings) != 0; } + + TInfoSink& infoSink; + + // compilation mode + int version; // version, updated by #version in the shader + EProfile profile; // the declared profile in the shader (core by default) + EShLanguage language; // really the stage + int spv; // SPIR-V version; 0 means not SPIR-V + int vulkan; // Vulkan version; 0 means not vulkan + bool forwardCompatible; // true if errors are to be given for use of deprecated features + TIntermediate& intermediate; // helper for making and hooking up pieces of the parse tree + +protected: + EShMessages messages; // errors/warnings/rule-sets + int numErrors; // number of compile-time errors encountered + TInputScanner* currentScanner; + +private: + TMap extensionBehavior; // for each extension string, what its current behavior is set to + explicit TParseVersions(const TParseVersions&); + TParseVersions& operator=(const TParseVersions&); +}; + +} // end namespace glslang + +#endif // _PARSE_VERSIONS_INCLUDED_ diff --git a/glslang/MachineIndependent/preprocessor/Pp.cpp b/glslang/MachineIndependent/preprocessor/Pp.cpp index b9d00c8e..35097588 100644 --- a/glslang/MachineIndependent/preprocessor/Pp.cpp +++ b/glslang/MachineIndependent/preprocessor/Pp.cpp @@ -705,7 +705,8 @@ int TPpContext::CPPerror(TPpToken* ppToken) TSourceLoc loc = ppToken->loc; while (token != '\n' && token != EndOfInput) { - if (token == PpAtomConstInt || token == PpAtomConstUint || + if (token == PpAtomConstInt || token == PpAtomConstUint || + token == PpAtomConstInt64 || token == PpAtomConstUint64 || token == PpAtomConstFloat || token == PpAtomConstDouble) { message.append(ppToken->name); } else if (token == PpAtomIdentifier || token == PpAtomConstString) { @@ -736,6 +737,8 @@ int TPpContext::CPPpragma(TPpToken* ppToken) case PpAtomIdentifier: case PpAtomConstInt: case PpAtomConstUint: + case PpAtomConstInt64: + case PpAtomConstUint64: case PpAtomConstFloat: case PpAtomConstDouble: tokens.push_back(ppToken->name); diff --git a/glslang/MachineIndependent/preprocessor/PpContext.cpp b/glslang/MachineIndependent/preprocessor/PpContext.cpp index 37c2a5f2..6f0b8a9a 100644 --- a/glslang/MachineIndependent/preprocessor/PpContext.cpp +++ b/glslang/MachineIndependent/preprocessor/PpContext.cpp @@ -83,7 +83,7 @@ NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. namespace glslang { -TPpContext::TPpContext(TParseContext& pc, const std::string& rootFileName, TShader::Includer& inclr) : +TPpContext::TPpContext(TParseContextBase& pc, const std::string& rootFileName, TShader::Includer& inclr) : preamble(0), strings(0), parseContext(pc), includer(inclr), inComment(false), rootFileName(rootFileName), currentSourceFile(rootFileName) diff --git a/glslang/MachineIndependent/preprocessor/PpContext.h b/glslang/MachineIndependent/preprocessor/PpContext.h index b68c6916..4e47fa05 100644 --- a/glslang/MachineIndependent/preprocessor/PpContext.h +++ b/glslang/MachineIndependent/preprocessor/PpContext.h @@ -111,6 +111,7 @@ public: bool space; // true if a space (for white space or a removed comment) should also be recognized, in front of the token returned int ival; double dval; + long long i64val; int atom; char name[MaxTokenLength + 1]; }; @@ -122,7 +123,7 @@ class TInputScanner; // Don't expect too much in terms of OO design. class TPpContext { public: - TPpContext(TParseContext&, const std::string& rootFileName, TShader::Includer&); + TPpContext(TParseContextBase&, const std::string& rootFileName, TShader::Includer&); virtual ~TPpContext(); void setPreamble(const char* preamble, size_t length); @@ -214,7 +215,7 @@ protected: // Scanner data: int previous_token; - TParseContext& parseContext; + TParseContextBase& parseContext; // Get the next token from *stack* of input sources, popping input sources // that are out of tokens, down until an input sources is found that has a token. diff --git a/glslang/MachineIndependent/preprocessor/PpScanner.cpp b/glslang/MachineIndependent/preprocessor/PpScanner.cpp index 719365d4..b3d1af6d 100644 --- a/glslang/MachineIndependent/preprocessor/PpScanner.cpp +++ b/glslang/MachineIndependent/preprocessor/PpScanner.cpp @@ -238,9 +238,11 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken) int len = 0; int ch = 0; int ii = 0; - unsigned ival = 0; + unsigned long long ival = 0; + bool enableInt64 = pp->parseContext.version >= 450 && pp->parseContext.extensionTurnedOn(E_GL_ARB_gpu_shader_int64); ppToken->ival = 0; + ppToken->i64val = 0; ppToken->space = false; ch = getch(); for (;;) { @@ -299,6 +301,7 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken) // must be hexidecimal bool isUnsigned = false; + bool isInt64 = false; ppToken->name[len++] = (char)ch; ch = getch(); if ((ch >= '0' && ch <= '9') || @@ -307,7 +310,7 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken) ival = 0; do { - if (ival <= 0x0fffffff) { + if (ival <= 0x0fffffff || (enableInt64 && ival <= 0x0fffffffffffffffull)) { ppToken->name[len++] = (char)ch; if (ch >= '0' && ch <= '9') { ii = ch - '0'; @@ -323,7 +326,7 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken) pp->parseContext.ppError(ppToken->loc, "hexidecimal literal too big", "", ""); AlreadyComplained = 1; } - ival = 0xffffffff; + ival = 0xffffffffffffffffull; } ch = getch(); } while ((ch >= '0' && ch <= '9') || @@ -336,19 +339,37 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken) if (len < MaxTokenLength) ppToken->name[len++] = (char)ch; isUnsigned = true; + + if (enableInt64) { + int nextCh = getch(); + if ((ch == 'u' && nextCh == 'l') || (ch == 'U' && nextCh == 'L')) { + if (len < MaxTokenLength) + ppToken->name[len++] = (char)nextCh; + isInt64 = true; + } else + ungetch(); + } + } + else if (enableInt64 && (ch == 'l' || ch == 'L')) { + if (len < MaxTokenLength) + ppToken->name[len++] = (char)ch; + isInt64 = true; } else ungetch(); ppToken->name[len] = '\0'; - ppToken->ival = (int)ival; - if (isUnsigned) - return PpAtomConstUint; - else - return PpAtomConstInt; + if (isInt64) { + ppToken->i64val = ival; + return isUnsigned ? PpAtomConstUint64 : PpAtomConstInt64; + } else { + ppToken->ival = (int)ival; + return isUnsigned ? PpAtomConstUint : PpAtomConstInt; + } } else { // could be octal integer or floating point, speculative pursue octal until it must be floating point bool isUnsigned = false; + bool isInt64 = false; bool octalOverflow = false; bool nonOctal = false; ival = 0; @@ -361,7 +382,7 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken) pp->parseContext.ppError(ppToken->loc, "numeric literal too long", "", ""); AlreadyComplained = 1; } - if (ival <= 0x1fffffff) { + if (ival <= 0x1fffffff || (enableInt64 && ival <= 0x1fffffffffffffffull)) { ii = ch - '0'; ival = (ival << 3) | ii; } else @@ -382,7 +403,7 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken) ch = getch(); } while (ch >= '0' && ch <= '9'); } - if (ch == '.' || ch == 'e' || ch == 'f' || ch == 'E' || ch == 'F' || ch == 'l' || ch == 'L') + if (ch == '.' || ch == 'e' || ch == 'f' || ch == 'E' || ch == 'F') return pp->lFloatConst(len, ch, ppToken); // wasn't a float, so must be octal... @@ -393,6 +414,21 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken) if (len < MaxTokenLength) ppToken->name[len++] = (char)ch; isUnsigned = true; + + if (enableInt64) { + int nextCh = getch(); + if ((ch == 'u' && nextCh == 'l') || (ch == 'U' && nextCh == 'L')) { + if (len < MaxTokenLength) + ppToken->name[len++] = (char)nextCh; + isInt64 = true; + } else + ungetch(); + } + } + else if (enableInt64 && (ch == 'l' || ch == 'L')) { + if (len < MaxTokenLength) + ppToken->name[len++] = (char)ch; + isInt64 = true; } else ungetch(); ppToken->name[len] = '\0'; @@ -400,12 +436,13 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken) if (octalOverflow) pp->parseContext.ppError(ppToken->loc, "octal literal too big", "", ""); - ppToken->ival = (int)ival; - - if (isUnsigned) - return PpAtomConstUint; - else - return PpAtomConstInt; + if (isInt64) { + ppToken->i64val = ival; + return isUnsigned ? PpAtomConstUint64 : PpAtomConstInt64; + } else { + ppToken->ival = (int)ival; + return isUnsigned ? PpAtomConstUint : PpAtomConstInt; + } } break; case '1': case '2': case '3': case '4': @@ -421,16 +458,31 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken) } ch = getch(); } while (ch >= '0' && ch <= '9'); - if (ch == '.' || ch == 'e' || ch == 'f' || ch == 'E' || ch == 'F' || ch == 'l' || ch == 'L') { + if (ch == '.' || ch == 'e' || ch == 'f' || ch == 'E' || ch == 'F') { return pp->lFloatConst(len, ch, ppToken); } else { // Finish handling signed and unsigned integers int numericLen = len; - bool uint = false; + bool isUnsigned = false; + bool isInt64 = false; if (ch == 'u' || ch == 'U') { if (len < MaxTokenLength) ppToken->name[len++] = (char)ch; - uint = true; + isUnsigned = true; + + if (enableInt64) { + int nextCh = getch(); + if ((ch == 'u' && nextCh == 'l') || (ch == 'U' && nextCh == 'L')) { + if (len < MaxTokenLength) + ppToken->name[len++] = (char)nextCh; + isInt64 = true; + } else + ungetch(); + } + } else if (enableInt64 && (ch == 'l' || ch == 'L')) { + if (len < MaxTokenLength) + ppToken->name[len++] = (char)ch; + isInt64 = true; } else ungetch(); @@ -438,21 +490,26 @@ int TPpContext::tStringInput::scan(TPpToken* ppToken) ival = 0; const unsigned oneTenthMaxInt = 0xFFFFFFFFu / 10; const unsigned remainderMaxInt = 0xFFFFFFFFu - 10 * oneTenthMaxInt; + const unsigned long long oneTenthMaxInt64 = 0xFFFFFFFFFFFFFFFFull / 10; + const unsigned long long remainderMaxInt64 = 0xFFFFFFFFFFFFFFFFull - 10 * oneTenthMaxInt64; for (int i = 0; i < numericLen; i++) { ch = ppToken->name[i] - '0'; - if ((ival > oneTenthMaxInt) || (ival == oneTenthMaxInt && (unsigned)ch > remainderMaxInt)) { + if ((enableInt64 == false && ((ival > oneTenthMaxInt) || (ival == oneTenthMaxInt && (unsigned)ch > remainderMaxInt))) || + (enableInt64 && ((ival > oneTenthMaxInt64) || (ival == oneTenthMaxInt64 && (unsigned long long)ch > remainderMaxInt64)))) { pp->parseContext.ppError(ppToken->loc, "numeric literal too big", "", ""); - ival = 0xFFFFFFFFu; + ival = 0xFFFFFFFFFFFFFFFFull; break; } else ival = ival * 10 + ch; } - ppToken->ival = (int)ival; - if (uint) - return PpAtomConstUint; - else - return PpAtomConstInt; + if (isInt64) { + ppToken->i64val = ival; + return isUnsigned ? PpAtomConstUint64 : PpAtomConstInt64; + } else { + ppToken->ival = (int)ival; + return isUnsigned ? PpAtomConstUint : PpAtomConstInt; + } } break; case '-': @@ -686,6 +743,8 @@ const char* TPpContext::tokenize(TPpToken* ppToken) case PpAtomConstInt: case PpAtomConstUint: case PpAtomConstFloat: + case PpAtomConstInt64: + case PpAtomConstUint64: case PpAtomConstDouble: tokenString = ppToken->name; break; diff --git a/glslang/MachineIndependent/preprocessor/PpTokens.cpp b/glslang/MachineIndependent/preprocessor/PpTokens.cpp index 52343b7c..54d495e1 100644 --- a/glslang/MachineIndependent/preprocessor/PpTokens.cpp +++ b/glslang/MachineIndependent/preprocessor/PpTokens.cpp @@ -141,6 +141,8 @@ void TPpContext::RecordToken(TokenStream *pTok, int token, TPpToken* ppToken) break; case PpAtomConstInt: case PpAtomConstUint: + case PpAtomConstInt64: + case PpAtomConstUint64: case PpAtomConstFloat: case PpAtomConstDouble: str = ppToken->name; @@ -193,6 +195,8 @@ int TPpContext::ReadToken(TokenStream *pTok, TPpToken *ppToken) case PpAtomConstDouble: case PpAtomConstInt: case PpAtomConstUint: + case PpAtomConstInt64: + case PpAtomConstUint64: len = 0; ch = lReadByte(pTok); while (ch != 0 && ch != EndOfInput) { @@ -227,6 +231,16 @@ int TPpContext::ReadToken(TokenStream *pTok, TPpToken *ppToken) } else ppToken->ival = atoi(ppToken->name); break; + case PpAtomConstInt64: + case PpAtomConstUint64: + if (len > 0 && tokenText[0] == '0') { + if (len > 1 && (tokenText[1] == 'x' || tokenText[1] == 'X')) + ppToken->i64val = strtoll(ppToken->name, nullptr, 16); + else + ppToken->i64val = strtoll(ppToken->name, nullptr, 8); + } else + ppToken->i64val = atoll(ppToken->name); + break; } } diff --git a/glslang/MachineIndependent/preprocessor/PpTokens.h b/glslang/MachineIndependent/preprocessor/PpTokens.h index 391b04ad..87f0eb1a 100644 --- a/glslang/MachineIndependent/preprocessor/PpTokens.h +++ b/glslang/MachineIndependent/preprocessor/PpTokens.h @@ -119,6 +119,8 @@ enum EFixedAtoms { PpAtomConstInt, PpAtomConstUint, + PpAtomConstInt64, + PpAtomConstUint64, PpAtomConstFloat, PpAtomConstDouble, PpAtomConstString, diff --git a/glslang/MachineIndependent/propagateNoContraction.cpp b/glslang/MachineIndependent/propagateNoContraction.cpp new file mode 100644 index 00000000..835f57f6 --- /dev/null +++ b/glslang/MachineIndependent/propagateNoContraction.cpp @@ -0,0 +1,859 @@ +// +// Copyright (C) 2015-2016 Google, Inc. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. + +// +// Visit the nodes in the glslang intermediate tree representation to +// propagate the 'noContraction' qualifier. +// + +#include "propagateNoContraction.h" + +#include +#include +#include +#include +#include + +#include "localintermediate.h" +namespace { + +// Use a string to hold the access chain information, as in most cases the +// access chain is short and may contain only one element, which is the symbol +// ID. +// Example: struct {float a; float b;} s; +// Object s.a will be represented with: /0 +// Object s.b will be represented with: /1 +// Object s will be represented with: +// For members of vector, matrix and arrays, they will be represented with the +// same symbol ID of their container symbol objects. This is because their +// preciseness is always the same as their container symbol objects. +typedef std::string ObjectAccessChain; + +// The delimiter used in the ObjectAccessChain string to separate symbol ID and +// different level of struct indices. +const char ObjectAccesschainDelimiter = '/'; + +// Mapping from Symbol IDs of symbol nodes, to their defining operation +// nodes. +typedef std::unordered_multimap NodeMapping; +// Mapping from object nodes to their access chain info string. +typedef std::unordered_map AccessChainMapping; + +// Set of object IDs. +typedef std::unordered_set ObjectAccesschainSet; +// Set of return branch nodes. +typedef std::unordered_set ReturnBranchNodeSet; + +// A helper function to tell whether a node is 'noContraction'. Returns true if +// the node has 'noContraction' qualifier, otherwise false. +bool isPreciseObjectNode(glslang::TIntermTyped* node) +{ + return node->getType().getQualifier().noContraction; +} + +// Returns true if the opcode is a dereferencing one. +bool isDereferenceOperation(glslang::TOperator op) +{ + switch (op) { + case glslang::EOpIndexDirect: + case glslang::EOpIndexDirectStruct: + case glslang::EOpIndexIndirect: + case glslang::EOpVectorSwizzle: + return true; + default: + return false; + } +} + +// Returns true if the opcode leads to an assignment operation. +bool isAssignOperation(glslang::TOperator op) +{ + switch (op) { + case glslang::EOpAssign: + case glslang::EOpAddAssign: + case glslang::EOpSubAssign: + case glslang::EOpMulAssign: + case glslang::EOpVectorTimesMatrixAssign: + case glslang::EOpVectorTimesScalarAssign: + case glslang::EOpMatrixTimesScalarAssign: + case glslang::EOpMatrixTimesMatrixAssign: + case glslang::EOpDivAssign: + case glslang::EOpModAssign: + case glslang::EOpAndAssign: + case glslang::EOpLeftShiftAssign: + case glslang::EOpRightShiftAssign: + case glslang::EOpInclusiveOrAssign: + case glslang::EOpExclusiveOrAssign: + + case glslang::EOpPostIncrement: + case glslang::EOpPostDecrement: + case glslang::EOpPreIncrement: + case glslang::EOpPreDecrement: + return true; + default: + return false; + } +} + +// A helper function to get the unsigned int from a given constant union node. +// Note the node should only hold a uint scalar. +unsigned getStructIndexFromConstantUnion(glslang::TIntermTyped* node) +{ + assert(node->getAsConstantUnion() && node->getAsConstantUnion()->isScalar()); + unsigned struct_dereference_index = node->getAsConstantUnion()->getConstArray()[0].getUConst(); + return struct_dereference_index; +} + +// A helper function to generate symbol_label. +ObjectAccessChain generateSymbolLabel(glslang::TIntermSymbol* node) +{ + ObjectAccessChain symbol_id = + std::to_string(node->getId()) + "(" + node->getName().c_str() + ")"; + return symbol_id; +} + +// Returns true if the operation is an arithmetic operation and valid for +// the 'NoContraction' decoration. +bool isArithmeticOperation(glslang::TOperator op) +{ + switch (op) { + case glslang::EOpAddAssign: + case glslang::EOpSubAssign: + case glslang::EOpMulAssign: + case glslang::EOpVectorTimesMatrixAssign: + case glslang::EOpVectorTimesScalarAssign: + case glslang::EOpMatrixTimesScalarAssign: + case glslang::EOpMatrixTimesMatrixAssign: + case glslang::EOpDivAssign: + case glslang::EOpModAssign: + + case glslang::EOpNegative: + + case glslang::EOpAdd: + case glslang::EOpSub: + case glslang::EOpMul: + case glslang::EOpDiv: + case glslang::EOpMod: + + case glslang::EOpVectorTimesScalar: + case glslang::EOpVectorTimesMatrix: + case glslang::EOpMatrixTimesVector: + case glslang::EOpMatrixTimesScalar: + case glslang::EOpMatrixTimesMatrix: + + case glslang::EOpDot: + + case glslang::EOpPostIncrement: + case glslang::EOpPostDecrement: + case glslang::EOpPreIncrement: + case glslang::EOpPreDecrement: + return true; + default: + return false; + } +} + +// A helper class to help manage the populating_initial_no_contraction_ flag. +template class StateSettingGuard { +public: + StateSettingGuard(T* state_ptr, T new_state_value) + : state_ptr_(state_ptr), previous_state_(*state_ptr) + { + *state_ptr = new_state_value; + } + StateSettingGuard(T* state_ptr) : state_ptr_(state_ptr), previous_state_(*state_ptr) {} + void setState(T new_state_value) { *state_ptr_ = new_state_value; } + ~StateSettingGuard() { *state_ptr_ = previous_state_; } + +private: + T* state_ptr_; + T previous_state_; +}; + +// A helper function to get the front element from a given ObjectAccessChain +ObjectAccessChain getFrontElement(const ObjectAccessChain& chain) +{ + size_t pos_delimiter = chain.find(ObjectAccesschainDelimiter); + return pos_delimiter == std::string::npos ? chain : chain.substr(0, pos_delimiter); +} + +// A helper function to get the access chain starting from the second element. +ObjectAccessChain subAccessChainFromSecondElement(const ObjectAccessChain& chain) +{ + size_t pos_delimiter = chain.find(ObjectAccesschainDelimiter); + return pos_delimiter == std::string::npos ? "" : chain.substr(pos_delimiter + 1); +} + +// A helper function to get the access chain after removing a given prefix. +ObjectAccessChain getSubAccessChainAfterPrefix(const ObjectAccessChain& chain, + const ObjectAccessChain& prefix) +{ + size_t pos = chain.find(prefix); + if (pos != 0) + return chain; + return chain.substr(prefix.length() + sizeof(ObjectAccesschainDelimiter)); +} + +// +// A traverser which traverses the whole AST and populates: +// 1) A mapping from symbol nodes' IDs to their defining operation nodes. +// 2) A set of access chains of the initial precise object nodes. +// +class TSymbolDefinitionCollectingTraverser : public glslang::TIntermTraverser { +public: + TSymbolDefinitionCollectingTraverser(NodeMapping* symbol_definition_mapping, + AccessChainMapping* accesschain_mapping, + ObjectAccesschainSet* precise_objects, + ReturnBranchNodeSet* precise_return_nodes); + + bool visitUnary(glslang::TVisit, glslang::TIntermUnary*) override; + bool visitBinary(glslang::TVisit, glslang::TIntermBinary*) override; + void visitSymbol(glslang::TIntermSymbol*) override; + bool visitAggregate(glslang::TVisit, glslang::TIntermAggregate*) override; + bool visitBranch(glslang::TVisit, glslang::TIntermBranch*) override; + +protected: + // The mapping from symbol node IDs to their defining nodes. This should be + // populated along traversing the AST. + NodeMapping& symbol_definition_mapping_; + // The set of symbol node IDs for precise symbol nodes, the ones marked as + // 'noContraction'. + ObjectAccesschainSet& precise_objects_; + // The set of precise return nodes. + ReturnBranchNodeSet& precise_return_nodes_; + // A temporary cache of the symbol node whose defining node is to be found + // currently along traversing the AST. + ObjectAccessChain current_object_; + // A map from object node to its access chain. This traverser stores + // the built access chains into this map for each object node it has + // visited. + AccessChainMapping& accesschain_mapping_; + // The pointer to the Function Definition node, so we can get the + // preciseness of the return expression from it when we traverse the + // return branch node. + glslang::TIntermAggregate* current_function_definition_node_; +}; + +TSymbolDefinitionCollectingTraverser::TSymbolDefinitionCollectingTraverser( + NodeMapping* symbol_definition_mapping, AccessChainMapping* accesschain_mapping, + ObjectAccesschainSet* precise_objects, + std::unordered_set* precise_return_nodes) + : TIntermTraverser(true, false, false), symbol_definition_mapping_(*symbol_definition_mapping), + precise_objects_(*precise_objects), current_object_(), + accesschain_mapping_(*accesschain_mapping), current_function_definition_node_(nullptr), + precise_return_nodes_(*precise_return_nodes) {} + +// Visits a symbol node, set the current_object_ to the +// current node symbol ID, and record a mapping from this node to the current +// current_object_, which is the just obtained symbol +// ID. +void TSymbolDefinitionCollectingTraverser::visitSymbol(glslang::TIntermSymbol* node) +{ + current_object_ = generateSymbolLabel(node); + accesschain_mapping_[node] = current_object_; +} + +// Visits an aggregate node, traverses all of its children. +bool TSymbolDefinitionCollectingTraverser::visitAggregate(glslang::TVisit, + glslang::TIntermAggregate* node) +{ + // This aggregate node might be a function definition node, in which case we need to + // cache this node, so we can get the preciseness information of the return value + // of this function later. + StateSettingGuard current_function_definition_node_setting_guard( + ¤t_function_definition_node_); + if (node->getOp() == glslang::EOpFunction) { + // This is function definition node, we need to cache this node so that we can + // get the preciseness of the return value later. + current_function_definition_node_setting_guard.setState(node); + } + // Traverse the items in the sequence. + glslang::TIntermSequence& seq = node->getSequence(); + for (int i = 0; i < (int)seq.size(); ++i) { + current_object_.clear(); + seq[i]->traverse(this); + } + return false; +} + +bool TSymbolDefinitionCollectingTraverser::visitBranch(glslang::TVisit, + glslang::TIntermBranch* node) +{ + if (node->getFlowOp() == glslang::EOpReturn && node->getExpression() && + current_function_definition_node_ && + current_function_definition_node_->getType().getQualifier().noContraction) { + // This node is a return node with an expression, and its function has a + // precise return value. We need to find the involved objects in its + // expression and add them to the set of initial precise objects. + precise_return_nodes_.insert(node); + node->getExpression()->traverse(this); + } + return false; +} + +// Visits a unary node. This might be an implicit assignment like i++, i--. etc. +bool TSymbolDefinitionCollectingTraverser::visitUnary(glslang::TVisit /* visit */, + glslang::TIntermUnary* node) +{ + current_object_.clear(); + node->getOperand()->traverse(this); + if (isAssignOperation(node->getOp())) { + // We should always be able to get an access chain of the operand node. + assert(!current_object_.empty()); + + // If the operand node object is 'precise', we collect its access chain + // for the initial set of 'precise' objects. + if (isPreciseObjectNode(node->getOperand())) { + // The operand node is an 'precise' object node, add its + // access chain to the set of 'precise' objects. This is to collect + // the initial set of 'precise' objects. + precise_objects_.insert(current_object_); + } + // Gets the symbol ID from the object's access chain. + ObjectAccessChain id_symbol = getFrontElement(current_object_); + // Add a mapping from the symbol ID to this assignment operation node. + symbol_definition_mapping_.insert(std::make_pair(id_symbol, node)); + } + // A unary node is not a dereference node, so we clear the access chain which + // is under construction. + current_object_.clear(); + return false; +} + +// Visits a binary node and updates the mapping from symbol IDs to the definition +// nodes. Also collects the access chains for the initial precise objects. +bool TSymbolDefinitionCollectingTraverser::visitBinary(glslang::TVisit /* visit */, + glslang::TIntermBinary* node) +{ + // Traverses the left node to build the access chain info for the object. + current_object_.clear(); + node->getLeft()->traverse(this); + + if (isAssignOperation(node->getOp())) { + // We should always be able to get an access chain for the left node. + assert(!current_object_.empty()); + + // If the left node object is 'precise', it is an initial precise object + // specified in the shader source. Adds it to the initial work list to + // process later. + if (isPreciseObjectNode(node->getLeft())) { + // The left node is an 'precise' object node, add its access chain to + // the set of 'precise' objects. This is to collect the initial set + // of 'precise' objects. + precise_objects_.insert(current_object_); + } + // Gets the symbol ID from the object access chain, which should be the + // first element recorded in the access chain. + ObjectAccessChain id_symbol = getFrontElement(current_object_); + // Adds a mapping from the symbol ID to this assignment operation node. + symbol_definition_mapping_.insert(std::make_pair(id_symbol, node)); + + // Traverses the right node, there may be other 'assignment' + // operations in the right. + current_object_.clear(); + node->getRight()->traverse(this); + + } else if (isDereferenceOperation(node->getOp())) { + // The left node (parent node) is a struct type object. We need to + // record the access chain information of the current node into its + // object id. + if (node->getOp() == glslang::EOpIndexDirectStruct) { + unsigned struct_dereference_index = getStructIndexFromConstantUnion(node->getRight()); + current_object_.push_back(ObjectAccesschainDelimiter); + current_object_.append(std::to_string(struct_dereference_index)); + } + accesschain_mapping_[node] = current_object_; + + // For a dereference node, there is no need to traverse the right child + // node as the right node should always be an integer type object. + + } else { + // For other binary nodes, still traverse the right node. + current_object_.clear(); + node->getRight()->traverse(this); + } + return false; +} + +// Traverses the AST and returns a tuple of four members: +// 1) a mapping from symbol IDs to the definition nodes (aka. assignment nodes) of these symbols. +// 2) a mapping from object nodes in the AST to the access chains of these objects. +// 3) a set of access chains of precise objects. +// 4) a set of return nodes with precise expressions. +std::tuple +getSymbolToDefinitionMappingAndPreciseSymbolIDs(const glslang::TIntermediate& intermediate) +{ + auto result_tuple = std::make_tuple(NodeMapping(), AccessChainMapping(), ObjectAccesschainSet(), + ReturnBranchNodeSet()); + + TIntermNode* root = intermediate.getTreeRoot(); + if (root == 0) + return result_tuple; + + NodeMapping& symbol_definition_mapping = std::get<0>(result_tuple); + AccessChainMapping& accesschain_mapping = std::get<1>(result_tuple); + ObjectAccesschainSet& precise_objects = std::get<2>(result_tuple); + ReturnBranchNodeSet& precise_return_nodes = std::get<3>(result_tuple); + + // Traverses the AST and populate the results. + TSymbolDefinitionCollectingTraverser collector(&symbol_definition_mapping, &accesschain_mapping, + &precise_objects, &precise_return_nodes); + root->traverse(&collector); + + return result_tuple; +} + +// +// A traverser that determine whether the left node (or operand node for unary +// node) of an assignment node is 'precise', containing 'precise' or not, +// according to the access chain a given precise object which share the same +// symbol as the left node. +// +// Post-orderly traverses the left node subtree of an binary assignment node and: +// +// 1) Propagates the 'precise' from the left object nodes to this object node. +// +// 2) Builds object access chain along the traversal, and also compares with +// the access chain of the given 'precise' object along with the traversal to +// tell if the node to be defined is 'precise' or not. +// +class TNoContractionAssigneeCheckingTraverser : public glslang::TIntermTraverser { + + enum DecisionStatus { + // The object node to be assigned to may contain 'precise' objects and also not 'precise' objects. + Mixed = 0, + // The object node to be assigned to is either a 'precise' object or a struct objects whose members are all 'precise'. + Precise = 1, + // The object node to be assigned to is not a 'precise' object. + NotPreicse = 2, + }; + +public: + TNoContractionAssigneeCheckingTraverser(const AccessChainMapping& accesschain_mapping) + : TIntermTraverser(true, false, false), accesschain_mapping_(accesschain_mapping), + precise_object_(nullptr) {} + + // Checks the preciseness of a given assignment node with a precise object + // represented as access chain. The precise object shares the same symbol + // with the assignee of the given assignment node. Return a tuple of two: + // + // 1) The preciseness of the assignee node of this assignment node. True + // if the assignee contains 'precise' objects or is 'precise', false if + // the assignee is not 'precise' according to the access chain of the given + // precise object. + // + // 2) The incremental access chain from the assignee node to its nested + // 'precise' object, according to the access chain of the given precise + // object. This incremental access chain can be empty, which means the + // assignee is 'precise'. Otherwise it shows the path to the nested + // precise object. + std::tuple + getPrecisenessAndRemainedAccessChain(glslang::TIntermOperator* node, + const ObjectAccessChain& precise_object) + { + assert(isAssignOperation(node->getOp())); + precise_object_ = &precise_object; + ObjectAccessChain assignee_object; + if (glslang::TIntermBinary* BN = node->getAsBinaryNode()) { + // This is a binary assignment node, we need to check the + // preciseness of the left node. + assert(accesschain_mapping_.count(BN->getLeft())); + // The left node (assignee node) is an object node, traverse the + // node to let the 'precise' of nesting objects being transfered to + // nested objects. + BN->getLeft()->traverse(this); + // After traversing the left node, if the left node is 'precise', + // we can conclude this assignment should propagate 'precise'. + if (isPreciseObjectNode(BN->getLeft())) { + return make_tuple(true, ObjectAccessChain()); + } + // If the preciseness of the left node (assignee node) can not + // be determined by now, we need to compare the access chain string + // of the assignee object with the given precise object. + assignee_object = accesschain_mapping_.at(BN->getLeft()); + + } else if (glslang::TIntermUnary* UN = node->getAsUnaryNode()) { + // This is a unary assignment node, we need to check the + // preciseness of the operand node. For unary assignment node, the + // operand node should always be an object node. + assert(accesschain_mapping_.count(UN->getOperand())); + // Traverse the operand node to let the 'precise' being propagated + // from lower nodes to upper nodes. + UN->getOperand()->traverse(this); + // After traversing the operand node, if the operand node is + // 'precise', this assignment should propagate 'precise'. + if (isPreciseObjectNode(UN->getOperand())) { + return make_tuple(true, ObjectAccessChain()); + } + // If the preciseness of the operand node (assignee node) can not + // be determined by now, we need to compare the access chain string + // of the assignee object with the given precise object. + assignee_object = accesschain_mapping_.at(UN->getOperand()); + } else { + // Not a binary or unary node, should not happen. + assert(false); + } + + // Compare the access chain string of the assignee node with the given + // precise object to determine if this assignment should propagate + // 'precise'. + if (assignee_object.find(precise_object) == 0) { + // The access chain string of the given precise object is a prefix + // of assignee's access chain string. The assignee should be + // 'precise'. + return make_tuple(true, ObjectAccessChain()); + } else if (precise_object.find(assignee_object) == 0) { + // The assignee's access chain string is a prefix of the given + // precise object, the assignee object contains 'precise' object, + // and we need to pass the remained access chain to the object nodes + // in the right. + return make_tuple(true, getSubAccessChainAfterPrefix(precise_object, assignee_object)); + } else { + // The access chain strings do not match, the assignee object can + // not be labeled as 'precise' according to the given precise + // object. + return make_tuple(false, ObjectAccessChain()); + } + } + +protected: + bool visitBinary(glslang::TVisit, glslang::TIntermBinary* node) override; + void visitSymbol(glslang::TIntermSymbol* node) override; + + // A map from object nodes to their access chain string (used as object ID). + const AccessChainMapping& accesschain_mapping_; + // A given precise object, represented in it access chain string. This + // precise object is used to be compared with the assignee node to tell if + // the assignee node is 'precise', contains 'precise' object or not + // 'precise'. + const ObjectAccessChain* precise_object_; +}; + +// Visits a binary node. If the node is an object node, it must be a dereference +// node. In such cases, if the left node is 'precise', this node should also be +// 'precise'. +bool TNoContractionAssigneeCheckingTraverser::visitBinary(glslang::TVisit, + glslang::TIntermBinary* node) +{ + // Traverses the left so that we transfer the 'precise' from nesting object + // to its nested object. + node->getLeft()->traverse(this); + // If this binary node is an object node, we should have it in the + // accesschain_mapping_. + if (accesschain_mapping_.count(node)) { + // A binary object node must be a dereference node. + assert(isDereferenceOperation(node->getOp())); + // If the left node is 'precise', this node should also be precise, + // otherwise, compare with the given precise_object_. If the + // access chain of this node matches with the given precise_object_, + // this node should be marked as 'precise'. + if (isPreciseObjectNode(node->getLeft())) { + node->getWritableType().getQualifier().noContraction = true; + } else if (accesschain_mapping_.at(node) == *precise_object_) { + node->getWritableType().getQualifier().noContraction = true; + } + } + return false; +} + +// Visits a symbol node, if the symbol node ID (its access chain string) matches +// with the given precise object, this node should be 'precise'. +void TNoContractionAssigneeCheckingTraverser::visitSymbol(glslang::TIntermSymbol* node) +{ + // A symbol node should always be an object node, and should have been added + // to the map from object nodes to their access chain strings. + assert(accesschain_mapping_.count(node)); + if (accesschain_mapping_.at(node) == *precise_object_) { + node->getWritableType().getQualifier().noContraction = true; + } +} + +// +// A traverser that only traverses the right side of binary assignment nodes +// and the operand node of unary assignment nodes. +// +// 1) Marks arithmetic operations as 'NoContraction'. +// +// 2) Find the object which should be marked as 'precise' in the right and +// update the 'precise' object work list. +// +class TNoContractionPropagator : public glslang::TIntermTraverser { +public: + TNoContractionPropagator(ObjectAccesschainSet* precise_objects, + const AccessChainMapping& accesschain_mapping) + : TIntermTraverser(true, false, false), remained_accesschain_(), + precise_objects_(*precise_objects), accesschain_mapping_(accesschain_mapping), + added_precise_object_ids_() {} + + // Propagates 'precise' in the right nodes of a given assignment node with + // access chain record from the assignee node to a 'precise' object it + // contains. + void + propagateNoContractionInOneExpression(glslang::TIntermTyped* defining_node, + const ObjectAccessChain& assignee_remained_accesschain) + { + remained_accesschain_ = assignee_remained_accesschain; + if (glslang::TIntermBinary* BN = defining_node->getAsBinaryNode()) { + assert(isAssignOperation(BN->getOp())); + BN->getRight()->traverse(this); + if (isArithmeticOperation(BN->getOp())) { + BN->getWritableType().getQualifier().noContraction = true; + } + } else if (glslang::TIntermUnary* UN = defining_node->getAsUnaryNode()) { + assert(isAssignOperation(UN->getOp())); + UN->getOperand()->traverse(this); + if (isArithmeticOperation(UN->getOp())) { + UN->getWritableType().getQualifier().noContraction = true; + } + } + } + + // Propagates 'precise' in a given precise return node. + void propagateNoContractionInReturnNode(glslang::TIntermBranch* return_node) + { + remained_accesschain_ = ""; + assert(return_node->getFlowOp() == glslang::EOpReturn && return_node->getExpression()); + return_node->getExpression()->traverse(this); + } + +protected: + // Visits an aggregate node. The node can be a initializer list, in which + // case we need to find the 'precise' or 'precise' containing object node + // with the access chain record. In other cases, just need to traverse all + // the children nodes. + bool visitAggregate(glslang::TVisit, glslang::TIntermAggregate* node) override + { + if (!remained_accesschain_.empty() && node->getOp() == glslang::EOpConstructStruct) { + // This is a struct initializer node, and the remained + // access chain is not empty, we need to refer to the + // assignee_remained_access_chain_ to find the nested + // 'precise' object. And we don't need to visit other nodes in this + // aggregate node. + + // Gets the struct dereference index that leads to 'precise' object. + ObjectAccessChain precise_accesschain_index_str = + getFrontElement(remained_accesschain_); + unsigned precise_accesschain_index = strtoul(precise_accesschain_index_str.c_str(), nullptr, 10); + // Gets the node pointed by the access chain index extracted before. + glslang::TIntermTyped* potential_precise_node = + node->getSequence()[precise_accesschain_index]->getAsTyped(); + assert(potential_precise_node); + // Pop the front access chain index from the path, and visit the nested node. + { + ObjectAccessChain next_level_accesschain = + subAccessChainFromSecondElement(remained_accesschain_); + StateSettingGuard setup_remained_accesschain_for_next_level( + &remained_accesschain_, next_level_accesschain); + potential_precise_node->traverse(this); + } + return false; + } + return true; + } + + // Visits a binary node. A binary node can be an object node, e.g. a dereference node. + // As only the top object nodes in the right side of an assignment needs to be visited + // and added to 'precise' work list, this traverser won't visit the children nodes of + // an object node. If the binary node does not represent an object node, it should + // go on to traverse its children nodes and if it is an arithmetic operation node, this + // operation should be marked as 'noContraction'. + bool visitBinary(glslang::TVisit, glslang::TIntermBinary* node) override + { + if (isDereferenceOperation(node->getOp())) { + // This binary node is an object node. Need to update the precise + // object set with the access chain of this node + remained + // access chain . + ObjectAccessChain new_precise_accesschain = accesschain_mapping_.at(node); + if (remained_accesschain_.empty()) { + node->getWritableType().getQualifier().noContraction = true; + } else { + new_precise_accesschain += ObjectAccesschainDelimiter + remained_accesschain_; + } + // Cache the access chain as added precise object, so we won't add the + // same object to the work list again. + if (!added_precise_object_ids_.count(new_precise_accesschain)) { + precise_objects_.insert(new_precise_accesschain); + added_precise_object_ids_.insert(new_precise_accesschain); + } + // Only the upper-most object nodes should be visited, so do not + // visit children of this object node. + return false; + } + // If this is an arithmetic operation, marks this node as 'noContraction'. + if (isArithmeticOperation(node->getOp()) && node->getBasicType() != glslang::EbtInt) { + node->getWritableType().getQualifier().noContraction = true; + } + // As this node is not an object node, need to traverse the children nodes. + return true; + } + + // Visits a unary node. A unary node can not be an object node. If the operation + // is an arithmetic operation, need to mark this node as 'noContraction'. + bool visitUnary(glslang::TVisit /* visit */, glslang::TIntermUnary* node) override + { + // If this is an arithmetic operation, marks this with 'noContraction' + if (isArithmeticOperation(node->getOp())) { + node->getWritableType().getQualifier().noContraction = true; + } + return true; + } + + // Visits a symbol node. A symbol node is always an object node. So we + // should always be able to find its in our collected mapping from object + // nodes to access chains. As an object node, a symbol node can be either + // 'precise' or containing 'precise' objects according to unused + // access chain information we have when we visit this node. + void visitSymbol(glslang::TIntermSymbol* node) override + { + // Symbol nodes are object nodes and should always have an + // access chain collected before matches with it. + assert(accesschain_mapping_.count(node)); + ObjectAccessChain new_precise_accesschain = accesschain_mapping_.at(node); + // If the unused access chain is empty, this symbol node should be + // marked as 'precise'. Otherwise, the unused access chain should be + // appended to the symbol ID to build a new access chain which points to + // the nested 'precise' object in this symbol object. + if (remained_accesschain_.empty()) { + node->getWritableType().getQualifier().noContraction = true; + } else { + new_precise_accesschain += ObjectAccesschainDelimiter + remained_accesschain_; + } + // Add the new 'precise' access chain to the work list and make sure we + // don't visit it again. + if (!added_precise_object_ids_.count(new_precise_accesschain)) { + precise_objects_.insert(new_precise_accesschain); + added_precise_object_ids_.insert(new_precise_accesschain); + } + } + + // A set of precise objects, represented as access chains. + ObjectAccesschainSet& precise_objects_; + // Visited symbol nodes, should not revisit these nodes. + ObjectAccesschainSet added_precise_object_ids_; + // The left node of an assignment operation might be an parent of 'precise' objects. + // This means the left node might not be an 'precise' object node, but it may contains + // 'precise' qualifier which should be propagated to the corresponding child node in + // the right. So we need the path from the left node to its nested 'precise' node to + // tell us how to find the corresponding 'precise' node in the right. + ObjectAccessChain remained_accesschain_; + // A map from node pointers to their access chains. + const AccessChainMapping& accesschain_mapping_; +}; +} + +namespace glslang { + +void PropagateNoContraction(const glslang::TIntermediate& intermediate) +{ + // First, traverses the AST, records symbols with their defining operations + // and collects the initial set of precise symbols (symbol nodes that marked + // as 'noContraction') and precise return nodes. + auto mappings_and_precise_objects = + getSymbolToDefinitionMappingAndPreciseSymbolIDs(intermediate); + + // The mapping of symbol node IDs to their defining nodes. This enables us + // to get the defining node directly from a given symbol ID without + // traversing the tree again. + NodeMapping& symbol_definition_mapping = std::get<0>(mappings_and_precise_objects); + + // The mapping of object nodes to their access chains recorded. + AccessChainMapping& accesschain_mapping = std::get<1>(mappings_and_precise_objects); + + // The initial set of 'precise' objects which are represented as the + // access chain toward them. + ObjectAccesschainSet& precise_object_accesschains = std::get<2>(mappings_and_precise_objects); + + // The set of 'precise' return nodes. + ReturnBranchNodeSet& precise_return_nodes = std::get<3>(mappings_and_precise_objects); + + // Second, uses the initial set of precise objects as a work list, pops an + // access chain, extract the symbol ID from it. Then: + // 1) Check the assignee object, see if it is 'precise' object node or + // contains 'precise' object. Obtain the incremental access chain from the + // assignee node to its nested 'precise' node (if any). + // 2) If the assignee object node is 'precise' or it contains 'precise' + // objects, traverses the right side of the assignment operation + // expression to mark arithmetic operations as 'noContration' and update + // 'precise' access chain work list with new found object nodes. + // Repeat above steps until the work list is empty. + TNoContractionAssigneeCheckingTraverser checker(accesschain_mapping); + TNoContractionPropagator propagator(&precise_object_accesschains, accesschain_mapping); + + // We have two initial precise work lists to handle: + // 1) precise return nodes + // 2) precise object access chains + // We should process the precise return nodes first and the involved + // objects in the return expression should be added to the precise object + // access chain set. + while (!precise_return_nodes.empty()) { + glslang::TIntermBranch* precise_return_node = *precise_return_nodes.begin(); + propagator.propagateNoContractionInReturnNode(precise_return_node); + precise_return_nodes.erase(precise_return_node); + } + + while (!precise_object_accesschains.empty()) { + // Get the access chain of a precise object from the work list. + ObjectAccessChain precise_object_accesschain = *precise_object_accesschains.begin(); + // Get the symbol id from the access chain. + ObjectAccessChain symbol_id = getFrontElement(precise_object_accesschain); + // Get all the defining nodes of that symbol ID. + std::pair range = + symbol_definition_mapping.equal_range(symbol_id); + // Visits all the assignment nodes of that symbol ID and + // 1) Check if the assignee node is 'precise' or contains 'precise' + // objects. + // 2) Propagate the 'precise' to the top layer object nodes + // in the right side of the assignment operation, update the 'precise' + // work list with new access chains representing the new 'precise' + // objects, and mark arithmetic operations as 'noContraction'. + for (NodeMapping::iterator defining_node_iter = range.first; + defining_node_iter != range.second; defining_node_iter++) { + TIntermOperator* defining_node = defining_node_iter->second; + // Check the assignee node. + auto checker_result = checker.getPrecisenessAndRemainedAccessChain( + defining_node, precise_object_accesschain); + bool& contain_precise = std::get<0>(checker_result); + ObjectAccessChain& remained_accesschain = std::get<1>(checker_result); + // If the assignee node is 'precise' or contains 'precise', propagate the + // 'precise' to the right. Otherwise just skip this assignment node. + if (contain_precise) { + propagator.propagateNoContractionInOneExpression(defining_node, + remained_accesschain); + } + } + // Remove the last processed 'precise' object from the work list. + precise_object_accesschains.erase(precise_object_accesschain); + } +} +}; diff --git a/glslang/MachineIndependent/propagateNoContraction.h b/glslang/MachineIndependent/propagateNoContraction.h new file mode 100644 index 00000000..3412c85d --- /dev/null +++ b/glslang/MachineIndependent/propagateNoContraction.h @@ -0,0 +1,53 @@ +// +// Copyright (C) 2015-2016 Google, Inc. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. + +// +// Visit the nodes in the glslang intermediate tree representation to +// propagate 'noContraction' qualifier. +// + +#include "../Include/intermediate.h" + +namespace glslang { + +// Propagates the 'precise' qualifier for objects (objects marked with +// 'noContraction' qualifier) from the shader source specified 'precise' +// variables to all the involved objects, and add 'noContraction' qualifier for +// the involved arithmetic operations. +// Note that the same qualifier: 'noContraction' is used in both object nodes +// and arithmetic operation nodes, but has different meaning. For object nodes, +// 'noContraction' means the object is 'precise'; and for arithmetic operation +// nodes, it means the operation should not be contracted. +void PropagateNoContraction(const glslang::TIntermediate& intermediate); +}; diff --git a/glslang/MachineIndependent/reflection.cpp b/glslang/MachineIndependent/reflection.cpp index 9ef6d02f..d3e04af7 100644 --- a/glslang/MachineIndependent/reflection.cpp +++ b/glslang/MachineIndependent/reflection.cpp @@ -108,6 +108,22 @@ public: } } + void addAttribute(const TIntermSymbol& base) + { + if (processedDerefs.find(&base) == processedDerefs.end()) { + processedDerefs.insert(&base); + + const TString &name = base.getName(); + const TType &type = base.getType(); + + TReflection::TNameToIndex::const_iterator it = reflection.nameToIndex.find(name); + if (it == reflection.nameToIndex.end()) { + reflection.nameToIndex[name] = (int)reflection.indexToAttribute.size(); + reflection.indexToAttribute.push_back(TObjectReflection(name, 0, mapToGlType(type), 0, 0)); + } + } + } + // Lookup or calculate the offset of a block member, using the recursively // defined block offset rules. int getOffset(const TType& type, int index) @@ -540,6 +556,8 @@ public: case EbtDouble: return GL_DOUBLE_VEC2 + offset; case EbtInt: return GL_INT_VEC2 + offset; case EbtUint: return GL_UNSIGNED_INT_VEC2 + offset; + case EbtInt64: return GL_INT64_ARB + offset; + case EbtUint64: return GL_UNSIGNED_INT64_ARB + offset; case EbtBool: return GL_BOOL_VEC2 + offset; case EbtAtomicUint: return GL_UNSIGNED_INT_ATOMIC_COUNTER + offset; default: return 0; @@ -605,6 +623,8 @@ public: case EbtDouble: return GL_DOUBLE; case EbtInt: return GL_INT; case EbtUint: return GL_UNSIGNED_INT; + case EbtInt64: return GL_INT64_ARB; + case EbtUint64: return GL_UNSIGNED_INT64_ARB; case EbtBool: return GL_BOOL; case EbtAtomicUint: return GL_UNSIGNED_INT_ATOMIC_COUNTER; default: return 0; @@ -667,6 +687,9 @@ void TLiveTraverser::visitSymbol(TIntermSymbol* base) { if (base->getQualifier().storage == EvqUniform) addUniform(*base); + + if (intermediate.getStage() == EShLangVertex && base->getQualifier().isPipeInput()) + addAttribute(*base); } // To prune semantically dead paths. @@ -724,6 +747,11 @@ void TReflection::dump() indexToUniformBlock[i].dump(); printf("\n"); + printf("Vertex attribute reflection:\n"); + for (size_t i = 0; i < indexToAttribute.size(); ++i) + indexToAttribute[i].dump(); + printf("\n"); + //printf("Live names\n"); //for (TNameToIndex::const_iterator it = nameToIndex.begin(); it != nameToIndex.end(); ++it) // printf("%s: %d\n", it->first.c_str(), it->second); diff --git a/glslang/MachineIndependent/reflection.h b/glslang/MachineIndependent/reflection.h index 42f0ccd8..5d930c7a 100644 --- a/glslang/MachineIndependent/reflection.h +++ b/glslang/MachineIndependent/reflection.h @@ -93,7 +93,17 @@ public: return badReflection; } - // for mapping any name to its index (both block names and uniforms names) + // for mapping an attribute index to the attribute's description + int getNumAttributes() { return (int)indexToAttribute.size(); } + const TObjectReflection& getAttribute(int i) const + { + if (i >= 0 && i < (int)indexToAttribute.size()) + return indexToAttribute[i]; + else + return badReflection; + } + + // for mapping any name to its index (block names, uniform names and attribute names) int getIndex(const char* name) const { TNameToIndex::const_iterator it = nameToIndex.find(name); @@ -116,6 +126,7 @@ protected: TNameToIndex nameToIndex; // maps names to indexes; can hold all types of data: uniform/buffer and which function names have been processed TMapIndexToReflection indexToUniform; TMapIndexToReflection indexToUniformBlock; + TMapIndexToReflection indexToAttribute; }; } // end namespace glslang diff --git a/glslang/OSDependent/Unix/CMakeLists.txt b/glslang/OSDependent/Unix/CMakeLists.txt index 319c70cc..174cc916 100644 --- a/glslang/OSDependent/Unix/CMakeLists.txt +++ b/glslang/OSDependent/Unix/CMakeLists.txt @@ -1,8 +1,5 @@ - - -cmake_minimum_required(VERSION 2.8) - add_library(OSDependent STATIC ossource.cpp ../osinclude.h) +set_property(TARGET OSDependent PROPERTY FOLDER glslang) install(TARGETS OSDependent ARCHIVE DESTINATION lib) diff --git a/glslang/OSDependent/Unix/ossource.cpp b/glslang/OSDependent/Unix/ossource.cpp index 5ce882ab..123e0869 100644 --- a/glslang/OSDependent/Unix/ossource.cpp +++ b/glslang/OSDependent/Unix/ossource.cpp @@ -61,7 +61,7 @@ static void DetachThreadLinux(void *) // -// Registers cleanup handler, sets cancel type and state, and excecutes the thread specific +// Registers cleanup handler, sets cancel type and state, and executes the thread specific // cleanup handler. This function will be called in the Standalone.cpp for regression // testing. When OpenGL applications are run with the driver code, Linux OS does the // thread cleanup. @@ -69,7 +69,7 @@ static void DetachThreadLinux(void *) void OS_CleanupThreadData(void) { #ifdef __ANDROID__ - DetachThread(); + DetachThreadLinux(NULL); #else int old_cancel_state, old_cancel_type; void *cleanupArg = NULL; diff --git a/glslang/OSDependent/Windows/CMakeLists.txt b/glslang/OSDependent/Windows/CMakeLists.txt index 9bc73a37..399760c3 100644 --- a/glslang/OSDependent/Windows/CMakeLists.txt +++ b/glslang/OSDependent/Windows/CMakeLists.txt @@ -1,8 +1,7 @@ -cmake_minimum_required(VERSION 2.8) - set(SOURCES ossource.cpp ../osinclude.h) add_library(OSDependent STATIC ${SOURCES}) +set_property(TARGET OSDependent PROPERTY FOLDER glslang) # MinGW GCC complains about function pointer casts to void*. # Turn that off with -fpermissive. diff --git a/glslang/Public/ShaderLang.h b/glslang/Public/ShaderLang.h index c9182618..64d6ab9f 100644 --- a/glslang/Public/ShaderLang.h +++ b/glslang/Public/ShaderLang.h @@ -86,7 +86,7 @@ typedef enum { EShLangFragment, EShLangCompute, EShLangCount, -} EShLanguage; +} EShLanguage; // would be better as stage, but this is ancient now typedef enum { EShLangVertexMask = (1 << EShLangVertex), @@ -99,6 +99,12 @@ typedef enum { namespace glslang { +typedef enum { + EShSourceNone, + EShSourceGlsl, + EShSourceHlsl, +} EShSource; // if EShLanguage were EShStage, this could be EShLanguage instead + const char* StageName(EShLanguage); } // end namespace glslang @@ -132,6 +138,7 @@ enum EShMessages { EShMsgSpvRules = (1 << 3), // issue messages for SPIR-V generation EShMsgVulkanRules = (1 << 4), // issue messages for Vulkan-requirements of GLSL for SPIR-V EShMsgOnlyPreprocessor = (1 << 5), // only print out errors produced by the preprocessor + EShMsgReadHlsl = (1 << 6), // use HLSL parsing rules and semantics }; // @@ -215,7 +222,6 @@ SH_IMPORT_EXPORT const char* ShGetInfoLog(const ShHandle); SH_IMPORT_EXPORT const void* ShGetExecutable(const ShHandle); SH_IMPORT_EXPORT int ShSetVirtualAttributeBindings(const ShHandle, const ShBindingTable*); // to detect user aliasing SH_IMPORT_EXPORT int ShSetFixedAttributeBindings(const ShHandle, const ShBindingTable*); // to force any physical mappings -SH_IMPORT_EXPORT int ShGetPhysicalAttributeBindings(const ShHandle, const ShBindingTable**); // for all attributes // // Tell the linker to never assign a vertex attribute to this list of physical attributes // @@ -290,6 +296,7 @@ public: void setStringsWithLengthsAndNames( const char* const* s, const int* l, const char* const* names, int n); void setPreamble(const char* s) { preamble = s; } + void setEntryPoint(const char* entryPoint); // Interface to #include handlers. // @@ -320,13 +327,13 @@ public: // include. For example, in a filesystem-based includer, full resolution // should convert a relative path name into an absolute path name. // For a failed inclusion, this is an empty string. - std::string file_name; + const std::string file_name; // The content and byte length of the requested inclusion. The // Includer producing this IncludeResult retains ownership of the // storage. // For a failed inclusion, the file_data // field points to a string containing error details. - const char* file_data; + const char* const file_data; const size_t file_length; // Include resolver's context. void* user_data; @@ -348,6 +355,9 @@ public: // Signals that the parser will no longer use the contents of the // specified IncludeResult. virtual void releaseInclude(IncludeResult* result) = 0; +#ifdef __ANDROID__ + virtual ~Includer() {} // Pacify -Werror=non-virtual-dtor +#endif }; // Returns an error message for any #include directive. @@ -450,6 +460,9 @@ public: int getUniformType(int index); // can be used for glGetActiveUniformsiv(GL_UNIFORM_TYPE) int getUniformBufferOffset(int index); // can be used for glGetActiveUniformsiv(GL_UNIFORM_OFFSET) int getUniformArraySize(int index); // can be used for glGetActiveUniformsiv(GL_UNIFORM_SIZE) + int getNumLiveAttributes(); // can be used for glGetProgramiv(GL_ACTIVE_ATTRIBUTES) + const char *getAttributeName(int index); // can be used for glGetActiveAttrib() + int getAttributeType(int index); // can be used for glGetActiveAttrib() void dumpReflection(); protected: diff --git a/glslang/updateGrammar b/glslang/updateGrammar new file mode 100755 index 00000000..f8fa81da --- /dev/null +++ b/glslang/updateGrammar @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +bison --defines=MachineIndependent/glslang_tab.cpp.h -t MachineIndependent/glslang.y -o MachineIndependent/glslang_tab.cpp diff --git a/gtests/AST.FromFile.cpp b/gtests/AST.FromFile.cpp new file mode 100644 index 00000000..08ec919b --- /dev/null +++ b/gtests/AST.FromFile.cpp @@ -0,0 +1,193 @@ +// +// Copyright (C) 2016 Google, Inc. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. + +#include + +#include "TestFixture.h" + +namespace glslangtest { +namespace { + +using CompileToAstTest = GlslangTest<::testing::TestWithParam>; + +TEST_P(CompileToAstTest, FromFile) +{ + loadFileCompileAndCheck(GLSLANG_TEST_DIRECTORY, GetParam(), + Source::GLSL, Semantics::OpenGL, + Target::AST); +} + +// clang-format off +INSTANTIATE_TEST_CASE_P( + Glsl, CompileToAstTest, + ::testing::ValuesIn(std::vector({ + "sample.frag", + "sample.vert", + "decls.frag", + "specExamples.frag", + "specExamples.vert", + "versionsClean.frag", + "versionsClean.vert", + "versionsErrors.frag", + "versionsErrors.vert", + "100.frag", + "120.vert", + "120.frag", + "130.vert", + "130.frag", + "140.vert", + "140.frag", + "150.vert", + "150.geom", + "150.frag", + "precision.frag", + "precision.vert", + "nonSquare.vert", + "matrixError.vert", + "cppSimple.vert", + "cppIndent.vert", + "cppNest.vert", + "cppComplexExpr.vert", + "badChars.frag", + "pointCoord.frag", + "array.frag", + "array100.frag", + "comment.frag", + "300.vert", + "300.frag", + "300BuiltIns.frag", + "300layout.vert", + "300layout.frag", + "300operations.frag", + "300block.frag", + "310.comp", + "310.vert", + "310.geom", + "310.frag", + "310.tesc", + "310.tese", + "310implicitSizeArrayError.vert", + "310AofA.vert", + "330.frag", + "330comp.frag", + "constErrors.frag", + "constFold.frag", + "errors.frag", + "forwardRef.frag", + "uint.frag", + "switch.frag", + "tokenLength.vert", + "100Limits.vert", + "100scope.vert", + "110scope.vert", + "300scope.vert", + "400.frag", + "420.comp", + "420.frag", + "420.vert", + "420.geom", + "420_size_gl_in.geom", + "430scope.vert", + "lineContinuation100.vert", + "lineContinuation.vert", + "numeral.frag", + "400.geom", + "400.tesc", + "400.tese", + "410.tesc", + "420.tesc", + "420.tese", + "410.geom", + "430.vert", + "430.comp", + "430AofA.frag", + "440.vert", + "440.frag", + "450.vert", + "450.geom", + "450.tesc", + "450.tese", + "450.frag", + "450.comp", + "dce.frag", + "atomic_uint.frag", + "aggOps.frag", + "always-discard.frag", + "always-discard2.frag", + "conditionalDiscard.frag", + "conversion.frag", + "dataOut.frag", + "dataOutIndirect.frag", + "deepRvalue.frag", + "depthOut.frag", + "discard-dce.frag", + "doWhileLoop.frag", + "earlyReturnDiscard.frag", + "flowControl.frag", + "forLoop.frag", + "functionCall.frag", + "functionSemantics.frag", + "length.frag", + "localAggregates.frag", + "loops.frag", + "loopsArtificial.frag", + "matrix.frag", + "matrix2.frag", + "newTexture.frag", + "Operations.frag", + "prepost.frag", + "simpleFunctionCall.frag", + "structAssignment.frag", + "structDeref.frag", + "structure.frag", + "swizzle.frag", + "syntaxError.frag", + "test.frag", + "texture.frag", + "types.frag", + "uniformArray.frag", + "variableArrayIndex.frag", + "varyingArray.frag", + "varyingArrayIndirect.frag", + "voidFunction.frag", + "whileLoop.frag", + "nonVulkan.frag", + "spv.atomic.comp", + })), + FileNameAsCustomTestSuffix +); +// clang-format on + +} // anonymous namespace +} // namespace glslangtest diff --git a/gtests/BuiltInResource.FromFile.cpp b/gtests/BuiltInResource.FromFile.cpp new file mode 100644 index 00000000..4d68d873 --- /dev/null +++ b/gtests/BuiltInResource.FromFile.cpp @@ -0,0 +1,57 @@ +// +// Copyright (C) 2016 Google, Inc. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. + +#include + +#include + +#include "StandAlone/ResourceLimits.h" +#include "TestFixture.h" + +namespace glslangtest { +namespace { + +using DefaultResourceTest = GlslangTest<::testing::Test>; + +TEST_F(DefaultResourceTest, FromFile) +{ + const std::string path = GLSLANG_TEST_DIRECTORY "/baseResults/test.conf"; + std::string expectedConfig; + tryLoadFile(path, "expected resource limit", &expectedConfig); + const std::string realConfig = glslang::GetDefaultTBuiltInResourceString(); + ASSERT_EQ(expectedConfig, realConfig); +} + +} // anonymous namespace +} // namespace glslangtest diff --git a/gtests/CMakeLists.txt b/gtests/CMakeLists.txt new file mode 100644 index 00000000..4aafd11f --- /dev/null +++ b/gtests/CMakeLists.txt @@ -0,0 +1,40 @@ +if (TARGET gmock) + message(STATUS "Google Mock found - building tests") + + set(TEST_SOURCES + # Framework related source files + ${CMAKE_CURRENT_SOURCE_DIR}/Initializer.h + ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/Settings.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/Settings.h + ${CMAKE_CURRENT_SOURCE_DIR}/TestFixture.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/TestFixture.h + + # Test related source files + ${CMAKE_CURRENT_SOURCE_DIR}/AST.FromFile.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/BuiltInResource.FromFile.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/Config.FromFile.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/Hlsl.FromFile.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/Link.FromFile.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/Pp.FromFile.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/Spv.FromFile.cpp + ) + + add_executable(glslangtests ${TEST_SOURCES}) + set_property(TARGET glslangtests PROPERTY FOLDER tests) + glslang_set_link_args(glslangtests) + install(TARGETS glslangtests + RUNTIME DESTINATION bin) + + target_compile_definitions(glslangtests + PRIVATE GLSLANG_TEST_DIRECTORY="${CMAKE_CURRENT_SOURCE_DIR}/../Test") + target_include_directories(glslangtests PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR} + ${PROJECT_SOURCE_DIR} + ${gmock_SOURCE_DIR}/include + ${gtest_SOURCE_DIR}/include) + target_link_libraries(glslangtests PRIVATE + glslang OSDependent OGLCompiler HLSL glslang + SPIRV glslang-default-resource-limits gmock) + add_test(NAME glslang-gtests COMMAND glslangtests) +endif() diff --git a/gtests/Config.FromFile.cpp b/gtests/Config.FromFile.cpp new file mode 100644 index 00000000..20c98be5 --- /dev/null +++ b/gtests/Config.FromFile.cpp @@ -0,0 +1,107 @@ +// +// Copyright (C) 2016 Google, Inc. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. + +#include "StandAlone/ResourceLimits.h" +#include "TestFixture.h" + +namespace glslangtest { +namespace { + +struct TestCaseSpec { + std::string input; + std::string config; + std::string output; + EShMessages controls; +}; + +using ConfigTest = GlslangTest<::testing::TestWithParam>; + +TEST_P(ConfigTest, FromFile) +{ + TestCaseSpec testCase = GetParam(); + GlslangResult result; + + // Get the contents for input shader and limit configurations. + std::string shaderContents, configContents; + tryLoadFile(GLSLANG_TEST_DIRECTORY "/" + testCase.input, "input", &shaderContents); + tryLoadFile(GLSLANG_TEST_DIRECTORY "/" + testCase.config, "limits config", &configContents); + + // Decode limit configurations. + TBuiltInResource resources = {}; + { + const size_t len = configContents.size(); + char* configChars = new char[len + 1]; + memcpy(configChars, configContents.data(), len); + configChars[len] = 0; + glslang::DecodeResourceLimits(&resources, configChars); + delete[] configChars; + } + + // Compile the shader. + glslang::TShader shader(GetShaderStage(GetSuffix(testCase.input))); + compile(&shader, shaderContents, "", testCase.controls, &resources); + result.shaderResults.push_back( + {testCase.input, shader.getInfoLog(), shader.getInfoDebugLog()}); + + // Link the shader. + glslang::TProgram program; + program.addShader(&shader); + program.link(testCase.controls); + result.linkingOutput = program.getInfoLog(); + result.linkingError = program.getInfoDebugLog(); + + std::ostringstream stream; + outputResultToStream(&stream, result, testCase.controls); + + // Check with expected results. + const std::string expectedOutputFname = + GLSLANG_TEST_DIRECTORY "/baseResults/" + testCase.output; + std::string expectedOutput; + tryLoadFile(expectedOutputFname, "expected output", &expectedOutput); + + checkEqAndUpdateIfRequested(expectedOutput, stream.str(), expectedOutputFname); +} + +// clang-format off +INSTANTIATE_TEST_CASE_P( + Glsl, ConfigTest, + ::testing::ValuesIn(std::vector({ + {"specExamples.vert", "baseResults/test.conf", "specExamples.vert.out", EShMsgAST}, + {"100Limits.vert", "100.conf", "100LimitsConf.vert.out", EShMsgDefault}, + })), +); +// clang-format on + +} // anonymous namespace +} // namespace glslangtest diff --git a/gtests/Hlsl.FromFile.cpp b/gtests/Hlsl.FromFile.cpp new file mode 100644 index 00000000..3b61dc00 --- /dev/null +++ b/gtests/Hlsl.FromFile.cpp @@ -0,0 +1,99 @@ +// +// Copyright (C) 2016 Google, Inc. +// Copyright (C) 2016 LunarG, Inc. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. + +#include + +#include "TestFixture.h" + +namespace glslangtest { +namespace { + +struct FileNameEntryPointPair { + const char* fileName; + const char* entryPoint; +}; + +// We are using FileNameEntryPointPair objects as parameters for instantiating +// the template, so the global FileNameAsCustomTestSuffix() won't work since +// it assumes std::string as parameters. Thus, an overriding one here. +std::string FileNameAsCustomTestSuffix( + const ::testing::TestParamInfo& info) { + std::string name = info.param.fileName; + // A valid test case suffix cannot have '.' and '-' inside. + std::replace(name.begin(), name.end(), '.', '_'); + std::replace(name.begin(), name.end(), '-', '_'); + return name; +} + +using HlslCompileTest = GlslangTest<::testing::TestWithParam>; + +// Compiling HLSL to SPIR-V under Vulkan semantics. Expected to successfully +// generate both AST and SPIR-V. +TEST_P(HlslCompileTest, FromFile) +{ + loadFileCompileAndCheck(GLSLANG_TEST_DIRECTORY, GetParam().fileName, + Source::HLSL, Semantics::Vulkan, + Target::BothASTAndSpv, GetParam().entryPoint); +} + +// clang-format off +INSTANTIATE_TEST_CASE_P( + ToSpirv, HlslCompileTest, + ::testing::ValuesIn(std::vector{ + {"hlsl.assoc.frag", "PixelShaderFunction"}, + {"hlsl.attribute.frag", "PixelShaderFunction"}, + {"hlsl.cast.frag", "PixelShaderFunction"}, + {"hlsl.doLoop.frag", "PixelShaderFunction"}, + {"hlsl.float1.frag", "PixelShaderFunction"}, + {"hlsl.float4.frag", "PixelShaderFunction"}, + {"hlsl.forLoop.frag", "PixelShaderFunction"}, + {"hlsl.if.frag", "PixelShaderFunction"}, + {"hlsl.intrinsics.frag", "PixelShaderFunction"}, + {"hlsl.intrinsics.negative.frag", "PixelShaderFunction"}, + {"hlsl.intrinsics.negative.vert", "VertexShaderFunction"}, + {"hlsl.intrinsics.vert", "VertexShaderFunction"}, + {"hlsl.matType.frag", "PixelShaderFunction"}, + {"hlsl.max.frag", "PixelShaderFunction"}, + {"hlsl.precedence.frag", "PixelShaderFunction"}, + {"hlsl.precedence2.frag", "PixelShaderFunction"}, + {"hlsl.sin.frag", "PixelShaderFunction"}, + {"hlsl.whileLoop.frag", "PixelShaderFunction"}, + }), + FileNameAsCustomTestSuffix +); +// clang-format on + +} // anonymous namespace +} // namespace glslangtest diff --git a/gtests/Initializer.h b/gtests/Initializer.h new file mode 100644 index 00000000..3cafb52a --- /dev/null +++ b/gtests/Initializer.h @@ -0,0 +1,87 @@ +// +// Copyright (C) 2016 Google, Inc. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. + +#ifndef GLSLANG_GTESTS_INITIALIZER_H +#define GLSLANG_GTESTS_INITIALIZER_H + +#include "glslang/Public/ShaderLang.h" + +namespace glslangtest { + +// Initializes glslang on creation, and destroys it on completion. +// And provides .Acquire() as a way to reinitialize glslang if semantics change. +// This object is expected to be a singleton, so that internal glslang state +// can be correctly handled. +// +// TODO(antiagainst): It's a known bug that some of the internal states need to +// be reset if semantics change: +// https://github.com/KhronosGroup/glslang/issues/166 +// Therefore, the following mechanism is needed. Remove this once the above bug +// gets fixed. +class GlslangInitializer { +public: + GlslangInitializer() : lastMessages(EShMsgDefault) + { + glslang::InitializeProcess(); + } + + ~GlslangInitializer() { glslang::FinalizeProcess(); } + + // A token indicates that the glslang is reinitialized (if necessary) to the + // required semantics. And that won't change until the token is destroyed. + class InitializationToken { + }; + + // Re-initializes glsl state iff the previous messages and the current + // messages are incompatible. We assume external synchronization, i.e. + // there is at most one acquired token at any one time. + InitializationToken acquire(EShMessages new_messages) + { + if ((lastMessages ^ new_messages) & + (EShMsgVulkanRules | EShMsgSpvRules | EShMsgReadHlsl)) { + glslang::FinalizeProcess(); + glslang::InitializeProcess(); + } + lastMessages = new_messages; + return InitializationToken(); + } + +private: + + EShMessages lastMessages; +}; + +} // namespace glslangtest + +#endif // GLSLANG_GTESTS_INITIALIZER_H diff --git a/gtests/Link.FromFile.cpp b/gtests/Link.FromFile.cpp new file mode 100644 index 00000000..331c5b27 --- /dev/null +++ b/gtests/Link.FromFile.cpp @@ -0,0 +1,108 @@ +// +// Copyright (C) 2016 Google, Inc. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. + +#include + +#include + +#include "TestFixture.h" + +namespace glslangtest { +namespace { + +using LinkTest = GlslangTest< + ::testing::TestWithParam>>; + +TEST_P(LinkTest, FromFile) +{ + const auto& fileNames = GetParam(); + const size_t fileCount = fileNames.size(); + const EShMessages controls = DeriveOptions( + Source::GLSL, Semantics::OpenGL, Target::AST); + GlslangResult result; + + // Compile each input shader file. + std::vector> shaders; + for (size_t i = 0; i < fileCount; ++i) { + std::string contents; + tryLoadFile(GLSLANG_TEST_DIRECTORY "/" + fileNames[i], + "input", &contents); + shaders.emplace_back( + new glslang::TShader(GetShaderStage(GetSuffix(fileNames[i])))); + auto* shader = shaders.back().get(); + compile(shader, contents, "", controls); + result.shaderResults.push_back( + {fileNames[i], shader->getInfoLog(), shader->getInfoDebugLog()}); + } + + // Link all of them. + glslang::TProgram program; + for (const auto& shader : shaders) program.addShader(shader.get()); + program.link(controls); + result.linkingOutput = program.getInfoLog(); + result.linkingError = program.getInfoDebugLog(); + + std::ostringstream stream; + outputResultToStream(&stream, result, controls); + + // Check with expected results. + const std::string expectedOutputFname = + GLSLANG_TEST_DIRECTORY "/baseResults/" + fileNames.front() + ".out"; + std::string expectedOutput; + tryLoadFile(expectedOutputFname, "expected output", &expectedOutput); + + checkEqAndUpdateIfRequested(expectedOutput, stream.str(), expectedOutputFname); +} + +// clang-format off +INSTANTIATE_TEST_CASE_P( + Glsl, LinkTest, + ::testing::ValuesIn(std::vector>({ + {"mains1.frag", "mains2.frag", "noMain1.geom", "noMain2.geom"}, + {"noMain.vert", "mains.frag"}, + {"link1.frag", "link2.frag", "link3.frag"}, + {"recurse1.vert", "recurse1.frag", "recurse2.frag"}, + {"300link.frag"}, + {"300link2.frag"}, + {"300link3.frag"}, + {"empty.frag", "empty2.frag", "empty3.frag"}, + {"150.tesc", "150.tese", "400.tesc", "400.tese", "410.tesc", "420.tesc", "420.tese"}, + {"max_vertices_0.geom"}, + {"es-link1.frag", "es-link2.frag"}, + })), +); +// clang-format on + +} // anonymous namespace +} // namespace glslangtest diff --git a/gtests/Pp.FromFile.cpp b/gtests/Pp.FromFile.cpp new file mode 100644 index 00000000..01bdfc32 --- /dev/null +++ b/gtests/Pp.FromFile.cpp @@ -0,0 +1,74 @@ +// +// Copyright (C) 2016 Google, Inc. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. + +#include + +#include "TestFixture.h" + +namespace glslangtest { +namespace { + +using PreprocessingTest = GlslangTest<::testing::TestWithParam>; + +TEST_P(PreprocessingTest, FromFile) +{ + loadFilePreprocessAndCheck(GLSLANG_TEST_DIRECTORY, GetParam()); +} + +// clang-format off +INSTANTIATE_TEST_CASE_P( + Glsl, PreprocessingTest, + ::testing::ValuesIn(std::vector({ + "preprocessor.cpp_style_line_directive.vert", + "preprocessor.cpp_style___FILE__.vert", + "preprocessor.edge_cases.vert", + "preprocessor.errors.vert", + "preprocessor.extensions.vert", + "preprocessor.function_macro.vert", + "preprocessor.include.enabled.vert", + "preprocessor.include.disabled.vert", + "preprocessor.line.vert", + "preprocessor.line.frag", + "preprocessor.pragma.vert", + "preprocessor.simple.vert", + "preprocessor.success_if_parse_would_fail.vert", + "preprocessor.defined.vert", + "preprocessor.many.endif.vert", + })), + FileNameAsCustomTestSuffix +); +// clang-format on + +} // anonymous namespace +} // namespace glslangtest diff --git a/gtests/README.md b/gtests/README.md new file mode 100644 index 00000000..c8261cc4 --- /dev/null +++ b/gtests/README.md @@ -0,0 +1,26 @@ +Glslang Tests based on the Google Test Framework +================================================ + +This directory contains [Google Test][gtest] based test fixture and test +cases for glslang. + +Apart from typical unit tests, necessary utility methods are added into +the [`GlslangTests`](TestFixture.h) fixture to provide the ability to do +file-based integration tests. Various `*.FromFile.cpp` files lists names +of files containing input shader code in the `Test/` directory. Utility +methods will load the input shader source, compile them, and compare with +the corresponding expected output in the `Test/baseResults/` directory. + +How to run the tests +-------------------- + +Please make sure you have a copy of [Google Test][gtest] checked out under +the `External` directory before building. After building, just run the +`ctest` command or the `gtests/glslangtests` binary in your build directory. + +The `gtests/glslangtests` binary also provides an `--update-mode` command +line option, which, if supplied, will overwrite the golden files under +the `Test/baseResults/` directory with real output from that invocation. +This serves as an easy way to update golden files. + +[gtest]: https://github.com/google/googletest diff --git a/gtests/Settings.cpp b/gtests/Settings.cpp new file mode 100644 index 00000000..4ba7989b --- /dev/null +++ b/gtests/Settings.cpp @@ -0,0 +1,41 @@ +// +// Copyright (C) 2016 Google, Inc. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. + +#include "Settings.h" + +namespace glslangtest { + +GTestSettings GlobalTestSettings = {nullptr, false}; + +} // namespace glslangtest diff --git a/gtests/Settings.h b/gtests/Settings.h new file mode 100644 index 00000000..30056a7b --- /dev/null +++ b/gtests/Settings.h @@ -0,0 +1,54 @@ +// +// Copyright (C) 2016 Google, Inc. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. + +#ifndef GLSLANG_GTESTS_SETTINGS_H +#define GLSLANG_GTESTS_SETTINGS_H + +namespace glslangtest { + +class GlslangInitializer; + +struct GTestSettings { + // A handle to GlslangInitializer instance. + GlslangInitializer* initializer; + // An indicator of whether GTest should write real output to the file for + // the expected output. + bool updateMode; +}; + +extern GTestSettings GlobalTestSettings; + +} // namespace glslangtest + +#endif // GLSLANG_GTESTS_SETTINGS_H diff --git a/gtests/Spv.FromFile.cpp b/gtests/Spv.FromFile.cpp new file mode 100644 index 00000000..054e293a --- /dev/null +++ b/gtests/Spv.FromFile.cpp @@ -0,0 +1,210 @@ +// +// Copyright (C) 2016 Google, Inc. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. + +#include + +#include + +#include "TestFixture.h" + +namespace glslangtest { +namespace { + +using CompileToSpirvTest = GlslangTest<::testing::TestWithParam>; +using VulkanSemantics = GlslangTest<::testing::TestWithParam>; +using VulkanAstSemantics = GlslangTest<::testing::TestWithParam>; + +// Compiling GLSL to SPIR-V under Vulkan semantics. Expected to successfully +// generate SPIR-V. +TEST_P(CompileToSpirvTest, FromFile) +{ + loadFileCompileAndCheck(GLSLANG_TEST_DIRECTORY, GetParam(), + Source::GLSL, Semantics::Vulkan, + Target::Spv); +} + +// GLSL-level Vulkan semantics test. Expected to error out before generating +// SPIR-V. +TEST_P(VulkanSemantics, FromFile) +{ + loadFileCompileAndCheck(GLSLANG_TEST_DIRECTORY, GetParam(), + Source::GLSL, Semantics::Vulkan, + Target::Spv); +} + +// GLSL-level Vulkan semantics test that need to see the AST for validation. +TEST_P(VulkanAstSemantics, FromFile) +{ + loadFileCompileAndCheck(GLSLANG_TEST_DIRECTORY, GetParam(), + Source::GLSL, Semantics::Vulkan, + Target::AST); +} + +// clang-format off +INSTANTIATE_TEST_CASE_P( + Glsl, CompileToSpirvTest, + ::testing::ValuesIn(std::vector({ + // Test looping constructs. + // No tests yet for making sure break and continue from a nested loop + // goes to the innermost target. + "spv.do-simple.vert", + "spv.do-while-continue-break.vert", + "spv.for-complex-condition.vert", + "spv.for-continue-break.vert", + "spv.for-simple.vert", + "spv.for-notest.vert", + "spv.for-nobody.vert", + "spv.while-continue-break.vert", + "spv.while-simple.vert", + // vulkan-specific tests + "spv.set.vert", + "spv.double.comp", + "spv.100ops.frag", + "spv.130.frag", + "spv.140.frag", + "spv.150.geom", + "spv.150.vert", + "spv.300BuiltIns.vert", + "spv.300layout.frag", + "spv.300layout.vert", + "spv.300layoutp.vert", + "spv.310.comp", + "spv.330.geom", + "spv.400.frag", + "spv.400.tesc", + "spv.400.tese", + "spv.420.geom", + "spv.430.vert", + "spv.accessChain.frag", + "spv.aggOps.frag", + "spv.always-discard.frag", + "spv.always-discard2.frag", + "spv.bitCast.frag", + "spv.bool.vert", + "spv.boolInBlock.frag", + "spv.branch-return.vert", + "spv.conditionalDiscard.frag", + "spv.conversion.frag", + "spv.dataOut.frag", + "spv.dataOutIndirect.frag", + "spv.dataOutIndirect.vert", + "spv.deepRvalue.frag", + "spv.depthOut.frag", + "spv.discard-dce.frag", + "spv.doWhileLoop.frag", + "spv.earlyReturnDiscard.frag", + "spv.flowControl.frag", + "spv.forLoop.frag", + "spv.forwardFun.frag", + "spv.functionCall.frag", + "spv.functionSemantics.frag", + "spv.interpOps.frag", + "spv.int64.frag", + "spv.layoutNested.vert", + "spv.length.frag", + "spv.localAggregates.frag", + "spv.loops.frag", + "spv.loopsArtificial.frag", + "spv.matFun.vert", + "spv.matrix.frag", + "spv.matrix2.frag", + "spv.memoryQualifier.frag", + "spv.merge-unreachable.frag", + "spv.newTexture.frag", + "spv.noDeadDecorations.vert", + "spv.nonSquare.vert", + "spv.Operations.frag", + "spv.intOps.vert", + "spv.precision.frag", + "spv.prepost.frag", + "spv.qualifiers.vert", + "spv.shaderBallot.comp", + "spv.shaderGroupVote.comp", + "spv.shiftOps.frag", + "spv.simpleFunctionCall.frag", + "spv.simpleMat.vert", + "spv.sparseTexture.frag", + "spv.sparseTextureClamp.frag", + "spv.structAssignment.frag", + "spv.structDeref.frag", + "spv.structure.frag", + "spv.switch.frag", + "spv.swizzle.frag", + "spv.test.frag", + "spv.test.vert", + "spv.texture.frag", + "spv.texture.vert", + "spv.image.frag", + "spv.types.frag", + "spv.uint.frag", + "spv.uniformArray.frag", + "spv.variableArrayIndex.frag", + "spv.varyingArray.frag", + "spv.varyingArrayIndirect.frag", + "spv.voidFunction.frag", + "spv.whileLoop.frag", + "spv.AofA.frag", + "spv.queryL.frag", + "spv.separate.frag", + "spv.shortCircuit.frag", + "spv.pushConstant.vert", + "spv.subpass.frag", + "spv.specConstant.vert", + "spv.specConstant.comp", + "spv.specConstantComposite.vert", + })), + FileNameAsCustomTestSuffix +); + +INSTANTIATE_TEST_CASE_P( + Glsl, VulkanSemantics, + ::testing::ValuesIn(std::vector({ + "vulkan.frag", + "vulkan.vert", + "vulkan.comp", + })), + FileNameAsCustomTestSuffix +); + +INSTANTIATE_TEST_CASE_P( + Glsl, VulkanAstSemantics, + ::testing::ValuesIn(std::vector({ + "vulkan.ast.vert", + })), + FileNameAsCustomTestSuffix +); +// clang-format on + +} // anonymous namespace +} // namespace glslangtest diff --git a/gtests/TestFixture.cpp b/gtests/TestFixture.cpp new file mode 100644 index 00000000..2cf70707 --- /dev/null +++ b/gtests/TestFixture.cpp @@ -0,0 +1,134 @@ +// +// Copyright (C) 2016 Google, Inc. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. + +#include "TestFixture.h" + +namespace glslangtest { + +std::string FileNameAsCustomTestSuffix( + const ::testing::TestParamInfo& info) +{ + std::string name = info.param; + // A valid test case suffix cannot have '.' and '-' inside. + std::replace(name.begin(), name.end(), '.', '_'); + std::replace(name.begin(), name.end(), '-', '_'); + return name; +} + +EShLanguage GetShaderStage(const std::string& stage) +{ + if (stage == "vert") { + return EShLangVertex; + } else if (stage == "tesc") { + return EShLangTessControl; + } else if (stage == "tese") { + return EShLangTessEvaluation; + } else if (stage == "geom") { + return EShLangGeometry; + } else if (stage == "frag") { + return EShLangFragment; + } else if (stage == "comp") { + return EShLangCompute; + } else { + assert(0 && "Unknown shader stage"); + return EShLangCount; + } +} + +EShMessages DeriveOptions(Source source, Semantics semantics, Target target) +{ + EShMessages result = EShMsgDefault; + + switch (source) { + case Source::GLSL: + break; + case Source::HLSL: + result = EShMsgReadHlsl; + break; + } + + switch (target) { + case Target::AST: + result = static_cast(result | EShMsgAST); + break; + case Target::Spv: + result = static_cast(result | EShMsgSpvRules); + break; + case Target::BothASTAndSpv: + result = static_cast(result | EShMsgSpvRules | EShMsgAST); + break; + }; + + switch (semantics) { + case Semantics::OpenGL: + break; + case Semantics::Vulkan: + result = static_cast(result | EShMsgVulkanRules | EShMsgSpvRules); + break; + } + + return result; +} + +std::pair ReadFile(const std::string& path) +{ + std::ifstream fstream(path, std::ios::in); + if (fstream) { + std::string contents; + fstream.seekg(0, std::ios::end); + contents.reserve(fstream.tellg()); + fstream.seekg(0, std::ios::beg); + contents.assign((std::istreambuf_iterator(fstream)), + std::istreambuf_iterator()); + return std::make_pair(true, contents); + } + return std::make_pair(false, ""); +} + +bool WriteFile(const std::string& path, const std::string& contents) +{ + std::ofstream fstream(path, std::ios::out); + if (!fstream) return false; + fstream << contents; + fstream.flush(); + return true; +} + +std::string GetSuffix(const std::string& name) +{ + const size_t pos = name.rfind('.'); + return (pos == std::string::npos) ? "" : name.substr(name.rfind('.') + 1); +} + +} // namespace glslangtest diff --git a/gtests/TestFixture.h b/gtests/TestFixture.h new file mode 100644 index 00000000..e71bab1c --- /dev/null +++ b/gtests/TestFixture.h @@ -0,0 +1,341 @@ +// +// Copyright (C) 2016 Google, Inc. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. + +#ifndef GLSLANG_GTESTS_TEST_FIXTURE_H +#define GLSLANG_GTESTS_TEST_FIXTURE_H + +#include +#include +#include +#include +#include + +#include + +#include "SPIRV/GlslangToSpv.h" +#include "SPIRV/disassemble.h" +#include "SPIRV/doc.h" +#include "StandAlone/ResourceLimits.h" +#include "glslang/Public/ShaderLang.h" + +#include "Initializer.h" +#include "Settings.h" + +// We need CMake to provide us the absolute path to the directory containing +// test files, so we are certain to find those files no matter where the test +// harness binary is generated. This provides out-of-source build capability. +#ifndef GLSLANG_TEST_DIRECTORY +#error \ + "GLSLANG_TEST_DIRECTORY needs to be defined for gtest to locate test files." +#endif + +namespace glslangtest { + +// This function is used to provide custom test name suffixes based on the +// shader source file names. Otherwise, the test name suffixes will just be +// numbers, which are not quite obvious. +std::string FileNameAsCustomTestSuffix( + const ::testing::TestParamInfo& info); + +enum class Source { + GLSL, + HLSL, +}; + +// Enum for shader compilation semantics. +enum class Semantics { + OpenGL, + Vulkan, +}; + +// Enum for compilation target. +enum class Target { + AST, + Spv, + BothASTAndSpv, +}; + +EShLanguage GetShaderStage(const std::string& stage); + +EShMessages DeriveOptions(Source, Semantics, Target); + +// Reads the content of the file at the given |path|. On success, returns true +// and the contents; otherwise, returns false and an empty string. +std::pair ReadFile(const std::string& path); + +// Writes the given |contents| into the file at the given |path|. Returns true +// on successful output. +bool WriteFile(const std::string& path, const std::string& contents); + +// Returns the suffix of the given |name|. +std::string GetSuffix(const std::string& name); + +// Base class for glslang integration tests. It contains many handy utility-like +// methods such as reading shader source files, compiling into AST/SPIR-V, and +// comparing with expected outputs. +// +// To write value-Parameterized tests: +// using ValueParamTest = GlslangTest<::testing::TestWithParam>; +// To use as normal fixture: +// using FixtureTest = GlslangTest<::testing::Test>; +template +class GlslangTest : public GT { +public: + GlslangTest() + : defaultVersion(100), + defaultProfile(ENoProfile), + forceVersionProfile(false), + isForwardCompatible(false) {} + + // Tries to load the contents from the file at the given |path|. On success, + // writes the contents into |contents|. On failure, errors out. + void tryLoadFile(const std::string& path, const std::string& tag, + std::string* contents) + { + bool fileReadOk; + std::tie(fileReadOk, *contents) = ReadFile(path); + ASSERT_TRUE(fileReadOk) << "Cannot open " << tag << " file: " << path; + } + + // Checks the equality of |expected| and |real|. If they are not equal, + // write |real| to the given file named as |fname| if update mode is on. + void checkEqAndUpdateIfRequested(const std::string& expected, + const std::string& real, + const std::string& fname) + { + // In order to output the message we want under proper circumstances, + // we need the following operator<< stuff. + EXPECT_EQ(expected, real) + << (GlobalTestSettings.updateMode + ? ("Mismatch found and update mode turned on - " + "flushing expected result output.") + : ""); + + // Update the expected output file if requested. + // It looks weird to duplicate the comparison between expected_output + // and stream.str(). However, if creating a variable for the comparison + // result, we cannot have pretty print of the string diff in the above. + if (GlobalTestSettings.updateMode && expected != real) { + EXPECT_TRUE(WriteFile(fname, real)) << "Flushing failed"; + } + } + + struct ShaderResult { + std::string shaderName; + std::string output; + std::string error; + }; + + // A struct for holding all the information returned by glslang compilation + // and linking. + struct GlslangResult { + std::vector shaderResults; + std::string linkingOutput; + std::string linkingError; + std::string spirvWarningsErrors; + std::string spirv; // Optional SPIR-V disassembly text. + }; + + // Compiles and the given source |code| of the given shader |stage| into + // the target under the semantics conveyed via |controls|. Returns true + // and modifies |shader| on success. + bool compile(glslang::TShader* shader, const std::string& code, + const std::string& entryPointName, EShMessages controls, + const TBuiltInResource* resources=nullptr) + { + const char* shaderStrings = code.data(); + const int shaderLengths = static_cast(code.size()); + + shader->setStringsWithLengths(&shaderStrings, &shaderLengths, 1); + if (!entryPointName.empty()) shader->setEntryPoint(entryPointName.c_str()); + // Reinitialize glslang if the semantics change. + GlslangInitializer::InitializationToken token = + GlobalTestSettings.initializer->acquire(controls); + return shader->parse( + (resources ? resources : &glslang::DefaultTBuiltInResource), + defaultVersion, isForwardCompatible, controls); + } + + // Compiles and links the given source |code| of the given shader + // |stage| into the target under the semantics specified via |controls|. + // Returns a GlslangResult instance containing all the information generated + // during the process. If the target includes SPIR-V, also disassembles + // the result and returns disassembly text. + GlslangResult compileAndLink( + const std::string shaderName, const std::string& code, + const std::string& entryPointName, EShMessages controls) + { + const EShLanguage kind = GetShaderStage(GetSuffix(shaderName)); + + glslang::TShader shader(kind); + bool success = compile(&shader, code, entryPointName, controls); + + glslang::TProgram program; + program.addShader(&shader); + success &= program.link(controls); + + spv::SpvBuildLogger logger; + + if (success && (controls & EShMsgSpvRules)) { + std::vector spirv_binary; + glslang::GlslangToSpv(*program.getIntermediate(kind), + spirv_binary, &logger); + + std::ostringstream disassembly_stream; + spv::Parameterize(); + spv::Disassemble(disassembly_stream, spirv_binary); + return {{{shaderName, shader.getInfoLog(), shader.getInfoDebugLog()},}, + program.getInfoLog(), program.getInfoDebugLog(), + logger.getAllMessages(), disassembly_stream.str()}; + } else { + return {{{shaderName, shader.getInfoLog(), shader.getInfoDebugLog()},}, + program.getInfoLog(), program.getInfoDebugLog(), "", ""}; + } + } + + void outputResultToStream(std::ostringstream* stream, + const GlslangResult& result, + EShMessages controls) + { + const auto outputIfNotEmpty = [&stream](const std::string& str) { + if (!str.empty()) *stream << str << "\n"; + }; + + for (const auto& shaderResult : result.shaderResults) { + *stream << shaderResult.shaderName << "\n"; + outputIfNotEmpty(shaderResult.output); + outputIfNotEmpty(shaderResult.error); + } + outputIfNotEmpty(result.linkingOutput); + outputIfNotEmpty(result.linkingError); + *stream << result.spirvWarningsErrors; + + if (controls & EShMsgSpvRules) { + *stream + << (result.spirv.empty() + ? "SPIR-V is not generated for failed compile or link\n" + : result.spirv); + } + } + + void loadFileCompileAndCheck(const std::string& testDir, + const std::string& testName, + Source source, + Semantics semantics, + Target target, + const std::string& entryPointName="") + { + const std::string inputFname = testDir + "/" + testName; + const std::string expectedOutputFname = + testDir + "/baseResults/" + testName + ".out"; + std::string input, expectedOutput; + + tryLoadFile(inputFname, "input", &input); + tryLoadFile(expectedOutputFname, "expected output", &expectedOutput); + + const EShMessages controls = DeriveOptions(source, semantics, target); + GlslangResult result = + compileAndLink(testName, input, entryPointName, controls); + + // Generate the hybrid output in the way of glslangValidator. + std::ostringstream stream; + outputResultToStream(&stream, result, controls); + + checkEqAndUpdateIfRequested(expectedOutput, stream.str(), + expectedOutputFname); + } + + // Preprocesses the given |source| code. On success, returns true, the + // preprocessed shader, and warning messages. Otherwise, returns false, an + // empty string, and error messages. + std::tuple preprocess( + const std::string& source) + { + const char* shaderStrings = source.data(); + const int shaderLengths = static_cast(source.size()); + + glslang::TShader shader(EShLangVertex); + shader.setStringsWithLengths(&shaderStrings, &shaderLengths, 1); + std::string ppShader; + glslang::TShader::ForbidInclude includer; + const bool success = shader.preprocess( + &glslang::DefaultTBuiltInResource, defaultVersion, defaultProfile, + forceVersionProfile, isForwardCompatible, EShMsgOnlyPreprocessor, + &ppShader, includer); + + std::string log = shader.getInfoLog(); + log += shader.getInfoDebugLog(); + if (success) { + return std::make_tuple(true, ppShader, log); + } else { + return std::make_tuple(false, "", log); + } + } + + void loadFilePreprocessAndCheck(const std::string& testDir, + const std::string& testName) + { + const std::string inputFname = testDir + "/" + testName; + const std::string expectedOutputFname = + testDir + "/baseResults/" + testName + ".out"; + const std::string expectedErrorFname = + testDir + "/baseResults/" + testName + ".err"; + std::string input, expectedOutput, expectedError; + + tryLoadFile(inputFname, "input", &input); + tryLoadFile(expectedOutputFname, "expected output", &expectedOutput); + tryLoadFile(expectedErrorFname, "expected error", &expectedError); + + bool ppOk; + std::string output, error; + std::tie(ppOk, output, error) = preprocess(input); + if (!output.empty()) output += '\n'; + if (!error.empty()) error += '\n'; + + checkEqAndUpdateIfRequested(expectedOutput, output, + expectedOutputFname); + checkEqAndUpdateIfRequested(expectedError, error, + expectedErrorFname); + } + +private: + const int defaultVersion; + const EProfile defaultProfile; + const bool forceVersionProfile; + const bool isForwardCompatible; +}; + +} // namespace glslangtest + +#endif // GLSLANG_GTESTS_TEST_FIXTURE_H diff --git a/gtests/main.cpp b/gtests/main.cpp new file mode 100644 index 00000000..b9806aa2 --- /dev/null +++ b/gtests/main.cpp @@ -0,0 +1,63 @@ +// +// Copyright (C) 2016 Google, Inc. +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +// COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. + +#include + +#include + +#include "Initializer.h" +#include "Settings.h" + +int main(int argc, char** argv) +{ + ::testing::InitGoogleTest(&argc, argv); + + std::unique_ptr initializer( + new glslangtest::GlslangInitializer); + + glslangtest::GlobalTestSettings.initializer = initializer.get(); + + for (int i = 1; i < argc; ++i) { + if (!strncmp("--update-mode", argv[i], 13)) { + glslangtest::GlobalTestSettings.updateMode = true; + break; + } + } + + const int result = RUN_ALL_TESTS(); + + glslangtest::GlobalTestSettings.initializer = nullptr; + + return result; +} diff --git a/hlsl/CMakeLists.txt b/hlsl/CMakeLists.txt new file mode 100755 index 00000000..c7537e27 --- /dev/null +++ b/hlsl/CMakeLists.txt @@ -0,0 +1,26 @@ +set(SOURCES + hlslParseHelper.cpp + hlslScanContext.cpp + hlslOpMap.cpp + hlslTokenStream.cpp + hlslGrammar.cpp + hlslParseables.cpp) + +set(HEADERS + hlslParseHelper.h + hlslTokens.h + hlslScanContext.h + hlslOpMap.h + hlslTokenStream.h + hlslGrammar.h + hlslParseables.h) + +add_library(HLSL STATIC ${SOURCES} ${HEADERS}) +set_property(TARGET HLSL PROPERTY FOLDER hlsl) + +if(WIN32) + source_group("Source" FILES ${SOURCES} ${HEADERS}) +endif(WIN32) + +install(TARGETS HLSL + ARCHIVE DESTINATION lib) diff --git a/hlsl/hlslGrammar.cpp b/hlsl/hlslGrammar.cpp new file mode 100755 index 00000000..c1600e4d --- /dev/null +++ b/hlsl/hlslGrammar.cpp @@ -0,0 +1,1309 @@ +// +//Copyright (C) 2016 Google, Inc. +// +//All rights reserved. +// +//Redistribution and use in source and binary forms, with or without +//modification, are permitted provided that the following conditions +//are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of Google, Inc., nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +//POSSIBILITY OF SUCH DAMAGE. +// + +// +// This is a set of mutually recursive methods implementing the HLSL grammar. +// Generally, each returns +// - through an argument: a type specifically appropriate to which rule it +// recognized +// - through the return value: true/false to indicate whether or not it +// recognized its rule +// +// As much as possible, only grammar recognition should happen in this file, +// with all other work being farmed out to hlslParseHelper.cpp, which in turn +// will build the AST. +// +// The next token, yet to be "accepted" is always sitting in 'token'. +// When a method says it accepts a rule, that means all tokens involved +// in the rule will have been consumed, and none left in 'token'. +// + +#include "hlslTokens.h" +#include "hlslGrammar.h" + +namespace glslang { + +// Root entry point to this recursive decent parser. +// Return true if compilation unit was successfully accepted. +bool HlslGrammar::parse() +{ + advanceToken(); + return acceptCompilationUnit(); +} + +void HlslGrammar::expected(const char* syntax) +{ + parseContext.error(token.loc, "Expected", syntax, ""); +} + +// Only process the next token if it is an identifier. +// Return true if it was an identifier. +bool HlslGrammar::acceptIdentifier(HlslToken& idToken) +{ + if (peekTokenClass(EHTokIdentifier)) { + idToken = token; + advanceToken(); + return true; + } + + return false; +} + +// compilationUnit +// : list of externalDeclaration +// +bool HlslGrammar::acceptCompilationUnit() +{ + TIntermNode* unitNode = nullptr; + + while (! peekTokenClass(EHTokNone)) { + // externalDeclaration + TIntermNode* declarationNode; + if (! acceptDeclaration(declarationNode)) + return false; + + // hook it up + unitNode = intermediate.growAggregate(unitNode, declarationNode); + } + + // set root of AST + intermediate.setTreeRoot(unitNode); + + return true; +} + +// declaration +// : SEMICOLON +// : fully_specified_type SEMICOLON +// | fully_specified_type identifier SEMICOLON +// | fully_specified_type identifier = expression SEMICOLON +// | fully_specified_type identifier function_parameters SEMICOLON // function prototype +// | fully_specified_type identifier function_parameters COLON semantic compound_statement // function definition +// +// 'node' could get created if the declaration creates code, like an initializer +// or a function body. +// +bool HlslGrammar::acceptDeclaration(TIntermNode*& node) +{ + node = nullptr; + + // fully_specified_type + TType type; + if (! acceptFullySpecifiedType(type)) + return false; + + // identifier + HlslToken idToken; + if (acceptIdentifier(idToken)) { + // = expression + TIntermTyped* expressionNode = nullptr; + if (acceptTokenClass(EHTokAssign)) { + if (! acceptExpression(expressionNode)) { + expected("initializer"); + return false; + } + } + + // SEMICOLON + if (acceptTokenClass(EHTokSemicolon)) { + node = parseContext.declareVariable(idToken.loc, *idToken.string, type, 0, expressionNode); + return true; + } + + // function_parameters + TFunction* function = new TFunction(idToken.string, type); + if (acceptFunctionParameters(*function)) { + // COLON semantic + acceptSemantic(); + + // compound_statement + if (peekTokenClass(EHTokLeftBrace)) + return acceptFunctionDefinition(*function, node); + + // SEMICOLON + if (acceptTokenClass(EHTokSemicolon)) + return true; + + return false; + } + } + + // SEMICOLON + if (acceptTokenClass(EHTokSemicolon)) + return true; + + return true; +} + +// fully_specified_type +// : type_specifier +// | type_qualifier type_specifier +// +bool HlslGrammar::acceptFullySpecifiedType(TType& type) +{ + // type_qualifier + TQualifier qualifier; + qualifier.clear(); + acceptQualifier(qualifier); + + // type_specifier + if (! acceptType(type)) + return false; + type.getQualifier() = qualifier; + + return true; +} + +// If token is a qualifier, return its token class and advance to the next +// qualifier. Otherwise, return false, and don't advance. +void HlslGrammar::acceptQualifier(TQualifier& qualifier) +{ + switch (peek()) { + case EHTokUniform: + qualifier.storage = EvqUniform; + break; + case EHTokConst: + qualifier.storage = EvqConst; + break; + default: + return; + } + + advanceToken(); +} + +// If token is for a type, update 'type' with the type information, +// and return true and advance. +// Otherwise, return false, and don't advance +bool HlslGrammar::acceptType(TType& type) +{ + if (! token.isType) + return false; + + switch (peek()) { + case EHTokInt: + case EHTokInt1: + case EHTokDword: + new(&type) TType(EbtInt); + break; + case EHTokFloat: + new(&type) TType(EbtFloat); + break; + + case EHTokFloat1: + new(&type) TType(EbtFloat); + type.makeVector(); + break; + + case EHTokFloat2: + new(&type) TType(EbtFloat, EvqTemporary, 2); + break; + case EHTokFloat3: + new(&type) TType(EbtFloat, EvqTemporary, 3); + break; + case EHTokFloat4: + new(&type) TType(EbtFloat, EvqTemporary, 4); + break; + + case EHTokInt2: + new(&type) TType(EbtInt, EvqTemporary, 2); + break; + case EHTokInt3: + new(&type) TType(EbtInt, EvqTemporary, 3); + break; + case EHTokInt4: + new(&type) TType(EbtInt, EvqTemporary, 4); + break; + + case EHTokBool2: + new(&type) TType(EbtBool, EvqTemporary, 2); + break; + case EHTokBool3: + new(&type) TType(EbtBool, EvqTemporary, 3); + break; + case EHTokBool4: + new(&type) TType(EbtBool, EvqTemporary, 4); + break; + + case EHTokInt1x1: + new(&type) TType(EbtInt, EvqTemporary, 0, 1, 1); + break; + case EHTokInt1x2: + new(&type) TType(EbtInt, EvqTemporary, 0, 2, 1); + break; + case EHTokInt1x3: + new(&type) TType(EbtInt, EvqTemporary, 0, 3, 1); + break; + case EHTokInt1x4: + new(&type) TType(EbtInt, EvqTemporary, 0, 4, 1); + break; + case EHTokInt2x1: + new(&type) TType(EbtInt, EvqTemporary, 0, 1, 2); + break; + case EHTokInt2x2: + new(&type) TType(EbtInt, EvqTemporary, 0, 2, 2); + break; + case EHTokInt2x3: + new(&type) TType(EbtInt, EvqTemporary, 0, 3, 2); + break; + case EHTokInt2x4: + new(&type) TType(EbtInt, EvqTemporary, 0, 4, 2); + break; + case EHTokInt3x1: + new(&type) TType(EbtInt, EvqTemporary, 0, 1, 3); + break; + case EHTokInt3x2: + new(&type) TType(EbtInt, EvqTemporary, 0, 2, 3); + break; + case EHTokInt3x3: + new(&type) TType(EbtInt, EvqTemporary, 0, 3, 3); + break; + case EHTokInt3x4: + new(&type) TType(EbtInt, EvqTemporary, 0, 4, 3); + break; + case EHTokInt4x1: + new(&type) TType(EbtInt, EvqTemporary, 0, 1, 4); + break; + case EHTokInt4x2: + new(&type) TType(EbtInt, EvqTemporary, 0, 2, 4); + break; + case EHTokInt4x3: + new(&type) TType(EbtInt, EvqTemporary, 0, 3, 4); + break; + case EHTokInt4x4: + new(&type) TType(EbtInt, EvqTemporary, 0, 4, 4); + break; + + case EHTokFloat1x1: + new(&type) TType(EbtFloat, EvqTemporary, 0, 1, 1); + break; + case EHTokFloat1x2: + new(&type) TType(EbtFloat, EvqTemporary, 0, 2, 1); + break; + case EHTokFloat1x3: + new(&type) TType(EbtFloat, EvqTemporary, 0, 3, 1); + break; + case EHTokFloat1x4: + new(&type) TType(EbtFloat, EvqTemporary, 0, 4, 1); + break; + case EHTokFloat2x1: + new(&type) TType(EbtFloat, EvqTemporary, 0, 1, 2); + break; + case EHTokFloat2x2: + new(&type) TType(EbtFloat, EvqTemporary, 0, 2, 2); + break; + case EHTokFloat2x3: + new(&type) TType(EbtFloat, EvqTemporary, 0, 3, 2); + break; + case EHTokFloat2x4: + new(&type) TType(EbtFloat, EvqTemporary, 0, 4, 2); + break; + case EHTokFloat3x1: + new(&type) TType(EbtFloat, EvqTemporary, 0, 1, 3); + break; + case EHTokFloat3x2: + new(&type) TType(EbtFloat, EvqTemporary, 0, 2, 3); + break; + case EHTokFloat3x3: + new(&type) TType(EbtFloat, EvqTemporary, 0, 3, 3); + break; + case EHTokFloat3x4: + new(&type) TType(EbtFloat, EvqTemporary, 0, 4, 3); + break; + case EHTokFloat4x1: + new(&type) TType(EbtFloat, EvqTemporary, 0, 1, 4); + break; + case EHTokFloat4x2: + new(&type) TType(EbtFloat, EvqTemporary, 0, 2, 4); + break; + case EHTokFloat4x3: + new(&type) TType(EbtFloat, EvqTemporary, 0, 3, 4); + break; + case EHTokFloat4x4: + new(&type) TType(EbtFloat, EvqTemporary, 0, 4, 4); + break; + + case EHTokDouble1x1: + new(&type) TType(EbtDouble, EvqTemporary, 0, 1, 1); + break; + case EHTokDouble1x2: + new(&type) TType(EbtDouble, EvqTemporary, 0, 2, 1); + break; + case EHTokDouble1x3: + new(&type) TType(EbtDouble, EvqTemporary, 0, 3, 1); + break; + case EHTokDouble1x4: + new(&type) TType(EbtDouble, EvqTemporary, 0, 4, 1); + break; + case EHTokDouble2x1: + new(&type) TType(EbtDouble, EvqTemporary, 0, 1, 2); + break; + case EHTokDouble2x2: + new(&type) TType(EbtDouble, EvqTemporary, 0, 2, 2); + break; + case EHTokDouble2x3: + new(&type) TType(EbtDouble, EvqTemporary, 0, 3, 2); + break; + case EHTokDouble2x4: + new(&type) TType(EbtDouble, EvqTemporary, 0, 4, 2); + break; + case EHTokDouble3x1: + new(&type) TType(EbtDouble, EvqTemporary, 0, 1, 3); + break; + case EHTokDouble3x2: + new(&type) TType(EbtDouble, EvqTemporary, 0, 2, 3); + break; + case EHTokDouble3x3: + new(&type) TType(EbtDouble, EvqTemporary, 0, 3, 3); + break; + case EHTokDouble3x4: + new(&type) TType(EbtDouble, EvqTemporary, 0, 4, 3); + break; + case EHTokDouble4x1: + new(&type) TType(EbtDouble, EvqTemporary, 0, 1, 4); + break; + case EHTokDouble4x2: + new(&type) TType(EbtDouble, EvqTemporary, 0, 2, 4); + break; + case EHTokDouble4x3: + new(&type) TType(EbtDouble, EvqTemporary, 0, 3, 4); + break; + case EHTokDouble4x4: + new(&type) TType(EbtDouble, EvqTemporary, 0, 4, 4); + break; + + default: + return false; + } + + advanceToken(); + + return true; +} + +// function_parameters +// : LEFT_PAREN parameter_declaration COMMA parameter_declaration ... RIGHT_PAREN +// +bool HlslGrammar::acceptFunctionParameters(TFunction& function) +{ + // LEFT_PAREN + if (! acceptTokenClass(EHTokLeftParen)) + return false; + + do { + // parameter_declaration + if (! acceptParameterDeclaration(function)) + break; + + // COMMA + if (! acceptTokenClass(EHTokComma)) + break; + } while (true); + + // RIGHT_PAREN + if (! acceptTokenClass(EHTokRightParen)) { + expected(")"); + return false; + } + + return true; +} + +// parameter_declaration +// : fully_specified_type +// | fully_specified_type identifier +// +bool HlslGrammar::acceptParameterDeclaration(TFunction& function) +{ + // fully_specified_type + TType* type = new TType; + if (! acceptFullySpecifiedType(*type)) + return false; + + // identifier + HlslToken idToken; + acceptIdentifier(idToken); + + TParameter param = { idToken.string, type }; + function.addParameter(param); + + return true; +} + +// Do the work to create the function definition in addition to +// parsing the body (compound_statement). +bool HlslGrammar::acceptFunctionDefinition(TFunction& function, TIntermNode*& node) +{ + TFunction* functionDeclarator = parseContext.handleFunctionDeclarator(token.loc, function, false /* not prototype */); + + // This does a symbol table push + node = parseContext.handleFunctionDefinition(token.loc, *functionDeclarator); + + // compound_statement + TIntermNode* functionBody = nullptr; + if (acceptCompoundStatement(functionBody)) { + node = intermediate.growAggregate(node, functionBody); + intermediate.setAggregateOperator(node, EOpFunction, functionDeclarator->getType(), token.loc); + node->getAsAggregate()->setName(functionDeclarator->getMangledName().c_str()); + parseContext.symbolTable.pop(nullptr); + + return true; + } + + return false; +} + +// Accept an expression with parenthesis around it, where +// the parenthesis ARE NOT expression parenthesis, but the +// syntactically required ones like in "if ( expression )" +// +// Note this one is not set up to be speculative; as it gives +// errors if not found. +// +bool HlslGrammar::acceptParenExpression(TIntermTyped*& expression) +{ + // LEFT_PAREN + if (! acceptTokenClass(EHTokLeftParen)) + expected("("); + + if (! acceptExpression(expression)) { + expected("expression"); + return false; + } + + // RIGHT_PAREN + if (! acceptTokenClass(EHTokRightParen)) + expected(")"); + + return true; +} + +// The top-level full expression recognizer. +// +// expression +// : assignment_expression COMMA assignment_expression COMMA assignment_expression ... +// +bool HlslGrammar::acceptExpression(TIntermTyped*& node) +{ + node = nullptr; + + // assignment_expression + if (! acceptAssignmentExpression(node)) + return false; + + if (! peekTokenClass(EHTokComma)) + return true; + + do { + // ... COMMA + TSourceLoc loc = token.loc; + advanceToken(); + + // ... assignment_expression + TIntermTyped* rightNode = nullptr; + if (! acceptAssignmentExpression(rightNode)) { + expected("assignment expression"); + return false; + } + + node = intermediate.addComma(node, rightNode, loc); + + if (! peekTokenClass(EHTokComma)) + return true; + } while (true); +} + +// Accept an assignment expression, where assignment operations +// associate right-to-left. This is, it is implicit, for example +// +// a op (b op (c op d)) +// +// assigment_expression +// : binary_expression op binary_expression op binary_expression ... +// +bool HlslGrammar::acceptAssignmentExpression(TIntermTyped*& node) +{ + if (! acceptBinaryExpression(node, PlLogicalOr)) + return false; + + TOperator assignOp = HlslOpMap::assignment(peek()); + if (assignOp == EOpNull) + return true; + + // ... op + TSourceLoc loc = token.loc; + advanceToken(); + + // ... binary_expression + // But, done by recursing this function, which automatically + // gets the right-to-left associativity. + TIntermTyped* rightNode = nullptr; + if (! acceptAssignmentExpression(rightNode)) { + expected("assignment expression"); + return false; + } + + node = intermediate.addAssign(assignOp, node, rightNode, loc); + + if (! peekTokenClass(EHTokComma)) + return true; + + return true; +} + +// Accept a binary expression, for binary operations that +// associate left-to-right. This is, it is implicit, for example +// +// ((a op b) op c) op d +// +// binary_expression +// : expression op expression op expression ... +// +// where 'expression' is the next higher level in precedence. +// +bool HlslGrammar::acceptBinaryExpression(TIntermTyped*& node, PrecedenceLevel precedenceLevel) +{ + if (precedenceLevel > PlMul) + return acceptUnaryExpression(node); + + // assignment_expression + if (! acceptBinaryExpression(node, (PrecedenceLevel)(precedenceLevel + 1))) + return false; + + TOperator op = HlslOpMap::binary(peek()); + PrecedenceLevel tokenLevel = HlslOpMap::precedenceLevel(op); + if (tokenLevel < precedenceLevel) + return true; + + do { + // ... op + TSourceLoc loc = token.loc; + advanceToken(); + + // ... expression + TIntermTyped* rightNode = nullptr; + if (! acceptBinaryExpression(rightNode, (PrecedenceLevel)(precedenceLevel + 1))) { + expected("expression"); + return false; + } + + node = intermediate.addBinaryMath(op, node, rightNode, loc); + + if (! peekTokenClass(EHTokComma)) + return true; + } while (true); +} + +// unary_expression +// : (type) unary_expression +// | + unary_expression +// | - unary_expression +// | ! unary_expression +// | ~ unary_expression +// | ++ unary_expression +// | -- unary_expression +// | postfix_expression +// +bool HlslGrammar::acceptUnaryExpression(TIntermTyped*& node) +{ + // (type) unary_expression + // Have to look two steps ahead, because this could be, e.g., a + // postfix_expression instead, since that also starts with at "(". + if (acceptTokenClass(EHTokLeftParen)) { + TType castType; + if (acceptType(castType)) { + if (! acceptTokenClass(EHTokRightParen)) { + expected(")"); + return false; + } + + // We've matched "(type)" now, get the expression to cast + TSourceLoc loc = token.loc; + if (! acceptUnaryExpression(node)) + return false; + + // Hook it up like a constructor + TFunction* constructorFunction = parseContext.handleConstructorCall(loc, castType); + if (constructorFunction == nullptr) { + expected("type that can be constructed"); + return false; + } + TIntermTyped* arguments = nullptr; + parseContext.handleFunctionArgument(constructorFunction, arguments, node); + node = parseContext.handleFunctionCall(loc, constructorFunction, arguments); + + return true; + } else { + // This isn't a type cast, but it still started "(", so if it is a + // unary expression, it can only be a postfix_expression, so try that. + // Back it up first. + recedeToken(); + return acceptPostfixExpression(node); + } + } + + // peek for "op unary_expression" + TOperator unaryOp = HlslOpMap::preUnary(peek()); + + // postfix_expression (if no unary operator) + if (unaryOp == EOpNull) + return acceptPostfixExpression(node); + + // op unary_expression + TSourceLoc loc = token.loc; + advanceToken(); + if (! acceptUnaryExpression(node)) + return false; + + // + is a no-op + if (unaryOp == EOpAdd) + return true; + + node = intermediate.addUnaryMath(unaryOp, node, loc); + + return node != nullptr; +} + +// postfix_expression +// : LEFT_PAREN expression RIGHT_PAREN +// | literal +// | constructor +// | identifier +// | function_call +// | postfix_expression LEFT_BRACKET integer_expression RIGHT_BRACKET +// | postfix_expression DOT IDENTIFIER +// | postfix_expression INC_OP +// | postfix_expression DEC_OP +// +bool HlslGrammar::acceptPostfixExpression(TIntermTyped*& node) +{ + // Not implemented as self-recursive: + // The logical "right recursion" is done with an loop at the end + + // idToken will pick up either a variable or a function name in a function call + HlslToken idToken; + + // Find something before the postfix operations, as they can't operate + // on nothing. So, no "return true", they fall through, only "return false". + if (acceptTokenClass(EHTokLeftParen)) { + // LEFT_PAREN expression RIGHT_PAREN + if (! acceptExpression(node)) { + expected("expression"); + return false; + } + if (! acceptTokenClass(EHTokRightParen)) { + expected(")"); + return false; + } + } else if (acceptLiteral(node)) { + // literal (nothing else to do yet), go on to the + } else if (acceptConstructor(node)) { + // constructor (nothing else to do yet) + } else if (acceptIdentifier(idToken)) { + // identifier or function_call name + if (! peekTokenClass(EHTokLeftParen)) { + node = parseContext.handleVariable(idToken.loc, idToken.symbol, token.string); + } else if (acceptFunctionCall(idToken, node)) { + // function_call (nothing else to do yet) + } else { + expected("function call arguments"); + return false; + } + } else { + // nothing found, can't post operate + return false; + } + + // Something was found, chain as many postfix operations as exist. + do { + TSourceLoc loc = token.loc; + TOperator postOp = HlslOpMap::postUnary(peek()); + + // Consume only a valid post-unary operator, otherwise we are done. + switch (postOp) { + case EOpIndexDirectStruct: + case EOpIndexIndirect: + case EOpPostIncrement: + case EOpPostDecrement: + advanceToken(); + break; + default: + return true; + } + + // We have a valid post-unary operator, process it. + switch (postOp) { + case EOpIndexDirectStruct: + // todo + break; + case EOpIndexIndirect: + { + TIntermTyped* indexNode = nullptr; + if (! acceptExpression(indexNode) || + ! peekTokenClass(EHTokRightBracket)) { + expected("expression followed by ']'"); + return false; + } + // todo: node = intermediate.addBinaryMath( + } + case EOpPostIncrement: + case EOpPostDecrement: + node = intermediate.addUnaryMath(postOp, node, loc); + break; + default: + assert(0); + break; + } + } while (true); +} + +// constructor +// : type argument_list +// +bool HlslGrammar::acceptConstructor(TIntermTyped*& node) +{ + // type + TType type; + if (acceptType(type)) { + TFunction* constructorFunction = parseContext.handleConstructorCall(token.loc, type); + if (constructorFunction == nullptr) + return false; + + // arguments + TIntermTyped* arguments = nullptr; + if (! acceptArguments(constructorFunction, arguments)) { + expected("constructor arguments"); + return false; + } + + // hook it up + node = parseContext.handleFunctionCall(arguments->getLoc(), constructorFunction, arguments); + + return true; + } + + return false; +} + +// The function_call identifier was already recognized, and passed in as idToken. +// +// function_call +// : [idToken] arguments +// +bool HlslGrammar::acceptFunctionCall(HlslToken idToken, TIntermTyped*& node) +{ + // arguments + TFunction* function = new TFunction(idToken.string, TType(EbtVoid)); + TIntermTyped* arguments = nullptr; + if (! acceptArguments(function, arguments)) + return false; + + node = parseContext.handleFunctionCall(idToken.loc, function, arguments); + + return true; +} + +// arguments +// : LEFT_PAREN expression COMMA expression COMMA ... RIGHT_PAREN +// +// The arguments are pushed onto the 'function' argument list and +// onto the 'arguments' aggregate. +// +bool HlslGrammar::acceptArguments(TFunction* function, TIntermTyped*& arguments) +{ + // LEFT_PAREN + if (! acceptTokenClass(EHTokLeftParen)) + return false; + + do { + // expression + TIntermTyped* arg; + if (! acceptAssignmentExpression(arg)) + break; + + // hook it up + parseContext.handleFunctionArgument(function, arguments, arg); + + // COMMA + if (! acceptTokenClass(EHTokComma)) + break; + } while (true); + + // RIGHT_PAREN + if (! acceptTokenClass(EHTokRightParen)) { + expected(")"); + return false; + } + + return true; +} + +bool HlslGrammar::acceptLiteral(TIntermTyped*& node) +{ + switch (token.tokenClass) { + case EHTokIntConstant: + node = intermediate.addConstantUnion(token.i, token.loc, true); + break; + case EHTokFloatConstant: + node = intermediate.addConstantUnion(token.d, EbtFloat, token.loc, true); + break; + case EHTokDoubleConstant: + node = intermediate.addConstantUnion(token.d, EbtDouble, token.loc, true); + break; + case EHTokBoolConstant: + node = intermediate.addConstantUnion(token.b, token.loc, true); + break; + + default: + return false; + } + + advanceToken(); + + return true; +} + +// compound_statement +// : LEFT_CURLY statement statement ... RIGHT_CURLY +// +bool HlslGrammar::acceptCompoundStatement(TIntermNode*& retStatement) +{ + TIntermAggregate* compoundStatement = nullptr; + + // LEFT_CURLY + if (! acceptTokenClass(EHTokLeftBrace)) + return false; + + // statement statement ... + TIntermNode* statement = nullptr; + while (acceptStatement(statement)) { + // hook it up + compoundStatement = intermediate.growAggregate(compoundStatement, statement); + } + if (compoundStatement) + compoundStatement->setOperator(EOpSequence); + + retStatement = compoundStatement; + + // RIGHT_CURLY + return acceptTokenClass(EHTokRightBrace); +} + +bool HlslGrammar::acceptScopedStatement(TIntermNode*& statement) +{ + parseContext.pushScope(); + bool result = acceptNestedStatement(statement); + parseContext.popScope(); + + return result; +} + +bool HlslGrammar::acceptNestedStatement(TIntermNode*& statement) +{ + parseContext.nestStatement(); + bool result = acceptStatement(statement); + parseContext.unnestStatement(); + + return result; +} + +// statement +// : attributes attributed_statement +// +// attributed_statement +// : compound_statement +// | SEMICOLON +// | expression SEMICOLON +// | declaration_statement +// | selection_statement +// | switch_statement +// | case_label +// | iteration_statement +// | jump_statement +// +bool HlslGrammar::acceptStatement(TIntermNode*& statement) +{ + statement = nullptr; + + // attributes + acceptAttributes(); + + // attributed_statement + switch (peek()) { + case EHTokLeftBrace: + return acceptCompoundStatement(statement); + + case EHTokIf: + return acceptSelectionStatement(statement); + + case EHTokSwitch: + return acceptSwitchStatement(statement); + + case EHTokFor: + case EHTokDo: + case EHTokWhile: + return acceptIterationStatement(statement); + + case EHTokContinue: + case EHTokBreak: + case EHTokDiscard: + case EHTokReturn: + return acceptJumpStatement(statement); + + case EHTokCase: + return acceptCaseLabel(statement); + + case EHTokSemicolon: + return acceptTokenClass(EHTokSemicolon); + + case EHTokRightBrace: + // Performance: not strictly necessary, but stops a bunch of hunting early, + // and is how sequences of statements end. + return false; + + default: + { + // declaration + if (acceptDeclaration(statement)) + return true; + + // expression + TIntermTyped* node; + if (acceptExpression(node)) + statement = node; + else + return false; + + // SEMICOLON (following an expression) + if (! acceptTokenClass(EHTokSemicolon)) { + expected(";"); + return false; + } + } + } + + return true; +} + +// attributes +// : list of zero or more of: LEFT_BRACKET attribute RIGHT_BRACKET +// +// attribute: +// : UNROLL +// | UNROLL LEFT_PAREN literal RIGHT_PAREN +// | FASTOPT +// | ALLOW_UAV_CONDITION +// | BRANCH +// | FLATTEN +// | FORCECASE +// | CALL +// +void HlslGrammar::acceptAttributes() +{ + // For now, accept the [ XXX(X) ] syntax, but drop. + // TODO: subset to correct set? Pass on? + do { + // LEFT_BRACKET? + if (! acceptTokenClass(EHTokLeftBracket)) + return; + + // attribute + if (peekTokenClass(EHTokIdentifier)) { + // 'token.string' is the attribute + advanceToken(); + } else if (! peekTokenClass(EHTokRightBracket)) { + expected("identifier"); + advanceToken(); + } + + // (x) + if (acceptTokenClass(EHTokLeftParen)) { + TIntermTyped* node; + if (! acceptLiteral(node)) + expected("literal"); + // 'node' has the literal in it + if (! acceptTokenClass(EHTokRightParen)) + expected(")"); + } + + // RIGHT_BRACKET + if (acceptTokenClass(EHTokRightBracket)) + continue; + + expected("]"); + return; + + } while (true); +} + +// selection_statement +// : IF LEFT_PAREN expression RIGHT_PAREN statement +// : IF LEFT_PAREN expression RIGHT_PAREN statement ELSE statement +// +bool HlslGrammar::acceptSelectionStatement(TIntermNode*& statement) +{ + TSourceLoc loc = token.loc; + + // IF + if (! acceptTokenClass(EHTokIf)) + return false; + + // so that something declared in the condition is scoped to the lifetimes + // of the then-else statements + parseContext.pushScope(); + + // LEFT_PAREN expression RIGHT_PAREN + TIntermTyped* condition; + if (! acceptParenExpression(condition)) + return false; + + // create the child statements + TIntermNodePair thenElse = { nullptr, nullptr }; + + // then statement + if (! acceptScopedStatement(thenElse.node1)) { + expected("then statement"); + return false; + } + + // ELSE + if (acceptTokenClass(EHTokElse)) { + // else statement + if (! acceptScopedStatement(thenElse.node2)) { + expected("else statement"); + return false; + } + } + + // Put the pieces together + statement = intermediate.addSelection(condition, thenElse, loc); + parseContext.popScope(); + + return true; +} + +bool HlslGrammar::acceptSwitchStatement(TIntermNode*& statement) +{ + return false; +} + +// iteration_statement +// : WHILE LEFT_PAREN condition RIGHT_PAREN statement +// | DO LEFT_BRACE statement RIGHT_BRACE WHILE LEFT_PAREN expression RIGHT_PAREN SEMICOLON +// | FOR LEFT_PAREN for_init_statement for_rest_statement RIGHT_PAREN statement +// +// Non-speculative, only call if it needs to be found; WHILE or DO or FOR already seen. +bool HlslGrammar::acceptIterationStatement(TIntermNode*& statement) +{ + TSourceLoc loc = token.loc; + TIntermTyped* condition = nullptr; + + EHlslTokenClass loop = peek(); + assert(loop == EHTokDo || loop == EHTokFor || loop == EHTokWhile); + + // WHILE or DO or FOR + advanceToken(); + + switch (loop) { + case EHTokWhile: + // so that something declared in the condition is scoped to the lifetime + // of the while sub-statement + parseContext.pushScope(); + parseContext.nestLooping(); + + // LEFT_PAREN condition RIGHT_PAREN + if (! acceptParenExpression(condition)) + return false; + + // statement + if (! acceptScopedStatement(statement)) { + expected("while sub-statement"); + return false; + } + + parseContext.unnestLooping(); + parseContext.popScope(); + + statement = intermediate.addLoop(statement, condition, nullptr, true, loc); + + return true; + + case EHTokDo: + parseContext.nestLooping(); + + if (! acceptTokenClass(EHTokLeftBrace)) + expected("{"); + + // statement + if (! peekTokenClass(EHTokRightBrace) && ! acceptScopedStatement(statement)) { + expected("do sub-statement"); + return false; + } + + if (! acceptTokenClass(EHTokRightBrace)) + expected("}"); + + // WHILE + if (! acceptTokenClass(EHTokWhile)) { + expected("while"); + return false; + } + + // LEFT_PAREN condition RIGHT_PAREN + TIntermTyped* condition; + if (! acceptParenExpression(condition)) + return false; + + if (! acceptTokenClass(EHTokSemicolon)) + expected(";"); + + parseContext.unnestLooping(); + + statement = intermediate.addLoop(statement, condition, 0, false, loc); + + return true; + + case EHTokFor: + { + // LEFT_PAREN + if (! acceptTokenClass(EHTokLeftParen)) + expected("("); + + // so that something declared in the condition is scoped to the lifetime + // of the for sub-statement + parseContext.pushScope(); + + // initializer SEMI_COLON + TIntermTyped* initializer = nullptr; // TODO, "for (initializer" needs to support decl. statement + acceptExpression(initializer); + if (! acceptTokenClass(EHTokSemicolon)) + expected(";"); + + parseContext.nestLooping(); + + // condition SEMI_COLON + acceptExpression(condition); + if (! acceptTokenClass(EHTokSemicolon)) + expected(";"); + + // iterator SEMI_COLON + TIntermTyped* iterator = nullptr; + acceptExpression(iterator); + if (! acceptTokenClass(EHTokRightParen)) + expected(")"); + + // statement + if (! acceptScopedStatement(statement)) { + expected("for sub-statement"); + return false; + } + + statement = intermediate.addForLoop(statement, initializer, condition, iterator, true, loc); + + parseContext.popScope(); + parseContext.unnestLooping(); + + return true; + } + + default: + return false; + } +} + +// jump_statement +// : CONTINUE SEMICOLON +// | BREAK SEMICOLON +// | DISCARD SEMICOLON +// | RETURN SEMICOLON +// | RETURN expression SEMICOLON +// +bool HlslGrammar::acceptJumpStatement(TIntermNode*& statement) +{ + switch (peek()) { + case EHTokContinue: + case EHTokBreak: + case EHTokDiscard: + // TODO + return false; + + case EHTokReturn: + // return + if (acceptTokenClass(EHTokReturn)) { + // expression + TIntermTyped* node; + if (acceptExpression(node)) { + // hook it up + statement = intermediate.addBranch(EOpReturn, node, token.loc); + } else + statement = intermediate.addBranch(EOpReturn, token.loc); + + // SEMICOLON + if (! acceptTokenClass(EHTokSemicolon)) { + expected(";"); + return false; + } + + return true; + } + + default: + return false; + } +} + + +bool HlslGrammar::acceptCaseLabel(TIntermNode*& statement) +{ + return false; +} + +// COLON semantic +bool HlslGrammar::acceptSemantic() +{ + // COLON + if (acceptTokenClass(EHTokColon)) { + // semantic + HlslToken idToken; + if (! acceptIdentifier(idToken)) { + expected("semantic"); + return false; + } + } + + return true; +} + +} // end namespace glslang diff --git a/hlsl/hlslGrammar.h b/hlsl/hlslGrammar.h new file mode 100755 index 00000000..69535f30 --- /dev/null +++ b/hlsl/hlslGrammar.h @@ -0,0 +1,96 @@ +// +//Copyright (C) 2016 Google, Inc. +// +//All rights reserved. +// +//Redistribution and use in source and binary forms, with or without +//modification, are permitted provided that the following conditions +//are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of Google, Inc., nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +//POSSIBILITY OF SUCH DAMAGE. +// + +#ifndef HLSLGRAMMAR_H_ +#define HLSLGRAMMAR_H_ + +#include "hlslParseHelper.h" +#include "hlslOpMap.h" +#include "hlslTokenStream.h" + +namespace glslang { + + // Should just be the grammar aspect of HLSL. + // Described in more detail in hlslGrammar.cpp. + + class HlslGrammar : public HlslTokenStream { + public: + HlslGrammar(HlslScanContext& scanner, HlslParseContext& parseContext) + : HlslTokenStream(scanner), parseContext(parseContext), intermediate(parseContext.intermediate) { } + virtual ~HlslGrammar() { } + + bool parse(); + + protected: + void expected(const char*); + bool acceptIdentifier(HlslToken&); + bool acceptCompilationUnit(); + bool acceptDeclaration(TIntermNode*& node); + bool acceptFullySpecifiedType(TType&); + void acceptQualifier(TQualifier&); + bool acceptType(TType&); + bool acceptFunctionParameters(TFunction&); + bool acceptParameterDeclaration(TFunction&); + bool acceptFunctionDefinition(TFunction&, TIntermNode*&); + bool acceptParenExpression(TIntermTyped*&); + bool acceptExpression(TIntermTyped*&); + bool acceptAssignmentExpression(TIntermTyped*&); + bool acceptBinaryExpression(TIntermTyped*&, PrecedenceLevel); + bool acceptUnaryExpression(TIntermTyped*&); + bool acceptPostfixExpression(TIntermTyped*&); + bool acceptConstructor(TIntermTyped*&); + bool acceptFunctionCall(HlslToken, TIntermTyped*&); + bool acceptArguments(TFunction*, TIntermTyped*&); + bool acceptLiteral(TIntermTyped*&); + bool acceptCompoundStatement(TIntermNode*&); + bool acceptStatement(TIntermNode*&); + bool acceptScopedStatement(TIntermNode*&); + bool acceptNestedStatement(TIntermNode*&); + void acceptAttributes(); + bool acceptSelectionStatement(TIntermNode*&); + bool acceptSwitchStatement(TIntermNode*&); + bool acceptIterationStatement(TIntermNode*&); + bool acceptJumpStatement(TIntermNode*&); + bool acceptCaseLabel(TIntermNode*&); + + bool acceptSemantic(); + + HlslParseContext& parseContext; // state of parsing and helper functions for building the intermediate + TIntermediate& intermediate; // the final product, the intermediate representation, includes the AST + }; + +} // end namespace glslang + +#endif // HLSLGRAMMAR_H_ diff --git a/hlsl/hlslOpMap.cpp b/hlsl/hlslOpMap.cpp new file mode 100755 index 00000000..c31dd7cf --- /dev/null +++ b/hlsl/hlslOpMap.cpp @@ -0,0 +1,171 @@ +// +//Copyright (C) 2016 Google, Inc. +// +//All rights reserved. +// +//Redistribution and use in source and binary forms, with or without +//modification, are permitted provided that the following conditions +//are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of Google, Inc., nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +//POSSIBILITY OF SUCH DAMAGE. +// + +// Map from physical token form (e.g. '-') to logical operator +// form (e.g., binary subtract or unary negate). + +#include "hlslOpMap.h" + +namespace glslang { + +// Map parsing tokens that could be assignments into assignment operators. +TOperator HlslOpMap::assignment(EHlslTokenClass op) +{ + switch (op) { + case EHTokAssign: return EOpAssign; + case EHTokMulAssign: return EOpMulAssign; + case EHTokDivAssign: return EOpDivAssign; + case EHTokAddAssign: return EOpAddAssign; + case EHTokModAssign: return EOpModAssign; + case EHTokLeftAssign: return EOpLeftShiftAssign; + case EHTokRightAssign: return EOpRightShiftAssign; + case EHTokAndAssign: return EOpAndAssign; + case EHTokXorAssign: return EOpExclusiveOrAssign; + case EHTokOrAssign: return EOpInclusiveOrAssign; + case EHTokSubAssign: return EOpSubAssign; + + default: + return EOpNull; + } +} + +// Map parsing tokens that could be binary operations into binary operators. +TOperator HlslOpMap::binary(EHlslTokenClass op) +{ + switch (op) { + case EHTokPlus: return EOpAdd; + case EHTokDash: return EOpSub; + case EHTokStar: return EOpMul; + case EHTokSlash: return EOpDiv; + case EHTokPercent: return EOpMod; + case EHTokRightOp: return EOpRightShift; + case EHTokLeftOp: return EOpLeftShift; + case EHTokAmpersand: return EOpAnd; + case EHTokVerticalBar: return EOpInclusiveOr; + case EHTokCaret: return EOpExclusiveOr; + case EHTokEqOp: return EOpEqual; + case EHTokNeOp: return EOpNotEqual; + case EHTokLeftAngle: return EOpLessThan; + case EHTokRightAngle: return EOpGreaterThan; + case EHTokLeOp: return EOpLessThanEqual; + case EHTokGeOp: return EOpGreaterThanEqual; + case EHTokOrOp: return EOpLogicalOr; + case EHTokXorOp: return EOpLogicalXor; + case EHTokAndOp: return EOpLogicalAnd; + + default: + return EOpNull; + } +} + +// Map parsing tokens that could be unary operations into unary operators. +// These are just the ones that can appear in front of its operand. +TOperator HlslOpMap::preUnary(EHlslTokenClass op) +{ + switch (op) { + case EHTokPlus: return EOpAdd; // means no-op, but still a unary op was present + case EHTokDash: return EOpNegative; + case EHTokBang: return EOpLogicalNot; + case EHTokTilde: return EOpBitwiseNot; + + case EHTokIncOp: return EOpPreIncrement; + case EHTokDecOp: return EOpPreDecrement; + + default: return EOpNull; // means not a pre-unary op + } +} + +// Map parsing tokens that could be unary operations into unary operators. +// These are just the ones that can appear behind its operand. +TOperator HlslOpMap::postUnary(EHlslTokenClass op) +{ + switch (op) { + case EHTokDot: return EOpIndexDirectStruct; + case EHTokLeftBracket: return EOpIndexIndirect; // may need to change later to EOpIndexDirect + + case EHTokIncOp: return EOpPostIncrement; + case EHTokDecOp: return EOpPostDecrement; + + default: return EOpNull; // means not a post-unary op + } +} + +// Map operators into their level of precedence. +PrecedenceLevel HlslOpMap::precedenceLevel(TOperator op) +{ + switch (op) { + case EOpLogicalOr: + return PlLogicalOr; + case EOpLogicalXor: + return PlLogicalXor; + case EOpLogicalAnd: + return PlLogicalAnd; + + case EOpInclusiveOr: + return PlBitwiseOr; + case EOpExclusiveOr: + return PlBitwiseXor; + case EOpAnd: + return PlBitwiseAnd; + + case EOpEqual: + case EOpNotEqual: + return PlEquality; + + case EOpLessThan: + case EOpGreaterThan: + case EOpLessThanEqual: + case EOpGreaterThanEqual: + return PlRelational; + + case EOpRightShift: + case EOpLeftShift: + return PlShift; + + case EOpAdd: + case EOpSub: + return PlAdd; + + case EOpMul: + case EOpDiv: + case EOpMod: + return PlMul; + + default: + return PlBad; + } +} + +} // end namespace glslang diff --git a/hlsl/hlslOpMap.h b/hlsl/hlslOpMap.h new file mode 100755 index 00000000..92463787 --- /dev/null +++ b/hlsl/hlslOpMap.h @@ -0,0 +1,69 @@ +// +//Copyright (C) 2016 Google, Inc. +// +//All rights reserved. +// +//Redistribution and use in source and binary forms, with or without +//modification, are permitted provided that the following conditions +//are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of Google, Inc., nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +//POSSIBILITY OF SUCH DAMAGE. +// + +#ifndef HLSLOPMAP_H_ +#define HLSLOPMAP_H_ + +#include "hlslScanContext.h" + +namespace glslang { + + enum PrecedenceLevel { + PlBad, + PlLogicalOr, + PlLogicalXor, + PlLogicalAnd, + PlBitwiseOr, + PlBitwiseXor, + PlBitwiseAnd, + PlEquality, + PlRelational, + PlShift, + PlAdd, + PlMul + }; + + class HlslOpMap { + public: + static TOperator assignment(EHlslTokenClass op); + static TOperator binary(EHlslTokenClass op); + static TOperator preUnary(EHlslTokenClass op); + static TOperator postUnary(EHlslTokenClass op); + static PrecedenceLevel precedenceLevel(TOperator); + }; + +} // end namespace glslang + +#endif // HLSLOPMAP_H_ diff --git a/hlsl/hlslParseHelper.cpp b/hlsl/hlslParseHelper.cpp new file mode 100755 index 00000000..2cdaf0c0 --- /dev/null +++ b/hlsl/hlslParseHelper.cpp @@ -0,0 +1,3587 @@ +// +//Copyright (C) 2016 Google, Inc. +// +//All rights reserved. +// +//Redistribution and use in source and binary forms, with or without +//modification, are permitted provided that the following conditions +//are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +//POSSIBILITY OF SUCH DAMAGE. +// + +#include "hlslParseHelper.h" +#include "hlslScanContext.h" +#include "hlslGrammar.h" + +#include "../glslang/MachineIndependent/Scan.h" +#include "../glslang/MachineIndependent/preprocessor/PpContext.h" + +#include "../glslang/OSDependent/osinclude.h" + +#include +#include + +namespace glslang { + +HlslParseContext::HlslParseContext(TSymbolTable& symbolTable, TIntermediate& interm, bool /*parsingBuiltins*/, + int version, EProfile profile, int spv, int vulkan, EShLanguage language, TInfoSink& infoSink, + bool forwardCompatible, EShMessages messages) : + TParseContextBase(symbolTable, interm, version, profile, spv, vulkan, language, infoSink, forwardCompatible, messages), + contextPragma(true, false), loopNestingLevel(0), structNestingLevel(0), controlFlowNestingLevel(0), statementNestingLevel(0), + postMainReturn(false), + limits(resources.limits), + afterEOF(false) +{ + // ensure we always have a linkage node, even if empty, to simplify tree topology algorithms + linkage = new TIntermAggregate; + + globalUniformDefaults.clear(); + globalUniformDefaults.layoutMatrix = ElmColumnMajor; + globalUniformDefaults.layoutPacking = vulkan > 0 ? ElpStd140 : ElpShared; + + globalBufferDefaults.clear(); + globalBufferDefaults.layoutMatrix = ElmColumnMajor; + globalBufferDefaults.layoutPacking = vulkan > 0 ? ElpStd430 : ElpShared; + + globalInputDefaults.clear(); + globalOutputDefaults.clear(); + + // "Shaders in the transform + // feedback capturing mode have an initial global default of + // layout(xfb_buffer = 0) out;" + if (language == EShLangVertex || + language == EShLangTessControl || + language == EShLangTessEvaluation || + language == EShLangGeometry) + globalOutputDefaults.layoutXfbBuffer = 0; + + if (language == EShLangGeometry) + globalOutputDefaults.layoutStream = 0; +} + +HlslParseContext::~HlslParseContext() +{ +} + +void HlslParseContext::setLimits(const TBuiltInResource& r) +{ + resources = r; + intermediate.setLimits(resources); +} + +// +// Parse an array of strings using the parser in HlslRules. +// +// Returns true for successful acceptance of the shader, false if any errors. +// +bool HlslParseContext::parseShaderStrings(TPpContext& ppContext, TInputScanner& input, bool versionWillBeError) +{ + currentScanner = &input; + ppContext.setInput(input, versionWillBeError); + + HlslScanContext::fillInKeywordMap(); // TODO: right place, and include the delete too + + HlslScanContext scanContext(*this, ppContext); + HlslGrammar grammar(scanContext, *this); + if (! grammar.parse()) + printf("HLSL translation failed.\n"); + + return numErrors == 0; +} + +void HlslParseContext::handlePragma(const TSourceLoc& loc, const TVector& tokens) +{ + if (pragmaCallback) + pragmaCallback(loc.line, tokens); + + if (tokens.size() == 0) + return; +} + +// +// Look at a '.' field selector string and change it into offsets +// for a vector or scalar +// +// Returns true if there is no error. +// +bool HlslParseContext::parseVectorFields(const TSourceLoc& loc, const TString& compString, int vecSize, TVectorFields& fields) +{ + fields.num = (int)compString.size(); + if (fields.num > 4) { + error(loc, "illegal vector field selection", compString.c_str(), ""); + return false; + } + + enum { + exyzw, + ergba, + estpq, + } fieldSet[4]; + + for (int i = 0; i < fields.num; ++i) { + switch (compString[i]) { + case 'x': + fields.offsets[i] = 0; + fieldSet[i] = exyzw; + break; + case 'r': + fields.offsets[i] = 0; + fieldSet[i] = ergba; + break; + case 's': + fields.offsets[i] = 0; + fieldSet[i] = estpq; + break; + case 'y': + fields.offsets[i] = 1; + fieldSet[i] = exyzw; + break; + case 'g': + fields.offsets[i] = 1; + fieldSet[i] = ergba; + break; + case 't': + fields.offsets[i] = 1; + fieldSet[i] = estpq; + break; + case 'z': + fields.offsets[i] = 2; + fieldSet[i] = exyzw; + break; + case 'b': + fields.offsets[i] = 2; + fieldSet[i] = ergba; + break; + case 'p': + fields.offsets[i] = 2; + fieldSet[i] = estpq; + break; + + case 'w': + fields.offsets[i] = 3; + fieldSet[i] = exyzw; + break; + case 'a': + fields.offsets[i] = 3; + fieldSet[i] = ergba; + break; + case 'q': + fields.offsets[i] = 3; + fieldSet[i] = estpq; + break; + default: + error(loc, "illegal vector field selection", compString.c_str(), ""); + return false; + } + } + + for (int i = 0; i < fields.num; ++i) { + if (fields.offsets[i] >= vecSize) { + error(loc, "vector field selection out of range", compString.c_str(), ""); + return false; + } + + if (i > 0) { + if (fieldSet[i] != fieldSet[i - 1]) { + error(loc, "illegal - vector component fields not from the same set", compString.c_str(), ""); + return false; + } + } + } + + return true; +} + +// +// Used to output syntax, parsing, and semantic errors. +// + +void HlslParseContext::outputMessage(const TSourceLoc& loc, const char* szReason, + const char* szToken, + const char* szExtraInfoFormat, + TPrefixType prefix, va_list args) +{ + const int maxSize = MaxTokenLength + 200; + char szExtraInfo[maxSize]; + + safe_vsprintf(szExtraInfo, maxSize, szExtraInfoFormat, args); + + infoSink.info.prefix(prefix); + infoSink.info.location(loc); + infoSink.info << "'" << szToken << "' : " << szReason << " " << szExtraInfo << "\n"; + + if (prefix == EPrefixError) { + ++numErrors; + } +} + +void C_DECL HlslParseContext::error(const TSourceLoc& loc, const char* szReason, const char* szToken, + const char* szExtraInfoFormat, ...) +{ + if (messages & EShMsgOnlyPreprocessor) + return; + va_list args; + va_start(args, szExtraInfoFormat); + outputMessage(loc, szReason, szToken, szExtraInfoFormat, EPrefixError, args); + va_end(args); +} + +void C_DECL HlslParseContext::warn(const TSourceLoc& loc, const char* szReason, const char* szToken, + const char* szExtraInfoFormat, ...) +{ + if (suppressWarnings()) + return; + va_list args; + va_start(args, szExtraInfoFormat); + outputMessage(loc, szReason, szToken, szExtraInfoFormat, EPrefixWarning, args); + va_end(args); +} + +void C_DECL HlslParseContext::ppError(const TSourceLoc& loc, const char* szReason, const char* szToken, + const char* szExtraInfoFormat, ...) +{ + va_list args; + va_start(args, szExtraInfoFormat); + outputMessage(loc, szReason, szToken, szExtraInfoFormat, EPrefixError, args); + va_end(args); +} + +void C_DECL HlslParseContext::ppWarn(const TSourceLoc& loc, const char* szReason, const char* szToken, + const char* szExtraInfoFormat, ...) +{ + va_list args; + va_start(args, szExtraInfoFormat); + outputMessage(loc, szReason, szToken, szExtraInfoFormat, EPrefixWarning, args); + va_end(args); +} + +// +// Handle seeing a variable identifier in the grammar. +// +TIntermTyped* HlslParseContext::handleVariable(const TSourceLoc& loc, TSymbol* symbol, const TString* string) +{ + TIntermTyped* node = nullptr; + + // Error check for requiring specific extensions present. + if (symbol && symbol->getNumExtensions()) + requireExtensions(loc, symbol->getNumExtensions(), symbol->getExtensions(), symbol->getName().c_str()); + + if (symbol && symbol->isReadOnly()) { + // All shared things containing an implicitly sized array must be copied up + // on first use, so that all future references will share its array structure, + // so that editing the implicit size will effect all nodes consuming it, + // and so that editing the implicit size won't change the shared one. + // + // If this is a variable or a block, check it and all it contains, but if this + // is a member of an anonymous block, check the whole block, as the whole block + // will need to be copied up if it contains an implicitly-sized array. + if (symbol->getType().containsImplicitlySizedArray() || (symbol->getAsAnonMember() && symbol->getAsAnonMember()->getAnonContainer().getType().containsImplicitlySizedArray())) + makeEditable(symbol); + } + + const TVariable* variable; + const TAnonMember* anon = symbol ? symbol->getAsAnonMember() : nullptr; + if (anon) { + // It was a member of an anonymous container. + + // Create a subtree for its dereference. + variable = anon->getAnonContainer().getAsVariable(); + TIntermTyped* container = intermediate.addSymbol(*variable, loc); + TIntermTyped* constNode = intermediate.addConstantUnion(anon->getMemberNumber(), loc); + node = intermediate.addIndex(EOpIndexDirectStruct, container, constNode, loc); + + node->setType(*(*variable->getType().getStruct())[anon->getMemberNumber()].type); + if (node->getType().hiddenMember()) + error(loc, "member of nameless block was not redeclared", string->c_str(), ""); + } else { + // Not a member of an anonymous container. + + // The symbol table search was done in the lexical phase. + // See if it was a variable. + variable = symbol ? symbol->getAsVariable() : nullptr; + if (variable) { + if ((variable->getType().getBasicType() == EbtBlock || + variable->getType().getBasicType() == EbtStruct) && variable->getType().getStruct() == nullptr) { + error(loc, "cannot be used (maybe an instance name is needed)", string->c_str(), ""); + variable = nullptr; + } + } else { + if (symbol) + error(loc, "variable name expected", string->c_str(), ""); + } + + // Recovery, if it wasn't found or was not a variable. + if (! variable) + variable = new TVariable(string, TType(EbtVoid)); + + if (variable->getType().getQualifier().isFrontEndConstant()) + node = intermediate.addConstantUnion(variable->getConstArray(), variable->getType(), loc); + else + node = intermediate.addSymbol(*variable, loc); + } + + if (variable->getType().getQualifier().isIo()) + intermediate.addIoAccessed(*string); + + return node; +} + +// +// Handle seeing a base[index] dereference in the grammar. +// +TIntermTyped* HlslParseContext::handleBracketDereference(const TSourceLoc& loc, TIntermTyped* base, TIntermTyped* index) +{ + TIntermTyped* result = nullptr; + + int indexValue = 0; + if (index->getQualifier().storage == EvqConst) { + indexValue = index->getAsConstantUnion()->getConstArray()[0].getIConst(); + checkIndex(loc, base->getType(), indexValue); + } + + variableCheck(base); + if (! base->isArray() && ! base->isMatrix() && ! base->isVector()) { + if (base->getAsSymbolNode()) + error(loc, " left of '[' is not of type array, matrix, or vector ", base->getAsSymbolNode()->getName().c_str(), ""); + else + error(loc, " left of '[' is not of type array, matrix, or vector ", "expression", ""); + } else if (base->getType().getQualifier().storage == EvqConst && index->getQualifier().storage == EvqConst) + return intermediate.foldDereference(base, indexValue, loc); + else { + // at least one of base and index is variable... + + if (base->getAsSymbolNode() && isIoResizeArray(base->getType())) + handleIoResizeArrayAccess(loc, base); + + if (index->getQualifier().storage == EvqConst) { + if (base->getType().isImplicitlySizedArray()) + updateImplicitArraySize(loc, base, indexValue); + result = intermediate.addIndex(EOpIndexDirect, base, index, loc); + } else { + result = intermediate.addIndex(EOpIndexIndirect, base, index, loc); + } + } + + if (result == nullptr) { + // Insert dummy error-recovery result + result = intermediate.addConstantUnion(0.0, EbtFloat, loc); + } else { + // Insert valid dereferenced result + TType newType(base->getType(), 0); // dereferenced type + if (base->getType().getQualifier().storage == EvqConst && index->getQualifier().storage == EvqConst) + newType.getQualifier().storage = EvqConst; + else + newType.getQualifier().storage = EvqTemporary; + result->setType(newType); + } + + return result; +} + +void HlslParseContext::checkIndex(const TSourceLoc& loc, const TType& type, int& index) +{ + // HLSL todo: any rules for index fixups? +} + +// Make a shared symbol have a non-shared version that can be edited by the current +// compile, such that editing its type will not change the shared version and will +// effect all nodes sharing it. +void HlslParseContext::makeEditable(TSymbol*& symbol) +{ + // copyUp() does a deep copy of the type. + symbol = symbolTable.copyUp(symbol); + + // Also, see if it's tied to IO resizing + if (isIoResizeArray(symbol->getType())) + ioArraySymbolResizeList.push_back(symbol); + + // Also, save it in the AST for linker use. + intermediate.addSymbolLinkageNode(linkage, *symbol); +} + +TVariable* HlslParseContext::getEditableVariable(const char* name) +{ + bool builtIn; + TSymbol* symbol = symbolTable.find(name, &builtIn); + if (builtIn) + makeEditable(symbol); + + return symbol->getAsVariable(); +} + +// Return true if this is a geometry shader input array or tessellation control output array. +bool HlslParseContext::isIoResizeArray(const TType& type) const +{ + return type.isArray() && + ((language == EShLangGeometry && type.getQualifier().storage == EvqVaryingIn) || + (language == EShLangTessControl && type.getQualifier().storage == EvqVaryingOut && ! type.getQualifier().patch)); +} + +// If an array is not isIoResizeArray() but is an io array, make sure it has the right size +void HlslParseContext::fixIoArraySize(const TSourceLoc& loc, TType& type) +{ + if (! type.isArray() || type.getQualifier().patch || symbolTable.atBuiltInLevel()) + return; + + assert(! isIoResizeArray(type)); + + if (type.getQualifier().storage != EvqVaryingIn || type.getQualifier().patch) + return; + + if (language == EShLangTessControl || language == EShLangTessEvaluation) { + if (type.getOuterArraySize() != resources.maxPatchVertices) { + if (type.isExplicitlySizedArray()) + error(loc, "tessellation input array size must be gl_MaxPatchVertices or implicitly sized", "[]", ""); + type.changeOuterArraySize(resources.maxPatchVertices); + } + } +} + +// Handle a dereference of a geometry shader input array or tessellation control output array. +// See ioArraySymbolResizeList comment in ParseHelper.h. +// +void HlslParseContext::handleIoResizeArrayAccess(const TSourceLoc& /*loc*/, TIntermTyped* base) +{ + TIntermSymbol* symbolNode = base->getAsSymbolNode(); + assert(symbolNode); + if (! symbolNode) + return; + + // fix array size, if it can be fixed and needs to be fixed (will allow variable indexing) + if (symbolNode->getType().isImplicitlySizedArray()) { + int newSize = getIoArrayImplicitSize(); + if (newSize > 0) + symbolNode->getWritableType().changeOuterArraySize(newSize); + } +} + +// If there has been an input primitive declaration (geometry shader) or an output +// number of vertices declaration(tessellation shader), make sure all input array types +// match it in size. Types come either from nodes in the AST or symbols in the +// symbol table. +// +// Types without an array size will be given one. +// Types already having a size that is wrong will get an error. +// +void HlslParseContext::checkIoArraysConsistency(const TSourceLoc& loc, bool tailOnly) +{ + int requiredSize = getIoArrayImplicitSize(); + if (requiredSize == 0) + return; + + const char* feature; + if (language == EShLangGeometry) + feature = TQualifier::getGeometryString(intermediate.getInputPrimitive()); + else if (language == EShLangTessControl) + feature = "vertices"; + else + feature = "unknown"; + + if (tailOnly) { + checkIoArrayConsistency(loc, requiredSize, feature, ioArraySymbolResizeList.back()->getWritableType(), ioArraySymbolResizeList.back()->getName()); + return; + } + + for (size_t i = 0; i < ioArraySymbolResizeList.size(); ++i) + checkIoArrayConsistency(loc, requiredSize, feature, ioArraySymbolResizeList[i]->getWritableType(), ioArraySymbolResizeList[i]->getName()); +} + +int HlslParseContext::getIoArrayImplicitSize() const +{ + if (language == EShLangGeometry) + return TQualifier::mapGeometryToSize(intermediate.getInputPrimitive()); + else if (language == EShLangTessControl) + return intermediate.getVertices() != TQualifier::layoutNotSet ? intermediate.getVertices() : 0; + else + return 0; +} + +void HlslParseContext::checkIoArrayConsistency(const TSourceLoc& loc, int requiredSize, const char* feature, TType& type, const TString& name) +{ + if (type.isImplicitlySizedArray()) + type.changeOuterArraySize(requiredSize); +} + +// Handle seeing a binary node with a math operation. +TIntermTyped* HlslParseContext::handleBinaryMath(const TSourceLoc& loc, const char* str, TOperator op, TIntermTyped* left, TIntermTyped* right) +{ + TIntermTyped* result = intermediate.addBinaryMath(op, left, right, loc); + if (! result) + binaryOpError(loc, str, left->getCompleteString(), right->getCompleteString()); + + return result; +} + +// Handle seeing a unary node with a math operation. +TIntermTyped* HlslParseContext::handleUnaryMath(const TSourceLoc& loc, const char* str, TOperator op, TIntermTyped* childNode) +{ + TIntermTyped* result = intermediate.addUnaryMath(op, childNode, loc); + + if (result) + return result; + else + unaryOpError(loc, str, childNode->getCompleteString()); + + return childNode; +} + +// +// Handle seeing a base.field dereference in the grammar. +// +TIntermTyped* HlslParseContext::handleDotDereference(const TSourceLoc& loc, TIntermTyped* base, const TString& field) +{ + variableCheck(base); + + // + // .length() can't be resolved until we later see the function-calling syntax. + // Save away the name in the AST for now. Processing is completed in + // handleLengthMethod(). + // + if (field == "length") { + return intermediate.addMethod(base, TType(EbtInt), &field, loc); + } + + // It's not .length() if we get to here. + + if (base->isArray()) { + error(loc, "cannot apply to an array:", ".", field.c_str()); + + return base; + } + + // It's neither an array nor .length() if we get here, + // leaving swizzles and struct/block dereferences. + + TIntermTyped* result = base; + if (base->isVector() || base->isScalar()) { + TVectorFields fields; + if (! parseVectorFields(loc, field, base->getVectorSize(), fields)) { + fields.num = 1; + fields.offsets[0] = 0; + } + + if (base->isScalar()) { + if (fields.num == 1) + return result; + else { + TType type(base->getBasicType(), EvqTemporary, fields.num); + return addConstructor(loc, base, type, mapTypeToConstructorOp(type)); + } + } + + if (base->getType().getQualifier().isFrontEndConstant()) + result = intermediate.foldSwizzle(base, fields, loc); + else { + if (fields.num == 1) { + TIntermTyped* index = intermediate.addConstantUnion(fields.offsets[0], loc); + result = intermediate.addIndex(EOpIndexDirect, base, index, loc); + result->setType(TType(base->getBasicType(), EvqTemporary, base->getType().getQualifier().precision)); + } else { + TString vectorString = field; + TIntermTyped* index = intermediate.addSwizzle(fields, loc); + result = intermediate.addIndex(EOpVectorSwizzle, base, index, loc); + result->setType(TType(base->getBasicType(), EvqTemporary, base->getType().getQualifier().precision, (int)vectorString.size())); + } + } + } else if (base->getBasicType() == EbtStruct || base->getBasicType() == EbtBlock) { + const TTypeList* fields = base->getType().getStruct(); + bool fieldFound = false; + int member; + for (member = 0; member < (int)fields->size(); ++member) { + if ((*fields)[member].type->getFieldName() == field) { + fieldFound = true; + break; + } + } + if (fieldFound) { + if (base->getType().getQualifier().storage == EvqConst) + result = intermediate.foldDereference(base, member, loc); + else { + TIntermTyped* index = intermediate.addConstantUnion(member, loc); + result = intermediate.addIndex(EOpIndexDirectStruct, base, index, loc); + result->setType(*(*fields)[member].type); + } + } else + error(loc, "no such field in structure", field.c_str(), ""); + } else + error(loc, "does not apply to this type:", field.c_str(), base->getType().getCompleteString().c_str()); + + return result; +} + +// +// Handle seeing a function declarator in the grammar. This is the precursor +// to recognizing a function prototype or function definition. +// +TFunction* HlslParseContext::handleFunctionDeclarator(const TSourceLoc& loc, TFunction& function, bool prototype) +{ + // + // Multiple declarations of the same function name are allowed. + // + // If this is a definition, the definition production code will check for redefinitions + // (we don't know at this point if it's a definition or not). + // + // Redeclarations (full signature match) are allowed. But, return types and parameter qualifiers must also match. + // - except ES 100, which only allows a single prototype + // + // ES 100 does not allow redefining, but does allow overloading of built-in functions. + // ES 300 does not allow redefining or overloading of built-in functions. + // + bool builtIn; + TSymbol* symbol = symbolTable.find(function.getMangledName(), &builtIn); + const TFunction* prevDec = symbol ? symbol->getAsFunction() : 0; + + if (prototype) { + // All built-in functions are defined, even though they don't have a body. + // Count their prototype as a definition instead. + if (symbolTable.atBuiltInLevel()) + function.setDefined(); + else { + if (prevDec && ! builtIn) + symbol->getAsFunction()->setPrototyped(); // need a writable one, but like having prevDec as a const + function.setPrototyped(); + } + } + + // This insert won't actually insert it if it's a duplicate signature, but it will still check for + // other forms of name collisions. + if (! symbolTable.insert(function)) + error(loc, "function name is redeclaration of existing name", function.getName().c_str(), ""); + + // + // If this is a redeclaration, it could also be a definition, + // in which case, we need to use the parameter names from this one, and not the one that's + // being redeclared. So, pass back this declaration, not the one in the symbol table. + // + return &function; +} + +// +// Handle seeing the function prototype in front of a function definition in the grammar. +// The body is handled after this function returns. +// +TIntermAggregate* HlslParseContext::handleFunctionDefinition(const TSourceLoc& loc, TFunction& function) +{ + currentCaller = function.getMangledName(); + TSymbol* symbol = symbolTable.find(function.getMangledName()); + TFunction* prevDec = symbol ? symbol->getAsFunction() : nullptr; + + if (! prevDec) + error(loc, "can't find function", function.getName().c_str(), ""); + // Note: 'prevDec' could be 'function' if this is the first time we've seen function + // as it would have just been put in the symbol table. Otherwise, we're looking up + // an earlier occurrence. + + if (prevDec && prevDec->isDefined()) { + // Then this function already has a body. + error(loc, "function already has a body", function.getName().c_str(), ""); + } + if (prevDec && ! prevDec->isDefined()) { + prevDec->setDefined(); + + // Remember the return type for later checking for RETURN statements. + currentFunctionType = &(prevDec->getType()); + } else + currentFunctionType = new TType(EbtVoid); + functionReturnsValue = false; + + inEntrypoint = (function.getName() == intermediate.getEntryPoint().c_str()); + + // + // New symbol table scope for body of function plus its arguments + // + symbolTable.push(); + + // + // Insert parameters into the symbol table. + // If the parameter has no name, it's not an error, just don't insert it + // (could be used for unused args). + // + // Also, accumulate the list of parameters into the HIL, so lower level code + // knows where to find parameters. + // + TIntermAggregate* paramNodes = new TIntermAggregate; + for (int i = 0; i < function.getParamCount(); i++) { + TParameter& param = function[i]; + if (param.name != nullptr) { + TVariable *variable = new TVariable(param.name, *param.type); + + // Insert the parameters with name in the symbol table. + if (! symbolTable.insert(*variable)) + error(loc, "redefinition", variable->getName().c_str(), ""); + else { + // Transfer ownership of name pointer to symbol table. + param.name = nullptr; + + // Add the parameter to the HIL + paramNodes = intermediate.growAggregate(paramNodes, + intermediate.addSymbol(*variable, loc), + loc); + } + } else + paramNodes = intermediate.growAggregate(paramNodes, intermediate.addSymbol(*param.type, loc), loc); + } + intermediate.setAggregateOperator(paramNodes, EOpParameters, TType(EbtVoid), loc); + loopNestingLevel = 0; + statementNestingLevel = 0; + controlFlowNestingLevel = 0; + postMainReturn = false; + + return paramNodes; +} + +void HlslParseContext::handleFunctionArgument(TFunction* function, TIntermTyped*& arguments, TIntermTyped* newArg) +{ + TParameter param = { 0, new TType }; + param.type->shallowCopy(newArg->getType()); + function->addParameter(param); + if (arguments) + arguments = intermediate.growAggregate(arguments, newArg); + else + arguments = newArg; +} + +// +// Handle seeing function call syntax in the grammar, which could be any of +// - .length() method +// - constructor +// - a call to a built-in function mapped to an operator +// - a call to a built-in function that will remain a function call (e.g., texturing) +// - user function +// - subroutine call (not implemented yet) +// +TIntermTyped* HlslParseContext::handleFunctionCall(const TSourceLoc& loc, TFunction* function, TIntermNode* arguments) +{ + TIntermTyped* result = nullptr; + + TOperator op = function->getBuiltInOp(); + if (op == EOpArrayLength) + result = handleLengthMethod(loc, function, arguments); + else if (op != EOpNull) { + // + // Then this should be a constructor. + // Don't go through the symbol table for constructors. + // Their parameters will be verified algorithmically. + // + TType type(EbtVoid); // use this to get the type back + if (! constructorError(loc, arguments, *function, op, type)) { + // + // It's a constructor, of type 'type'. + // + result = addConstructor(loc, arguments, type, op); + if (result == nullptr) + error(loc, "cannot construct with these arguments", type.getCompleteString().c_str(), ""); + } + } else { + // + // Find it in the symbol table. + // + const TFunction* fnCandidate; + bool builtIn; + fnCandidate = findFunction(loc, *function, builtIn); + if (fnCandidate) { + // This is a declared function that might map to + // - a built-in operator, + // - a built-in function not mapped to an operator, or + // - a user function. + + // Error check for a function requiring specific extensions present. + if (builtIn && fnCandidate->getNumExtensions()) + requireExtensions(loc, fnCandidate->getNumExtensions(), fnCandidate->getExtensions(), fnCandidate->getName().c_str()); + + if (arguments) { + // Make sure qualifications work for these arguments. + TIntermAggregate* aggregate = arguments->getAsAggregate(); + for (int i = 0; i < fnCandidate->getParamCount(); ++i) { + // At this early point there is a slight ambiguity between whether an aggregate 'arguments' + // is the single argument itself or its children are the arguments. Only one argument + // means take 'arguments' itself as the one argument. + TIntermNode* arg = fnCandidate->getParamCount() == 1 ? arguments : (aggregate ? aggregate->getSequence()[i] : arguments); + TQualifier& formalQualifier = (*fnCandidate)[i].type->getQualifier(); + TQualifier& argQualifier = arg->getAsTyped()->getQualifier(); + } + + // Convert 'in' arguments + addInputArgumentConversions(*fnCandidate, arguments); // arguments may be modified if it's just a single argument node + } + + op = fnCandidate->getBuiltInOp(); + if (builtIn && op != EOpNull) { + // A function call mapped to a built-in operation. + result = intermediate.addBuiltInFunctionCall(loc, op, fnCandidate->getParamCount() == 1, arguments, fnCandidate->getType()); + if (result == nullptr) { + error(arguments->getLoc(), " wrong operand type", "Internal Error", + "built in unary operator function. Type: %s", + static_cast(arguments)->getCompleteString().c_str()); + } else if (result->getAsOperator()) { + builtInOpCheck(loc, *fnCandidate, *result->getAsOperator()); + } + } else { + // This is a function call not mapped to built-in operator. + // It could still be a built-in function, but only if PureOperatorBuiltins == false. + result = intermediate.setAggregateOperator(arguments, EOpFunctionCall, fnCandidate->getType(), loc); + TIntermAggregate* call = result->getAsAggregate(); + call->setName(fnCandidate->getMangledName()); + + // this is how we know whether the given function is a built-in function or a user-defined function + // if builtIn == false, it's a userDefined -> could be an overloaded built-in function also + // if builtIn == true, it's definitely a built-in function with EOpNull + if (! builtIn) { + call->setUserDefined(); + intermediate.addToCallGraph(infoSink, currentCaller, fnCandidate->getMangledName()); + } + } + + // Convert 'out' arguments. If it was a constant folded built-in, it won't be an aggregate anymore. + // Built-ins with a single argument aren't called with an aggregate, but they also don't have an output. + // Also, build the qualifier list for user function calls, which are always called with an aggregate. + if (result->getAsAggregate()) { + TQualifierList& qualifierList = result->getAsAggregate()->getQualifierList(); + for (int i = 0; i < fnCandidate->getParamCount(); ++i) { + TStorageQualifier qual = (*fnCandidate)[i].type->getQualifier().storage; + qualifierList.push_back(qual); + } + result = addOutputArgumentConversions(*fnCandidate, *result->getAsAggregate()); + } + } + } + + // generic error recovery + // TODO: simplification: localize all the error recoveries that look like this, and taking type into account to reduce cascades + if (result == nullptr) + result = intermediate.addConstantUnion(0.0, EbtFloat, loc); + + return result; +} + +// Finish processing object.length(). This started earlier in handleDotDereference(), where +// the ".length" part was recognized and semantically checked, and finished here where the +// function syntax "()" is recognized. +// +// Return resulting tree node. +TIntermTyped* HlslParseContext::handleLengthMethod(const TSourceLoc& loc, TFunction* function, TIntermNode* intermNode) +{ + int length = 0; + + if (function->getParamCount() > 0) + error(loc, "method does not accept any arguments", function->getName().c_str(), ""); + else { + const TType& type = intermNode->getAsTyped()->getType(); + if (type.isArray()) { + if (type.isRuntimeSizedArray()) { + // Create a unary op and let the back end handle it + return intermediate.addBuiltInFunctionCall(loc, EOpArrayLength, true, intermNode, TType(EbtInt)); + } else if (type.isImplicitlySizedArray()) { + if (intermNode->getAsSymbolNode() && isIoResizeArray(type)) { + // We could be between a layout declaration that gives a built-in io array implicit size and + // a user redeclaration of that array, meaning we have to substitute its implicit size here + // without actually redeclaring the array. (It is an error to use a member before the + // redeclaration, but not an error to use the array name itself.) + const TString& name = intermNode->getAsSymbolNode()->getName(); + if (name == "gl_in" || name == "gl_out") + length = getIoArrayImplicitSize(); + } + if (length == 0) { + if (intermNode->getAsSymbolNode() && isIoResizeArray(type)) + error(loc, "", function->getName().c_str(), "array must first be sized by a redeclaration or layout qualifier"); + else + error(loc, "", function->getName().c_str(), "array must be declared with a size before using this method"); + } + } else + length = type.getOuterArraySize(); + } else if (type.isMatrix()) + length = type.getMatrixCols(); + else if (type.isVector()) + length = type.getVectorSize(); + else { + // we should not get here, because earlier semantic checking should have prevented this path + error(loc, ".length()", "unexpected use of .length()", ""); + } + } + + if (length == 0) + length = 1; + + return intermediate.addConstantUnion(length, loc); +} + +// +// Add any needed implicit conversions for function-call arguments to input parameters. +// +void HlslParseContext::addInputArgumentConversions(const TFunction& function, TIntermNode*& arguments) const +{ + TIntermAggregate* aggregate = arguments->getAsAggregate(); + + // Process each argument's conversion + for (int i = 0; i < function.getParamCount(); ++i) { + // At this early point there is a slight ambiguity between whether an aggregate 'arguments' + // is the single argument itself or its children are the arguments. Only one argument + // means take 'arguments' itself as the one argument. + TIntermTyped* arg = function.getParamCount() == 1 ? arguments->getAsTyped() : (aggregate ? aggregate->getSequence()[i]->getAsTyped() : arguments->getAsTyped()); + if (*function[i].type != arg->getType()) { + if (function[i].type->getQualifier().isParamInput()) { + // In-qualified arguments just need an extra node added above the argument to + // convert to the correct type. + arg = intermediate.addConversion(EOpFunctionCall, *function[i].type, arg); + if (arg) { + if (function.getParamCount() == 1) + arguments = arg; + else { + if (aggregate) + aggregate->getSequence()[i] = arg; + else + arguments = arg; + } + } + } + } + } +} + +// +// Add any needed implicit output conversions for function-call arguments. This +// can require a new tree topology, complicated further by whether the function +// has a return value. +// +// Returns a node of a subtree that evaluates to the return value of the function. +// +TIntermTyped* HlslParseContext::addOutputArgumentConversions(const TFunction& function, TIntermAggregate& intermNode) const +{ + TIntermSequence& arguments = intermNode.getSequence(); + + // Will there be any output conversions? + bool outputConversions = false; + for (int i = 0; i < function.getParamCount(); ++i) { + if (*function[i].type != arguments[i]->getAsTyped()->getType() && function[i].type->getQualifier().storage == EvqOut) { + outputConversions = true; + break; + } + } + + if (! outputConversions) + return &intermNode; + + // Setup for the new tree, if needed: + // + // Output conversions need a different tree topology. + // Out-qualified arguments need a temporary of the correct type, with the call + // followed by an assignment of the temporary to the original argument: + // void: function(arg, ...) -> ( function(tempArg, ...), arg = tempArg, ...) + // ret = function(arg, ...) -> ret = (tempRet = function(tempArg, ...), arg = tempArg, ..., tempRet) + // Where the "tempArg" type needs no conversion as an argument, but will convert on assignment. + TIntermTyped* conversionTree = nullptr; + TVariable* tempRet = nullptr; + if (intermNode.getBasicType() != EbtVoid) { + // do the "tempRet = function(...), " bit from above + tempRet = makeInternalVariable("tempReturn", intermNode.getType()); + TIntermSymbol* tempRetNode = intermediate.addSymbol(*tempRet, intermNode.getLoc()); + conversionTree = intermediate.addAssign(EOpAssign, tempRetNode, &intermNode, intermNode.getLoc()); + } else + conversionTree = &intermNode; + + conversionTree = intermediate.makeAggregate(conversionTree); + + // Process each argument's conversion + for (int i = 0; i < function.getParamCount(); ++i) { + if (*function[i].type != arguments[i]->getAsTyped()->getType()) { + if (function[i].type->getQualifier().isParamOutput()) { + // Out-qualified arguments need to use the topology set up above. + // do the " ...(tempArg, ...), arg = tempArg" bit from above + TVariable* tempArg = makeInternalVariable("tempArg", *function[i].type); + tempArg->getWritableType().getQualifier().makeTemporary(); + TIntermSymbol* tempArgNode = intermediate.addSymbol(*tempArg, intermNode.getLoc()); + TIntermTyped* tempAssign = intermediate.addAssign(EOpAssign, arguments[i]->getAsTyped(), tempArgNode, arguments[i]->getLoc()); + conversionTree = intermediate.growAggregate(conversionTree, tempAssign, arguments[i]->getLoc()); + // replace the argument with another node for the same tempArg variable + arguments[i] = intermediate.addSymbol(*tempArg, intermNode.getLoc()); + } + } + } + + // Finalize the tree topology (see bigger comment above). + if (tempRet) { + // do the "..., tempRet" bit from above + TIntermSymbol* tempRetNode = intermediate.addSymbol(*tempRet, intermNode.getLoc()); + conversionTree = intermediate.growAggregate(conversionTree, tempRetNode, intermNode.getLoc()); + } + conversionTree = intermediate.setAggregateOperator(conversionTree, EOpComma, intermNode.getType(), intermNode.getLoc()); + + return conversionTree; +} + +// +// Do additional checking of built-in function calls that is not caught +// by normal semantic checks on argument type, extension tagging, etc. +// +// Assumes there has been a semantically correct match to a built-in function prototype. +// +void HlslParseContext::builtInOpCheck(const TSourceLoc& loc, const TFunction& fnCandidate, TIntermOperator& callNode) +{ + // Set up convenience accessors to the argument(s). There is almost always + // multiple arguments for the cases below, but when there might be one, + // check the unaryArg first. + const TIntermSequence* argp = nullptr; // confusing to use [] syntax on a pointer, so this is to help get a reference + const TIntermTyped* unaryArg = nullptr; + const TIntermTyped* arg0 = nullptr; + if (callNode.getAsAggregate()) { + argp = &callNode.getAsAggregate()->getSequence(); + if (argp->size() > 0) + arg0 = (*argp)[0]->getAsTyped(); + } else { + assert(callNode.getAsUnaryNode()); + unaryArg = callNode.getAsUnaryNode()->getOperand(); + arg0 = unaryArg; + } + const TIntermSequence& aggArgs = *argp; // only valid when unaryArg is nullptr + + // built-in texturing functions get their return value precision from the precision of the sampler + if (fnCandidate.getType().getQualifier().precision == EpqNone && + fnCandidate.getParamCount() > 0 && fnCandidate[0].type->getBasicType() == EbtSampler) + callNode.getQualifier().precision = arg0->getQualifier().precision; + + switch (callNode.getOp()) { + case EOpTextureGather: + case EOpTextureGatherOffset: + case EOpTextureGatherOffsets: + { + // Figure out which variants are allowed by what extensions, + // and what arguments must be constant for which situations. + + TString featureString = fnCandidate.getName() + "(...)"; + const char* feature = featureString.c_str(); + int compArg = -1; // track which argument, if any, is the constant component argument + switch (callNode.getOp()) { + case EOpTextureGather: + // More than two arguments needs gpu_shader5, and rectangular or shadow needs gpu_shader5, + // otherwise, need GL_ARB_texture_gather. + if (fnCandidate.getParamCount() > 2 || fnCandidate[0].type->getSampler().dim == EsdRect || fnCandidate[0].type->getSampler().shadow) { + if (! fnCandidate[0].type->getSampler().shadow) + compArg = 2; + } + break; + case EOpTextureGatherOffset: + // GL_ARB_texture_gather is good enough for 2D non-shadow textures with no component argument + if (! fnCandidate[0].type->getSampler().shadow) + compArg = 3; + break; + case EOpTextureGatherOffsets: + if (! fnCandidate[0].type->getSampler().shadow) + compArg = 3; + break; + default: + break; + } + + if (compArg > 0 && compArg < fnCandidate.getParamCount()) { + if (aggArgs[compArg]->getAsConstantUnion()) { + int value = aggArgs[compArg]->getAsConstantUnion()->getConstArray()[0].getIConst(); + if (value < 0 || value > 3) + error(loc, "must be 0, 1, 2, or 3:", feature, "component argument"); + } else + error(loc, "must be a compile-time constant:", feature, "component argument"); + } + + break; + } + + case EOpTextureOffset: + case EOpTextureFetchOffset: + case EOpTextureProjOffset: + case EOpTextureLodOffset: + case EOpTextureProjLodOffset: + case EOpTextureGradOffset: + case EOpTextureProjGradOffset: + { + // Handle texture-offset limits checking + // Pick which argument has to hold constant offsets + int arg = -1; + switch (callNode.getOp()) { + case EOpTextureOffset: arg = 2; break; + case EOpTextureFetchOffset: arg = (arg0->getType().getSampler().dim != EsdRect) ? 3 : 2; break; + case EOpTextureProjOffset: arg = 2; break; + case EOpTextureLodOffset: arg = 3; break; + case EOpTextureProjLodOffset: arg = 3; break; + case EOpTextureGradOffset: arg = 4; break; + case EOpTextureProjGradOffset: arg = 4; break; + default: + assert(0); + break; + } + + if (arg > 0) { + if (! aggArgs[arg]->getAsConstantUnion()) + error(loc, "argument must be compile-time constant", "texel offset", ""); + else { + const TType& type = aggArgs[arg]->getAsTyped()->getType(); + for (int c = 0; c < type.getVectorSize(); ++c) { + int offset = aggArgs[arg]->getAsConstantUnion()->getConstArray()[c].getIConst(); + if (offset > resources.maxProgramTexelOffset || offset < resources.minProgramTexelOffset) + error(loc, "value is out of range:", "texel offset", "[gl_MinProgramTexelOffset, gl_MaxProgramTexelOffset]"); + } + } + } + + break; + } + + case EOpTextureQuerySamples: + case EOpImageQuerySamples: + break; + + case EOpImageAtomicAdd: + case EOpImageAtomicMin: + case EOpImageAtomicMax: + case EOpImageAtomicAnd: + case EOpImageAtomicOr: + case EOpImageAtomicXor: + case EOpImageAtomicExchange: + case EOpImageAtomicCompSwap: + break; + + case EOpInterpolateAtCentroid: + case EOpInterpolateAtSample: + case EOpInterpolateAtOffset: + // "For the interpolateAt* functions, the call will return a precision + // qualification matching the precision of the 'interpolant' argument to + // the function call." + callNode.getQualifier().precision = arg0->getQualifier().precision; + + // Make sure the first argument is an interpolant, or an array element of an interpolant + if (arg0->getType().getQualifier().storage != EvqVaryingIn) { + // It might still be an array element. + // + // We could check more, but the semantics of the first argument are already met; the + // only way to turn an array into a float/vec* is array dereference and swizzle. + // + // ES and desktop 4.3 and earlier: swizzles may not be used + // desktop 4.4 and later: swizzles may be used + const TIntermTyped* base = TIntermediate::findLValueBase(arg0, true); + if (base == nullptr || base->getType().getQualifier().storage != EvqVaryingIn) + error(loc, "first argument must be an interpolant, or interpolant-array element", fnCandidate.getName().c_str(), ""); + } + break; + + default: + break; + } +} + +// +// Handle seeing a built-in constructor in a grammar production. +// +TFunction* HlslParseContext::handleConstructorCall(const TSourceLoc& loc, const TType& type) +{ + TOperator op = mapTypeToConstructorOp(type); + + if (op == EOpNull) { + error(loc, "cannot construct this type", type.getBasicString(), ""); + return nullptr; + } + + TString empty(""); + + return new TFunction(&empty, type, op); +} + +// +// Given a type, find what operation would fully construct it. +// +TOperator HlslParseContext::mapTypeToConstructorOp(const TType& type) const +{ + TOperator op = EOpNull; + + switch (type.getBasicType()) { + case EbtStruct: + op = EOpConstructStruct; + break; + case EbtSampler: + if (type.getSampler().combined) + op = EOpConstructTextureSampler; + break; + case EbtFloat: + if (type.isMatrix()) { + switch (type.getMatrixCols()) { + case 2: + switch (type.getMatrixRows()) { + case 2: op = EOpConstructMat2x2; break; + case 3: op = EOpConstructMat2x3; break; + case 4: op = EOpConstructMat2x4; break; + default: break; // some compilers want this + } + break; + case 3: + switch (type.getMatrixRows()) { + case 2: op = EOpConstructMat3x2; break; + case 3: op = EOpConstructMat3x3; break; + case 4: op = EOpConstructMat3x4; break; + default: break; // some compilers want this + } + break; + case 4: + switch (type.getMatrixRows()) { + case 2: op = EOpConstructMat4x2; break; + case 3: op = EOpConstructMat4x3; break; + case 4: op = EOpConstructMat4x4; break; + default: break; // some compilers want this + } + break; + default: break; // some compilers want this + } + } else { + switch (type.getVectorSize()) { + case 1: op = EOpConstructFloat; break; + case 2: op = EOpConstructVec2; break; + case 3: op = EOpConstructVec3; break; + case 4: op = EOpConstructVec4; break; + default: break; // some compilers want this + } + } + break; + case EbtDouble: + if (type.getMatrixCols()) { + switch (type.getMatrixCols()) { + case 2: + switch (type.getMatrixRows()) { + case 2: op = EOpConstructDMat2x2; break; + case 3: op = EOpConstructDMat2x3; break; + case 4: op = EOpConstructDMat2x4; break; + default: break; // some compilers want this + } + break; + case 3: + switch (type.getMatrixRows()) { + case 2: op = EOpConstructDMat3x2; break; + case 3: op = EOpConstructDMat3x3; break; + case 4: op = EOpConstructDMat3x4; break; + default: break; // some compilers want this + } + break; + case 4: + switch (type.getMatrixRows()) { + case 2: op = EOpConstructDMat4x2; break; + case 3: op = EOpConstructDMat4x3; break; + case 4: op = EOpConstructDMat4x4; break; + default: break; // some compilers want this + } + break; + } + } else { + switch (type.getVectorSize()) { + case 1: op = EOpConstructDouble; break; + case 2: op = EOpConstructDVec2; break; + case 3: op = EOpConstructDVec3; break; + case 4: op = EOpConstructDVec4; break; + default: break; // some compilers want this + } + } + break; + case EbtInt: + switch (type.getVectorSize()) { + case 1: op = EOpConstructInt; break; + case 2: op = EOpConstructIVec2; break; + case 3: op = EOpConstructIVec3; break; + case 4: op = EOpConstructIVec4; break; + default: break; // some compilers want this + } + break; + case EbtUint: + switch (type.getVectorSize()) { + case 1: op = EOpConstructUint; break; + case 2: op = EOpConstructUVec2; break; + case 3: op = EOpConstructUVec3; break; + case 4: op = EOpConstructUVec4; break; + default: break; // some compilers want this + } + break; + case EbtBool: + switch (type.getVectorSize()) { + case 1: op = EOpConstructBool; break; + case 2: op = EOpConstructBVec2; break; + case 3: op = EOpConstructBVec3; break; + case 4: op = EOpConstructBVec4; break; + default: break; // some compilers want this + } + break; + default: + break; + } + + return op; +} + +// +// Same error message for all places assignments don't work. +// +void HlslParseContext::assignError(const TSourceLoc& loc, const char* op, TString left, TString right) +{ + error(loc, "", op, "cannot convert from '%s' to '%s'", + right.c_str(), left.c_str()); +} + +// +// Same error message for all places unary operations don't work. +// +void HlslParseContext::unaryOpError(const TSourceLoc& loc, const char* op, TString operand) +{ + error(loc, " wrong operand type", op, + "no operation '%s' exists that takes an operand of type %s (or there is no acceptable conversion)", + op, operand.c_str()); +} + +// +// Same error message for all binary operations don't work. +// +void HlslParseContext::binaryOpError(const TSourceLoc& loc, const char* op, TString left, TString right) +{ + error(loc, " wrong operand types:", op, + "no operation '%s' exists that takes a left-hand operand of type '%s' and " + "a right operand of type '%s' (or there is no acceptable conversion)", + op, left.c_str(), right.c_str()); +} + +// +// A basic type of EbtVoid is a key that the name string was seen in the source, but +// it was not found as a variable in the symbol table. If so, give the error +// message and insert a dummy variable in the symbol table to prevent future errors. +// +void HlslParseContext::variableCheck(TIntermTyped*& nodePtr) +{ + TIntermSymbol* symbol = nodePtr->getAsSymbolNode(); + if (! symbol) + return; + + if (symbol->getType().getBasicType() == EbtVoid) { + error(symbol->getLoc(), "undeclared identifier", symbol->getName().c_str(), ""); + + // Add to symbol table to prevent future error messages on the same name + if (symbol->getName().size() > 0) { + TVariable* fakeVariable = new TVariable(&symbol->getName(), TType(EbtFloat)); + symbolTable.insert(*fakeVariable); + + // substitute a symbol node for this new variable + nodePtr = intermediate.addSymbol(*fakeVariable, symbol->getLoc()); + } + } +} + +// +// Both test, and if necessary spit out an error, to see if the node is really +// a constant. +// +void HlslParseContext::constantValueCheck(TIntermTyped* node, const char* token) +{ + if (node->getQualifier().storage != EvqConst) + error(node->getLoc(), "constant expression required", token, ""); +} + +// +// Both test, and if necessary spit out an error, to see if the node is really +// an integer. +// +void HlslParseContext::integerCheck(const TIntermTyped* node, const char* token) +{ + if ((node->getBasicType() == EbtInt || node->getBasicType() == EbtUint) && node->isScalar()) + return; + + error(node->getLoc(), "scalar integer expression required", token, ""); +} + +// +// Both test, and if necessary spit out an error, to see if we are currently +// globally scoped. +// +void HlslParseContext::globalCheck(const TSourceLoc& loc, const char* token) +{ + if (! symbolTable.atGlobalLevel()) + error(loc, "not allowed in nested scope", token, ""); +} + + +bool HlslParseContext::builtInName(const TString& identifier) +{ + return false; +} + +// +// Make sure there is enough data and not too many arguments provided to the +// constructor to build something of the type of the constructor. Also returns +// the type of the constructor. +// +// Returns true if there was an error in construction. +// +bool HlslParseContext::constructorError(const TSourceLoc& loc, TIntermNode* node, TFunction& function, TOperator op, TType& type) +{ + type.shallowCopy(function.getType()); + + bool constructingMatrix = false; + switch (op) { + case EOpConstructTextureSampler: + return constructorTextureSamplerError(loc, function); + case EOpConstructMat2x2: + case EOpConstructMat2x3: + case EOpConstructMat2x4: + case EOpConstructMat3x2: + case EOpConstructMat3x3: + case EOpConstructMat3x4: + case EOpConstructMat4x2: + case EOpConstructMat4x3: + case EOpConstructMat4x4: + case EOpConstructDMat2x2: + case EOpConstructDMat2x3: + case EOpConstructDMat2x4: + case EOpConstructDMat3x2: + case EOpConstructDMat3x3: + case EOpConstructDMat3x4: + case EOpConstructDMat4x2: + case EOpConstructDMat4x3: + case EOpConstructDMat4x4: + constructingMatrix = true; + break; + default: + break; + } + + // + // Walk the arguments for first-pass checks and collection of information. + // + + int size = 0; + bool constType = true; + bool full = false; + bool overFull = false; + bool matrixInMatrix = false; + bool arrayArg = false; + for (int arg = 0; arg < function.getParamCount(); ++arg) { + if (function[arg].type->isArray()) { + if (! function[arg].type->isExplicitlySizedArray()) { + // Can't construct from an unsized array. + error(loc, "array argument must be sized", "constructor", ""); + return true; + } + arrayArg = true; + } + if (constructingMatrix && function[arg].type->isMatrix()) + matrixInMatrix = true; + + // 'full' will go to true when enough args have been seen. If we loop + // again, there is an extra argument. + if (full) { + // For vectors and matrices, it's okay to have too many components + // available, but not okay to have unused arguments. + overFull = true; + } + + size += function[arg].type->computeNumComponents(); + if (op != EOpConstructStruct && ! type.isArray() && size >= type.computeNumComponents()) + full = true; + + if (function[arg].type->getQualifier().storage != EvqConst) + constType = false; + } + + if (constType) + type.getQualifier().storage = EvqConst; + + if (type.isArray()) { + if (function.getParamCount() == 0) { + error(loc, "array constructor must have at least one argument", "constructor", ""); + return true; + } + + if (type.isImplicitlySizedArray()) { + // auto adapt the constructor type to the number of arguments + type.changeOuterArraySize(function.getParamCount()); + } else if (type.getOuterArraySize() != function.getParamCount()) { + error(loc, "array constructor needs one argument per array element", "constructor", ""); + return true; + } + + if (type.isArrayOfArrays()) { + // Types have to match, but we're still making the type. + // Finish making the type, and the comparison is done later + // when checking for conversion. + TArraySizes& arraySizes = type.getArraySizes(); + + // At least the dimensionalities have to match. + if (! function[0].type->isArray() || arraySizes.getNumDims() != function[0].type->getArraySizes().getNumDims() + 1) { + error(loc, "array constructor argument not correct type to construct array element", "constructior", ""); + return true; + } + + if (arraySizes.isInnerImplicit()) { + // "Arrays of arrays ..., and the size for any dimension is optional" + // That means we need to adopt (from the first argument) the other array sizes into the type. + for (int d = 1; d < arraySizes.getNumDims(); ++d) { + if (arraySizes.getDimSize(d) == UnsizedArraySize) { + arraySizes.setDimSize(d, function[0].type->getArraySizes().getDimSize(d - 1)); + } + } + } + } + } + + if (arrayArg && op != EOpConstructStruct && ! type.isArrayOfArrays()) { + error(loc, "constructing non-array constituent from array argument", "constructor", ""); + return true; + } + + if (matrixInMatrix && ! type.isArray()) { + return false; + } + + if (overFull) { + error(loc, "too many arguments", "constructor", ""); + return true; + } + + if (op == EOpConstructStruct && ! type.isArray() && (int)type.getStruct()->size() != function.getParamCount()) { + error(loc, "Number of constructor parameters does not match the number of structure fields", "constructor", ""); + return true; + } + + if ((op != EOpConstructStruct && size != 1 && size < type.computeNumComponents()) || + (op == EOpConstructStruct && size < type.computeNumComponents())) { + error(loc, "not enough data provided for construction", "constructor", ""); + return true; + } + + TIntermTyped* typed = node->getAsTyped(); + + return false; +} + +// Verify all the correct semantics for constructing a combined texture/sampler. +// Return true if the semantics are incorrect. +bool HlslParseContext::constructorTextureSamplerError(const TSourceLoc& loc, const TFunction& function) +{ + TString constructorName = function.getType().getBasicTypeString(); // TODO: performance: should not be making copy; interface needs to change + const char* token = constructorName.c_str(); + + // exactly two arguments needed + if (function.getParamCount() != 2) { + error(loc, "sampler-constructor requires two arguments", token, ""); + return true; + } + + // For now, not allowing arrayed constructors, the rest of this function + // is set up to allow them, if this test is removed: + if (function.getType().isArray()) { + error(loc, "sampler-constructor cannot make an array of samplers", token, ""); + return true; + } + + // first argument + // * the constructor's first argument must be a texture type + // * the dimensionality (1D, 2D, 3D, Cube, Rect, Buffer, MS, and Array) + // of the texture type must match that of the constructed sampler type + // (that is, the suffixes of the type of the first argument and the + // type of the constructor will be spelled the same way) + if (function[0].type->getBasicType() != EbtSampler || + ! function[0].type->getSampler().isTexture() || + function[0].type->isArray()) { + error(loc, "sampler-constructor first argument must be a scalar textureXXX type", token, ""); + return true; + } + // simulate the first argument's impact on the result type, so it can be compared with the encapsulated operator!=() + TSampler texture = function.getType().getSampler(); + texture.combined = false; + texture.shadow = false; + if (texture != function[0].type->getSampler()) { + error(loc, "sampler-constructor first argument must match type and dimensionality of constructor type", token, ""); + return true; + } + + // second argument + // * the constructor's second argument must be a scalar of type + // *sampler* or *samplerShadow* + // * the presence or absence of depth comparison (Shadow) must match + // between the constructed sampler type and the type of the second argument + if (function[1].type->getBasicType() != EbtSampler || + ! function[1].type->getSampler().isPureSampler() || + function[1].type->isArray()) { + error(loc, "sampler-constructor second argument must be a scalar type 'sampler'", token, ""); + return true; + } + if (function.getType().getSampler().shadow != function[1].type->getSampler().shadow) { + error(loc, "sampler-constructor second argument presence of shadow must match constructor presence of shadow", token, ""); + return true; + } + + return false; +} + +// Checks to see if a void variable has been declared and raise an error message for such a case +// +// returns true in case of an error +// +bool HlslParseContext::voidErrorCheck(const TSourceLoc& loc, const TString& identifier, const TBasicType basicType) +{ + if (basicType == EbtVoid) { + error(loc, "illegal use of type 'void'", identifier.c_str(), ""); + return true; + } + + return false; +} + +// Checks to see if the node (for the expression) contains a scalar boolean expression or not +void HlslParseContext::boolCheck(const TSourceLoc& loc, const TIntermTyped* type) +{ + if (type->getBasicType() != EbtBool || type->isArray() || type->isMatrix() || type->isVector()) + error(loc, "boolean expression expected", "", ""); +} + +// +// Fix just a full qualifier (no variables or types yet, but qualifier is complete) at global level. +// +void HlslParseContext::globalQualifierFix(const TSourceLoc& loc, TQualifier& qualifier) +{ + // move from parameter/unknown qualifiers to pipeline in/out qualifiers + switch (qualifier.storage) { + case EvqIn: + qualifier.storage = EvqVaryingIn; + break; + case EvqOut: + qualifier.storage = EvqVaryingOut; + break; + default: + break; + } +} + +// +// Merge characteristics of the 'src' qualifier into the 'dst'. +// If there is duplication, issue error messages, unless 'force' +// is specified, which means to just override default settings. +// +// Also, when force is false, it will be assumed that 'src' follows +// 'dst', for the purpose of error checking order for versions +// that require specific orderings of qualifiers. +// +void HlslParseContext::mergeQualifiers(const TSourceLoc& loc, TQualifier& dst, const TQualifier& src, bool force) +{ + // Storage qualification + if (dst.storage == EvqTemporary || dst.storage == EvqGlobal) + dst.storage = src.storage; + else if ((dst.storage == EvqIn && src.storage == EvqOut) || + (dst.storage == EvqOut && src.storage == EvqIn)) + dst.storage = EvqInOut; + else if ((dst.storage == EvqIn && src.storage == EvqConst) || + (dst.storage == EvqConst && src.storage == EvqIn)) + dst.storage = EvqConstReadOnly; + else if (src.storage != EvqTemporary && src.storage != EvqGlobal) + error(loc, "too many storage qualifiers", GetStorageQualifierString(src.storage), ""); + + // Precision qualifiers + if (dst.precision == EpqNone || (force && src.precision != EpqNone)) + dst.precision = src.precision; + + // Layout qualifiers + mergeObjectLayoutQualifiers(dst, src, false); + + // individual qualifiers + bool repeated = false; +#define MERGE_SINGLETON(field) repeated |= dst.field && src.field; dst.field |= src.field; + MERGE_SINGLETON(invariant); + MERGE_SINGLETON(noContraction); + MERGE_SINGLETON(centroid); + MERGE_SINGLETON(smooth); + MERGE_SINGLETON(flat); + MERGE_SINGLETON(nopersp); + MERGE_SINGLETON(patch); + MERGE_SINGLETON(sample); + MERGE_SINGLETON(coherent); + MERGE_SINGLETON(volatil); + MERGE_SINGLETON(restrict); + MERGE_SINGLETON(readonly); + MERGE_SINGLETON(writeonly); + MERGE_SINGLETON(specConstant); +} + +// used to flatten the sampler type space into a single dimension +// correlates with the declaration of defaultSamplerPrecision[] +int HlslParseContext::computeSamplerTypeIndex(TSampler& sampler) +{ + int arrayIndex = sampler.arrayed ? 1 : 0; + int shadowIndex = sampler.shadow ? 1 : 0; + int externalIndex = sampler.external ? 1 : 0; + + return EsdNumDims * (EbtNumTypes * (2 * (2 * arrayIndex + shadowIndex) + externalIndex) + sampler.type) + sampler.dim; +} + +// +// Do size checking for an array type's size. +// +void HlslParseContext::arraySizeCheck(const TSourceLoc& loc, TIntermTyped* expr, TArraySize& sizePair) +{ + bool isConst = false; + sizePair.size = 1; + sizePair.node = nullptr; + + TIntermConstantUnion* constant = expr->getAsConstantUnion(); + if (constant) { + // handle true (non-specialization) constant + sizePair.size = constant->getConstArray()[0].getIConst(); + isConst = true; + } else { + // see if it's a specialization constant instead + if (expr->getQualifier().isSpecConstant()) { + isConst = true; + sizePair.node = expr; + TIntermSymbol* symbol = expr->getAsSymbolNode(); + if (symbol && symbol->getConstArray().size() > 0) + sizePair.size = symbol->getConstArray()[0].getIConst(); + } + } + + if (! isConst || (expr->getBasicType() != EbtInt && expr->getBasicType() != EbtUint)) { + error(loc, "array size must be a constant integer expression", "", ""); + return; + } + + if (sizePair.size <= 0) { + error(loc, "array size must be a positive integer", "", ""); + return; + } +} + +// +// Require array to be completely sized +// +void HlslParseContext::arraySizeRequiredCheck(const TSourceLoc& loc, const TArraySizes& arraySizes) +{ + if (arraySizes.isImplicit()) + error(loc, "array size required", "", ""); +} + +void HlslParseContext::structArrayCheck(const TSourceLoc& /*loc*/, const TType& type) +{ + const TTypeList& structure = *type.getStruct(); + for (int m = 0; m < (int)structure.size(); ++m) { + const TType& member = *structure[m].type; + if (member.isArray()) + arraySizeRequiredCheck(structure[m].loc, *member.getArraySizes()); + } +} + +// Merge array dimensions listed in 'sizes' onto the type's array dimensions. +// +// From the spec: "vec4[2] a[3]; // size-3 array of size-2 array of vec4" +// +// That means, the 'sizes' go in front of the 'type' as outermost sizes. +// 'type' is the type part of the declaration (to the left) +// 'sizes' is the arrayness tagged on the identifier (to the right) +// +void HlslParseContext::arrayDimMerge(TType& type, const TArraySizes* sizes) +{ + if (sizes) + type.addArrayOuterSizes(*sizes); +} + +// +// Do all the semantic checking for declaring or redeclaring an array, with and +// without a size, and make the right changes to the symbol table. +// +void HlslParseContext::declareArray(const TSourceLoc& loc, TString& identifier, const TType& type, TSymbol*& symbol, bool& newDeclaration) +{ + if (! symbol) { + bool currentScope; + symbol = symbolTable.find(identifier, nullptr, ¤tScope); + + if (symbol && builtInName(identifier) && ! symbolTable.atBuiltInLevel()) { + // bad shader (errors already reported) trying to redeclare a built-in name as an array + return; + } + if (symbol == nullptr || ! currentScope) { + // + // Successfully process a new definition. + // (Redeclarations have to take place at the same scope; otherwise they are hiding declarations) + // + symbol = new TVariable(&identifier, type); + symbolTable.insert(*symbol); + newDeclaration = true; + + if (! symbolTable.atBuiltInLevel()) { + if (isIoResizeArray(type)) { + ioArraySymbolResizeList.push_back(symbol); + checkIoArraysConsistency(loc, true); + } else + fixIoArraySize(loc, symbol->getWritableType()); + } + + return; + } + if (symbol->getAsAnonMember()) { + error(loc, "cannot redeclare a user-block member array", identifier.c_str(), ""); + symbol = nullptr; + return; + } + } + + // + // Process a redeclaration. + // + + if (! symbol) { + error(loc, "array variable name expected", identifier.c_str(), ""); + return; + } + + // redeclareBuiltinVariable() should have already done the copyUp() + TType& existingType = symbol->getWritableType(); + + + if (existingType.isExplicitlySizedArray()) { + // be more lenient for input arrays to geometry shaders and tessellation control outputs, where the redeclaration is the same size + if (! (isIoResizeArray(type) && existingType.getOuterArraySize() == type.getOuterArraySize())) + error(loc, "redeclaration of array with size", identifier.c_str(), ""); + return; + } + + existingType.updateArraySizes(type); + + if (isIoResizeArray(type)) + checkIoArraysConsistency(loc); +} + +void HlslParseContext::updateImplicitArraySize(const TSourceLoc& loc, TIntermNode *node, int index) +{ + // maybe there is nothing to do... + TIntermTyped* typedNode = node->getAsTyped(); + if (typedNode->getType().getImplicitArraySize() > index) + return; + + // something to do... + + // Figure out what symbol to lookup, as we will use its type to edit for the size change, + // as that type will be shared through shallow copies for future references. + TSymbol* symbol = nullptr; + int blockIndex = -1; + const TString* lookupName = nullptr; + if (node->getAsSymbolNode()) + lookupName = &node->getAsSymbolNode()->getName(); + else if (node->getAsBinaryNode()) { + const TIntermBinary* deref = node->getAsBinaryNode(); + // This has to be the result of a block dereference, unless it's bad shader code + // If it's a uniform block, then an error will be issued elsewhere, but + // return early now to avoid crashing later in this function. + if (! deref->getLeft()->getAsSymbolNode() || deref->getLeft()->getBasicType() != EbtBlock || + deref->getLeft()->getType().getQualifier().storage == EvqUniform || + deref->getRight()->getAsConstantUnion() == nullptr) + return; + + blockIndex = deref->getRight()->getAsConstantUnion()->getConstArray()[0].getIConst(); + + lookupName = &deref->getLeft()->getAsSymbolNode()->getName(); + if (IsAnonymous(*lookupName)) + lookupName = &(*deref->getLeft()->getType().getStruct())[blockIndex].type->getFieldName(); + } + + // Lookup the symbol, should only fail if shader code is incorrect + symbol = symbolTable.find(*lookupName); + if (symbol == nullptr) + return; + + if (symbol->getAsFunction()) { + error(loc, "array variable name expected", symbol->getName().c_str(), ""); + return; + } + + symbol->getWritableType().setImplicitArraySize(index + 1); +} + +// +// See if the identifier is a built-in symbol that can be redeclared, and if so, +// copy the symbol table's read-only built-in variable to the current +// global level, where it can be modified based on the passed in type. +// +// Returns nullptr if no redeclaration took place; meaning a normal declaration still +// needs to occur for it, not necessarily an error. +// +// Returns a redeclared and type-modified variable if a redeclared occurred. +// +TSymbol* HlslParseContext::redeclareBuiltinVariable(const TSourceLoc& loc, const TString& identifier, const TQualifier& qualifier, const TShaderQualifiers& publicType, bool& newDeclaration) +{ + if (! builtInName(identifier) || symbolTable.atBuiltInLevel() || ! symbolTable.atGlobalLevel()) + return nullptr; + + return nullptr; +} + +// +// Either redeclare the requested block, or give an error message why it can't be done. +// +// TODO: functionality: explicitly sizing members of redeclared blocks is not giving them an explicit size +void HlslParseContext::redeclareBuiltinBlock(const TSourceLoc& loc, TTypeList& newTypeList, const TString& blockName, const TString* instanceName, TArraySizes* arraySizes) +{ + // Redeclaring a built-in block... + + // Blocks with instance names are easy to find, lookup the instance name, + // Anonymous blocks need to be found via a member. + bool builtIn; + TSymbol* block; + if (instanceName) + block = symbolTable.find(*instanceName, &builtIn); + else + block = symbolTable.find(newTypeList.front().type->getFieldName(), &builtIn); + + // If the block was not found, this must be a version/profile/stage + // that doesn't have it, or the instance name is wrong. + const char* errorName = instanceName ? instanceName->c_str() : newTypeList.front().type->getFieldName().c_str(); + if (! block) { + error(loc, "no declaration found for redeclaration", errorName, ""); + return; + } + // Built-in blocks cannot be redeclared more than once, which if happened, + // we'd be finding the already redeclared one here, rather than the built in. + if (! builtIn) { + error(loc, "can only redeclare a built-in block once, and before any use", blockName.c_str(), ""); + return; + } + + // Copy the block to make a writable version, to insert into the block table after editing. + block = symbolTable.copyUpDeferredInsert(block); + + if (block->getType().getBasicType() != EbtBlock) { + error(loc, "cannot redeclare a non block as a block", errorName, ""); + return; + } + + // Edit and error check the container against the redeclaration + // - remove unused members + // - ensure remaining qualifiers/types match + TType& type = block->getWritableType(); + TTypeList::iterator member = type.getWritableStruct()->begin(); + size_t numOriginalMembersFound = 0; + while (member != type.getStruct()->end()) { + // look for match + bool found = false; + TTypeList::const_iterator newMember; + TSourceLoc memberLoc; + memberLoc.init(); + for (newMember = newTypeList.begin(); newMember != newTypeList.end(); ++newMember) { + if (member->type->getFieldName() == newMember->type->getFieldName()) { + found = true; + memberLoc = newMember->loc; + break; + } + } + + if (found) { + ++numOriginalMembersFound; + // - ensure match between redeclared members' types + // - check for things that can't be changed + // - update things that can be changed + TType& oldType = *member->type; + const TType& newType = *newMember->type; + if (! newType.sameElementType(oldType)) + error(memberLoc, "cannot redeclare block member with a different type", member->type->getFieldName().c_str(), ""); + if (oldType.isArray() != newType.isArray()) + error(memberLoc, "cannot change arrayness of redeclared block member", member->type->getFieldName().c_str(), ""); + else if (! oldType.sameArrayness(newType) && oldType.isExplicitlySizedArray()) + error(memberLoc, "cannot change array size of redeclared block member", member->type->getFieldName().c_str(), ""); + if (newType.getQualifier().isMemory()) + error(memberLoc, "cannot add memory qualifier to redeclared block member", member->type->getFieldName().c_str(), ""); + if (newType.getQualifier().hasLayout()) + error(memberLoc, "cannot add layout to redeclared block member", member->type->getFieldName().c_str(), ""); + if (newType.getQualifier().patch) + error(memberLoc, "cannot add patch to redeclared block member", member->type->getFieldName().c_str(), ""); + oldType.getQualifier().centroid = newType.getQualifier().centroid; + oldType.getQualifier().sample = newType.getQualifier().sample; + oldType.getQualifier().invariant = newType.getQualifier().invariant; + oldType.getQualifier().noContraction = newType.getQualifier().noContraction; + oldType.getQualifier().smooth = newType.getQualifier().smooth; + oldType.getQualifier().flat = newType.getQualifier().flat; + oldType.getQualifier().nopersp = newType.getQualifier().nopersp; + + // go to next member + ++member; + } else { + // For missing members of anonymous blocks that have been redeclared, + // hide the original (shared) declaration. + // Instance-named blocks can just have the member removed. + if (instanceName) + member = type.getWritableStruct()->erase(member); + else { + member->type->hideMember(); + ++member; + } + } + } + + if (numOriginalMembersFound < newTypeList.size()) + error(loc, "block redeclaration has extra members", blockName.c_str(), ""); + if (type.isArray() != (arraySizes != nullptr)) + error(loc, "cannot change arrayness of redeclared block", blockName.c_str(), ""); + else if (type.isArray()) { + if (type.isExplicitlySizedArray() && arraySizes->getOuterSize() == UnsizedArraySize) + error(loc, "block already declared with size, can't redeclare as implicitly-sized", blockName.c_str(), ""); + else if (type.isExplicitlySizedArray() && type.getArraySizes() != *arraySizes) + error(loc, "cannot change array size of redeclared block", blockName.c_str(), ""); + else if (type.isImplicitlySizedArray() && arraySizes->getOuterSize() != UnsizedArraySize) + type.changeOuterArraySize(arraySizes->getOuterSize()); + } + + symbolTable.insert(*block); + + // Tracking for implicit sizing of array + if (isIoResizeArray(block->getType())) { + ioArraySymbolResizeList.push_back(block); + checkIoArraysConsistency(loc, true); + } else if (block->getType().isArray()) + fixIoArraySize(loc, block->getWritableType()); + + // Save it in the AST for linker use. + intermediate.addSymbolLinkageNode(linkage, *block); +} + +void HlslParseContext::paramCheckFix(const TSourceLoc& loc, const TStorageQualifier& qualifier, TType& type) +{ + switch (qualifier) { + case EvqConst: + case EvqConstReadOnly: + type.getQualifier().storage = EvqConstReadOnly; + break; + case EvqIn: + case EvqOut: + case EvqInOut: + type.getQualifier().storage = qualifier; + break; + case EvqGlobal: + case EvqTemporary: + type.getQualifier().storage = EvqIn; + break; + default: + type.getQualifier().storage = EvqIn; + error(loc, "storage qualifier not allowed on function parameter", GetStorageQualifierString(qualifier), ""); + break; + } +} + +void HlslParseContext::paramCheckFix(const TSourceLoc& loc, const TQualifier& qualifier, TType& type) +{ + if (qualifier.isMemory()) { + type.getQualifier().volatil = qualifier.volatil; + type.getQualifier().coherent = qualifier.coherent; + type.getQualifier().readonly = qualifier.readonly; + type.getQualifier().writeonly = qualifier.writeonly; + type.getQualifier().restrict = qualifier.restrict; + } + + paramCheckFix(loc, qualifier.storage, type); +} + +void HlslParseContext::specializationCheck(const TSourceLoc& loc, const TType& type, const char* op) +{ + if (type.containsSpecializationSize()) + error(loc, "can't use with types containing arrays sized with a specialization constant", op, ""); +} + +// +// Layout qualifier stuff. +// + +// Put the id's layout qualification into the public type, for qualifiers not having a number set. +// This is before we know any type information for error checking. +void HlslParseContext::setLayoutQualifier(const TSourceLoc& loc, TPublicType& publicType, TString& id) +{ + std::transform(id.begin(), id.end(), id.begin(), ::tolower); + + if (id == TQualifier::getLayoutMatrixString(ElmColumnMajor)) { + publicType.qualifier.layoutMatrix = ElmColumnMajor; + return; + } + if (id == TQualifier::getLayoutMatrixString(ElmRowMajor)) { + publicType.qualifier.layoutMatrix = ElmRowMajor; + return; + } + if (id == TQualifier::getLayoutPackingString(ElpPacked)) { + if (vulkan > 0) + vulkanRemoved(loc, "packed"); + publicType.qualifier.layoutPacking = ElpPacked; + return; + } + if (id == TQualifier::getLayoutPackingString(ElpShared)) { + if (vulkan > 0) + vulkanRemoved(loc, "shared"); + publicType.qualifier.layoutPacking = ElpShared; + return; + } + if (id == "push_constant") { + requireVulkan(loc, "push_constant"); + publicType.qualifier.layoutPushConstant = true; + return; + } + if (language == EShLangGeometry || language == EShLangTessEvaluation) { + if (id == TQualifier::getGeometryString(ElgTriangles)) { + publicType.shaderQualifiers.geometry = ElgTriangles; + return; + } + if (language == EShLangGeometry) { + if (id == TQualifier::getGeometryString(ElgPoints)) { + publicType.shaderQualifiers.geometry = ElgPoints; + return; + } + if (id == TQualifier::getGeometryString(ElgLineStrip)) { + publicType.shaderQualifiers.geometry = ElgLineStrip; + return; + } + if (id == TQualifier::getGeometryString(ElgLines)) { + publicType.shaderQualifiers.geometry = ElgLines; + return; + } + if (id == TQualifier::getGeometryString(ElgLinesAdjacency)) { + publicType.shaderQualifiers.geometry = ElgLinesAdjacency; + return; + } + if (id == TQualifier::getGeometryString(ElgTrianglesAdjacency)) { + publicType.shaderQualifiers.geometry = ElgTrianglesAdjacency; + return; + } + if (id == TQualifier::getGeometryString(ElgTriangleStrip)) { + publicType.shaderQualifiers.geometry = ElgTriangleStrip; + return; + } + } else { + assert(language == EShLangTessEvaluation); + + // input primitive + if (id == TQualifier::getGeometryString(ElgTriangles)) { + publicType.shaderQualifiers.geometry = ElgTriangles; + return; + } + if (id == TQualifier::getGeometryString(ElgQuads)) { + publicType.shaderQualifiers.geometry = ElgQuads; + return; + } + if (id == TQualifier::getGeometryString(ElgIsolines)) { + publicType.shaderQualifiers.geometry = ElgIsolines; + return; + } + + // vertex spacing + if (id == TQualifier::getVertexSpacingString(EvsEqual)) { + publicType.shaderQualifiers.spacing = EvsEqual; + return; + } + if (id == TQualifier::getVertexSpacingString(EvsFractionalEven)) { + publicType.shaderQualifiers.spacing = EvsFractionalEven; + return; + } + if (id == TQualifier::getVertexSpacingString(EvsFractionalOdd)) { + publicType.shaderQualifiers.spacing = EvsFractionalOdd; + return; + } + + // triangle order + if (id == TQualifier::getVertexOrderString(EvoCw)) { + publicType.shaderQualifiers.order = EvoCw; + return; + } + if (id == TQualifier::getVertexOrderString(EvoCcw)) { + publicType.shaderQualifiers.order = EvoCcw; + return; + } + + // point mode + if (id == "point_mode") { + publicType.shaderQualifiers.pointMode = true; + return; + } + } + } + if (language == EShLangFragment) { + if (id == "origin_upper_left") { + publicType.shaderQualifiers.originUpperLeft = true; + return; + } + if (id == "pixel_center_integer") { + publicType.shaderQualifiers.pixelCenterInteger = true; + return; + } + if (id == "early_fragment_tests") { + publicType.shaderQualifiers.earlyFragmentTests = true; + return; + } + for (TLayoutDepth depth = (TLayoutDepth)(EldNone + 1); depth < EldCount; depth = (TLayoutDepth)(depth + 1)) { + if (id == TQualifier::getLayoutDepthString(depth)) { + publicType.shaderQualifiers.layoutDepth = depth; + return; + } + } + if (id.compare(0, 13, "blend_support") == 0) { + bool found = false; + for (TBlendEquationShift be = (TBlendEquationShift)0; be < EBlendCount; be = (TBlendEquationShift)(be + 1)) { + if (id == TQualifier::getBlendEquationString(be)) { + requireExtensions(loc, 1, &E_GL_KHR_blend_equation_advanced, "blend equation"); + intermediate.addBlendEquation(be); + publicType.shaderQualifiers.blendEquation = true; + found = true; + break; + } + } + if (! found) + error(loc, "unknown blend equation", "blend_support", ""); + return; + } + } + error(loc, "unrecognized layout identifier, or qualifier requires assignment (e.g., binding = 4)", id.c_str(), ""); +} + +// Put the id's layout qualifier value into the public type, for qualifiers having a number set. +// This is before we know any type information for error checking. +void HlslParseContext::setLayoutQualifier(const TSourceLoc& loc, TPublicType& publicType, TString& id, const TIntermTyped* node) +{ + const char* feature = "layout-id value"; + const char* nonLiteralFeature = "non-literal layout-id value"; + + integerCheck(node, feature); + const TIntermConstantUnion* constUnion = node->getAsConstantUnion(); + int value = 0; + if (constUnion) { + value = constUnion->getConstArray()[0].getIConst(); + } + + std::transform(id.begin(), id.end(), id.begin(), ::tolower); + + if (id == "offset") { + publicType.qualifier.layoutOffset = value; + return; + } else if (id == "align") { + // "The specified alignment must be a power of 2, or a compile-time error results." + if (! IsPow2(value)) + error(loc, "must be a power of 2", "align", ""); + else + publicType.qualifier.layoutAlign = value; + return; + } else if (id == "location") { + if ((unsigned int)value >= TQualifier::layoutLocationEnd) + error(loc, "location is too large", id.c_str(), ""); + else + publicType.qualifier.layoutLocation = value; + return; + } else if (id == "set") { + if ((unsigned int)value >= TQualifier::layoutSetEnd) + error(loc, "set is too large", id.c_str(), ""); + else + publicType.qualifier.layoutSet = value; + return; + } else if (id == "binding") { + if ((unsigned int)value >= TQualifier::layoutBindingEnd) + error(loc, "binding is too large", id.c_str(), ""); + else + publicType.qualifier.layoutBinding = value; + return; + } else if (id == "component") { + if ((unsigned)value >= TQualifier::layoutComponentEnd) + error(loc, "component is too large", id.c_str(), ""); + else + publicType.qualifier.layoutComponent = value; + return; + } else if (id.compare(0, 4, "xfb_") == 0) { + // "Any shader making any static use (after preprocessing) of any of these + // *xfb_* qualifiers will cause the shader to be in a transform feedback + // capturing mode and hence responsible for describing the transform feedback + // setup." + intermediate.setXfbMode(); + if (id == "xfb_buffer") { + // "It is a compile-time error to specify an *xfb_buffer* that is greater than + // the implementation-dependent constant gl_MaxTransformFeedbackBuffers." + if (value >= resources.maxTransformFeedbackBuffers) + error(loc, "buffer is too large:", id.c_str(), "gl_MaxTransformFeedbackBuffers is %d", resources.maxTransformFeedbackBuffers); + if (value >= (int)TQualifier::layoutXfbBufferEnd) + error(loc, "buffer is too large:", id.c_str(), "internal max is %d", TQualifier::layoutXfbBufferEnd - 1); + else + publicType.qualifier.layoutXfbBuffer = value; + return; + } else if (id == "xfb_offset") { + if (value >= (int)TQualifier::layoutXfbOffsetEnd) + error(loc, "offset is too large:", id.c_str(), "internal max is %d", TQualifier::layoutXfbOffsetEnd - 1); + else + publicType.qualifier.layoutXfbOffset = value; + return; + } else if (id == "xfb_stride") { + // "The resulting stride (implicit or explicit), when divided by 4, must be less than or equal to the + // implementation-dependent constant gl_MaxTransformFeedbackInterleavedComponents." + if (value > 4 * resources.maxTransformFeedbackInterleavedComponents) + error(loc, "1/4 stride is too large:", id.c_str(), "gl_MaxTransformFeedbackInterleavedComponents is %d", resources.maxTransformFeedbackInterleavedComponents); + else if (value >= (int)TQualifier::layoutXfbStrideEnd) + error(loc, "stride is too large:", id.c_str(), "internal max is %d", TQualifier::layoutXfbStrideEnd - 1); + if (value < (int)TQualifier::layoutXfbStrideEnd) + publicType.qualifier.layoutXfbStride = value; + return; + } + } + + if (id == "input_attachment_index") { + requireVulkan(loc, "input_attachment_index"); + if (value >= (int)TQualifier::layoutAttachmentEnd) + error(loc, "attachment index is too large", id.c_str(), ""); + else + publicType.qualifier.layoutAttachment = value; + return; + } + if (id == "constant_id") { + requireSpv(loc, "constant_id"); + if (value >= (int)TQualifier::layoutSpecConstantIdEnd) { + error(loc, "specialization-constant id is too large", id.c_str(), ""); + } else { + publicType.qualifier.layoutSpecConstantId = value; + publicType.qualifier.specConstant = true; + if (! intermediate.addUsedConstantId(value)) + error(loc, "specialization-constant id already used", id.c_str(), ""); + } + return; + } + + switch (language) { + case EShLangVertex: + break; + + case EShLangTessControl: + if (id == "vertices") { + if (value == 0) + error(loc, "must be greater than 0", "vertices", ""); + else + publicType.shaderQualifiers.vertices = value; + return; + } + break; + + case EShLangTessEvaluation: + break; + + case EShLangGeometry: + if (id == "invocations") { + if (value == 0) + error(loc, "must be at least 1", "invocations", ""); + else + publicType.shaderQualifiers.invocations = value; + return; + } + if (id == "max_vertices") { + publicType.shaderQualifiers.vertices = value; + if (value > resources.maxGeometryOutputVertices) + error(loc, "too large, must be less than gl_MaxGeometryOutputVertices", "max_vertices", ""); + return; + } + if (id == "stream") { + publicType.qualifier.layoutStream = value; + return; + } + break; + + case EShLangFragment: + if (id == "index") { + const char* exts[2] = { E_GL_ARB_separate_shader_objects, E_GL_ARB_explicit_attrib_location }; + publicType.qualifier.layoutIndex = value; + return; + } + break; + + case EShLangCompute: + if (id.compare(0, 11, "local_size_") == 0) { + if (id == "local_size_x") { + publicType.shaderQualifiers.localSize[0] = value; + return; + } + if (id == "local_size_y") { + publicType.shaderQualifiers.localSize[1] = value; + return; + } + if (id == "local_size_z") { + publicType.shaderQualifiers.localSize[2] = value; + return; + } + if (spv > 0) { + if (id == "local_size_x_id") { + publicType.shaderQualifiers.localSizeSpecId[0] = value; + return; + } + if (id == "local_size_y_id") { + publicType.shaderQualifiers.localSizeSpecId[1] = value; + return; + } + if (id == "local_size_z_id") { + publicType.shaderQualifiers.localSizeSpecId[2] = value; + return; + } + } + } + break; + + default: + break; + } + + error(loc, "there is no such layout identifier for this stage taking an assigned value", id.c_str(), ""); +} + +// Merge any layout qualifier information from src into dst, leaving everything else in dst alone +// +// "More than one layout qualifier may appear in a single declaration. +// Additionally, the same layout-qualifier-name can occur multiple times +// within a layout qualifier or across multiple layout qualifiers in the +// same declaration. When the same layout-qualifier-name occurs +// multiple times, in a single declaration, the last occurrence overrides +// the former occurrence(s). Further, if such a layout-qualifier-name +// will effect subsequent declarations or other observable behavior, it +// is only the last occurrence that will have any effect, behaving as if +// the earlier occurrence(s) within the declaration are not present. +// This is also true for overriding layout-qualifier-names, where one +// overrides the other (e.g., row_major vs. column_major); only the last +// occurrence has any effect." +// +void HlslParseContext::mergeObjectLayoutQualifiers(TQualifier& dst, const TQualifier& src, bool inheritOnly) +{ + if (src.hasMatrix()) + dst.layoutMatrix = src.layoutMatrix; + if (src.hasPacking()) + dst.layoutPacking = src.layoutPacking; + + if (src.hasStream()) + dst.layoutStream = src.layoutStream; + + if (src.hasFormat()) + dst.layoutFormat = src.layoutFormat; + + if (src.hasXfbBuffer()) + dst.layoutXfbBuffer = src.layoutXfbBuffer; + + if (src.hasAlign()) + dst.layoutAlign = src.layoutAlign; + + if (! inheritOnly) { + if (src.hasLocation()) + dst.layoutLocation = src.layoutLocation; + if (src.hasComponent()) + dst.layoutComponent = src.layoutComponent; + if (src.hasIndex()) + dst.layoutIndex = src.layoutIndex; + + if (src.hasOffset()) + dst.layoutOffset = src.layoutOffset; + + if (src.hasSet()) + dst.layoutSet = src.layoutSet; + if (src.layoutBinding != TQualifier::layoutBindingEnd) + dst.layoutBinding = src.layoutBinding; + + if (src.hasXfbStride()) + dst.layoutXfbStride = src.layoutXfbStride; + if (src.hasXfbOffset()) + dst.layoutXfbOffset = src.layoutXfbOffset; + if (src.hasAttachment()) + dst.layoutAttachment = src.layoutAttachment; + if (src.hasSpecConstantId()) + dst.layoutSpecConstantId = src.layoutSpecConstantId; + + if (src.layoutPushConstant) + dst.layoutPushConstant = true; + } +} + +// +// Look up a function name in the symbol table, and make sure it is a function. +// +// Return the function symbol if found, otherwise nullptr. +// +const TFunction* HlslParseContext::findFunction(const TSourceLoc& loc, const TFunction& call, bool& builtIn) +{ + const TFunction* function = nullptr; + + if (symbolTable.isFunctionNameVariable(call.getName())) { + error(loc, "can't use function syntax on variable", call.getName().c_str(), ""); + return nullptr; + } + + // first, look for an exact match + TSymbol* symbol = symbolTable.find(call.getMangledName(), &builtIn); + if (symbol) + return symbol->getAsFunction(); + + // exact match not found, look through a list of overloaded functions of the same name + + const TFunction* candidate = nullptr; + TVector candidateList; + symbolTable.findFunctionNameList(call.getMangledName(), candidateList, builtIn); + + for (TVector::const_iterator it = candidateList.begin(); it != candidateList.end(); ++it) { + const TFunction& function = *(*it); + + // to even be a potential match, number of arguments has to match + if (call.getParamCount() != function.getParamCount()) + continue; + + bool possibleMatch = true; + for (int i = 0; i < function.getParamCount(); ++i) { + // same types is easy + if (*function[i].type == *call[i].type) + continue; + + // We have a mismatch in type, see if it is implicitly convertible + + if (function[i].type->isArray() || call[i].type->isArray() || + ! function[i].type->sameElementShape(*call[i].type)) + possibleMatch = false; + else { + // do direction-specific checks for conversion of basic type + if (function[i].type->getQualifier().isParamInput()) { + if (! intermediate.canImplicitlyPromote(call[i].type->getBasicType(), function[i].type->getBasicType())) + possibleMatch = false; + } + if (function[i].type->getQualifier().isParamOutput()) { + if (! intermediate.canImplicitlyPromote(function[i].type->getBasicType(), call[i].type->getBasicType())) + possibleMatch = false; + } + } + if (! possibleMatch) + break; + } + if (possibleMatch) { + if (candidate) { + // our second match, meaning ambiguity + error(loc, "ambiguous function signature match: multiple signatures match under implicit type conversion", call.getName().c_str(), ""); + } else + candidate = &function; + } + } + + if (candidate == nullptr) + error(loc, "no matching overloaded function found", call.getName().c_str(), ""); + + return candidate; +} + +// +// Do everything necessary to handle a variable (non-block) declaration. +// Either redeclaring a variable, or making a new one, updating the symbol +// table, and all error checking. +// +// Returns a subtree node that computes an initializer, if needed. +// Returns nullptr if there is no code to execute for initialization. +// +// 'publicType' is the type part of the declaration (to the left) +// 'arraySizes' is the arrayness tagged on the identifier (to the right) +// +TIntermNode* HlslParseContext::declareVariable(const TSourceLoc& loc, TString& identifier, const TType& parseType, TArraySizes* arraySizes, TIntermTyped* initializer) +{ + TType type; + type.shallowCopy(parseType); + if (type.isImplicitlySizedArray()) { + // Because "int[] a = int[2](...), b = int[3](...)" makes two arrays a and b + // of different sizes, for this case sharing the shallow copy of arrayness + // with the publicType oversubscribes it, so get a deep copy of the arrayness. + type.newArraySizes(*parseType.getArraySizes()); + } + + if (voidErrorCheck(loc, identifier, type.getBasicType())) + return nullptr; + + // Check for redeclaration of built-ins and/or attempting to declare a reserved name + bool newDeclaration = false; // true if a new entry gets added to the symbol table + TSymbol* symbol = nullptr; // = redeclareBuiltinVariable(loc, identifier, type.getQualifier(), publicType.shaderQualifiers, newDeclaration); + + inheritGlobalDefaults(type.getQualifier()); + + // Declare the variable + if (arraySizes || type.isArray()) { + // Arrayness is potentially coming both from the type and from the + // variable: "int[] a[];" or just one or the other. + // Merge it all to the type, so all arrayness is part of the type. + arrayDimMerge(type, arraySizes); + declareArray(loc, identifier, type, symbol, newDeclaration); + } else { + // non-array case + if (! symbol) + symbol = declareNonArray(loc, identifier, type, newDeclaration); + else if (type != symbol->getType()) + error(loc, "cannot change the type of", "redeclaration", symbol->getName().c_str()); + } + + if (! symbol) + return nullptr; + + // Deal with initializer + TIntermNode* initNode = nullptr; + if (symbol && initializer) { + TVariable* variable = symbol->getAsVariable(); + if (! variable) { + error(loc, "initializer requires a variable, not a member", identifier.c_str(), ""); + return nullptr; + } + initNode = executeInitializer(loc, initializer, variable); + } + + // see if it's a linker-level object to track + if (newDeclaration && symbolTable.atGlobalLevel()) + intermediate.addSymbolLinkageNode(linkage, *symbol); + + return initNode; +} + +// Pick up global defaults from the provide global defaults into dst. +void HlslParseContext::inheritGlobalDefaults(TQualifier& dst) const +{ + if (dst.storage == EvqVaryingOut) { + if (! dst.hasStream() && language == EShLangGeometry) + dst.layoutStream = globalOutputDefaults.layoutStream; + if (! dst.hasXfbBuffer()) + dst.layoutXfbBuffer = globalOutputDefaults.layoutXfbBuffer; + } +} + +// +// Make an internal-only variable whose name is for debug purposes only +// and won't be searched for. Callers will only use the return value to use +// the variable, not the name to look it up. It is okay if the name +// is the same as other names; there won't be any conflict. +// +TVariable* HlslParseContext::makeInternalVariable(const char* name, const TType& type) const +{ + TString* nameString = new TString(name); + TVariable* variable = new TVariable(nameString, type); + symbolTable.makeInternalVariable(*variable); + + return variable; +} + +// +// Declare a non-array variable, the main point being there is no redeclaration +// for resizing allowed. +// +// Return the successfully declared variable. +// +TVariable* HlslParseContext::declareNonArray(const TSourceLoc& loc, TString& identifier, TType& type, bool& newDeclaration) +{ + // make a new variable + TVariable* variable = new TVariable(&identifier, type); + + // add variable to symbol table + if (! symbolTable.insert(*variable)) { + error(loc, "redefinition", variable->getName().c_str(), ""); + return nullptr; + } else { + newDeclaration = true; + return variable; + } +} + +// +// Handle all types of initializers from the grammar. +// +// Returning nullptr just means there is no code to execute to handle the +// initializer, which will, for example, be the case for constant initializers. +// +TIntermNode* HlslParseContext::executeInitializer(const TSourceLoc& loc, TIntermTyped* initializer, TVariable* variable) +{ + // + // Identifier must be of type constant, a global, or a temporary, and + // starting at version 120, desktop allows uniforms to have initializers. + // + TStorageQualifier qualifier = variable->getType().getQualifier().storage; + + // + // If the initializer was from braces { ... }, we convert the whole subtree to a + // constructor-style subtree, allowing the rest of the code to operate + // identically for both kinds of initializers. + // + initializer = convertInitializerList(loc, variable->getType(), initializer); + if (! initializer) { + // error recovery; don't leave const without constant values + if (qualifier == EvqConst) + variable->getWritableType().getQualifier().storage = EvqTemporary; + return nullptr; + } + + // Fix outer arrayness if variable is unsized, getting size from the initializer + if (initializer->getType().isExplicitlySizedArray() && + variable->getType().isImplicitlySizedArray()) + variable->getWritableType().changeOuterArraySize(initializer->getType().getOuterArraySize()); + + // Inner arrayness can also get set by an initializer + if (initializer->getType().isArrayOfArrays() && variable->getType().isArrayOfArrays() && + initializer->getType().getArraySizes()->getNumDims() == + variable->getType().getArraySizes()->getNumDims()) { + // adopt unsized sizes from the initializer's sizes + for (int d = 1; d < variable->getType().getArraySizes()->getNumDims(); ++d) { + if (variable->getType().getArraySizes()->getDimSize(d) == UnsizedArraySize) + variable->getWritableType().getArraySizes().setDimSize(d, initializer->getType().getArraySizes()->getDimSize(d)); + } + } + + // Uniform and global consts require a constant initializer + if (qualifier == EvqUniform && initializer->getType().getQualifier().storage != EvqConst) { + error(loc, "uniform initializers must be constant", "=", "'%s'", variable->getType().getCompleteString().c_str()); + variable->getWritableType().getQualifier().storage = EvqTemporary; + return nullptr; + } + if (qualifier == EvqConst && symbolTable.atGlobalLevel() && initializer->getType().getQualifier().storage != EvqConst) { + error(loc, "global const initializers must be constant", "=", "'%s'", variable->getType().getCompleteString().c_str()); + variable->getWritableType().getQualifier().storage = EvqTemporary; + return nullptr; + } + + // Const variables require a constant initializer, depending on version + if (qualifier == EvqConst) { + if (initializer->getType().getQualifier().storage != EvqConst) { + variable->getWritableType().getQualifier().storage = EvqConstReadOnly; + qualifier = EvqConstReadOnly; + } + } + + if (qualifier == EvqConst || qualifier == EvqUniform) { + // Compile-time tagging of the variable with its constant value... + + initializer = intermediate.addConversion(EOpAssign, variable->getType(), initializer); + if (! initializer || ! initializer->getAsConstantUnion() || variable->getType() != initializer->getType()) { + error(loc, "non-matching or non-convertible constant type for const initializer", + variable->getType().getStorageQualifierString(), ""); + variable->getWritableType().getQualifier().storage = EvqTemporary; + return nullptr; + } + + variable->setConstArray(initializer->getAsConstantUnion()->getConstArray()); + } else { + // normal assigning of a value to a variable... + specializationCheck(loc, initializer->getType(), "initializer"); + TIntermSymbol* intermSymbol = intermediate.addSymbol(*variable, loc); + TIntermNode* initNode = intermediate.addAssign(EOpAssign, intermSymbol, initializer, loc); + if (! initNode) + assignError(loc, "=", intermSymbol->getCompleteString(), initializer->getCompleteString()); + + return initNode; + } + + return nullptr; +} + +// +// Reprocess any initializer-list { ... } parts of the initializer. +// Need to hierarchically assign correct types and implicit +// conversions. Will do this mimicking the same process used for +// creating a constructor-style initializer, ensuring we get the +// same form. +// +TIntermTyped* HlslParseContext::convertInitializerList(const TSourceLoc& loc, const TType& type, TIntermTyped* initializer) +{ + // Will operate recursively. Once a subtree is found that is constructor style, + // everything below it is already good: Only the "top part" of the initializer + // can be an initializer list, where "top part" can extend for several (or all) levels. + + // see if we have bottomed out in the tree within the initializer-list part + TIntermAggregate* initList = initializer->getAsAggregate(); + if (! initList || initList->getOp() != EOpNull) + return initializer; + + // Of the initializer-list set of nodes, need to process bottom up, + // so recurse deep, then process on the way up. + + // Go down the tree here... + if (type.isArray()) { + // The type's array might be unsized, which could be okay, so base sizes on the size of the aggregate. + // Later on, initializer execution code will deal with array size logic. + TType arrayType; + arrayType.shallowCopy(type); // sharing struct stuff is fine + arrayType.newArraySizes(*type.getArraySizes()); // but get a fresh copy of the array information, to edit below + + // edit array sizes to fill in unsized dimensions + arrayType.changeOuterArraySize((int)initList->getSequence().size()); + TIntermTyped* firstInit = initList->getSequence()[0]->getAsTyped(); + if (arrayType.isArrayOfArrays() && firstInit->getType().isArray() && + arrayType.getArraySizes().getNumDims() == firstInit->getType().getArraySizes()->getNumDims() + 1) { + for (int d = 1; d < arrayType.getArraySizes().getNumDims(); ++d) { + if (arrayType.getArraySizes().getDimSize(d) == UnsizedArraySize) + arrayType.getArraySizes().setDimSize(d, firstInit->getType().getArraySizes()->getDimSize(d - 1)); + } + } + + TType elementType(arrayType, 0); // dereferenced type + for (size_t i = 0; i < initList->getSequence().size(); ++i) { + initList->getSequence()[i] = convertInitializerList(loc, elementType, initList->getSequence()[i]->getAsTyped()); + if (initList->getSequence()[i] == nullptr) + return nullptr; + } + + return addConstructor(loc, initList, arrayType, mapTypeToConstructorOp(arrayType)); + } else if (type.isStruct()) { + if (type.getStruct()->size() != initList->getSequence().size()) { + error(loc, "wrong number of structure members", "initializer list", ""); + return nullptr; + } + for (size_t i = 0; i < type.getStruct()->size(); ++i) { + initList->getSequence()[i] = convertInitializerList(loc, *(*type.getStruct())[i].type, initList->getSequence()[i]->getAsTyped()); + if (initList->getSequence()[i] == nullptr) + return nullptr; + } + } else if (type.isMatrix()) { + if (type.getMatrixCols() != (int)initList->getSequence().size()) { + error(loc, "wrong number of matrix columns:", "initializer list", type.getCompleteString().c_str()); + return nullptr; + } + TType vectorType(type, 0); // dereferenced type + for (int i = 0; i < type.getMatrixCols(); ++i) { + initList->getSequence()[i] = convertInitializerList(loc, vectorType, initList->getSequence()[i]->getAsTyped()); + if (initList->getSequence()[i] == nullptr) + return nullptr; + } + } else if (type.isVector()) { + if (type.getVectorSize() != (int)initList->getSequence().size()) { + error(loc, "wrong vector size (or rows in a matrix column):", "initializer list", type.getCompleteString().c_str()); + return nullptr; + } + } else { + error(loc, "unexpected initializer-list type:", "initializer list", type.getCompleteString().c_str()); + return nullptr; + } + + // now that the subtree is processed, process this node + return addConstructor(loc, initList, type, mapTypeToConstructorOp(type)); +} + +// +// Test for the correctness of the parameters passed to various constructor functions +// and also convert them to the right data type, if allowed and required. +// +// Returns nullptr for an error or the constructed node (aggregate or typed) for no error. +// +TIntermTyped* HlslParseContext::addConstructor(const TSourceLoc& loc, TIntermNode* node, const TType& type, TOperator op) +{ + if (node == nullptr || node->getAsTyped() == nullptr) + return nullptr; + + TIntermAggregate* aggrNode = node->getAsAggregate(); + + // Combined texture-sampler constructors are completely semantic checked + // in constructorTextureSamplerError() + if (op == EOpConstructTextureSampler) + return intermediate.setAggregateOperator(aggrNode, op, type, loc); + + TTypeList::const_iterator memberTypes; + if (op == EOpConstructStruct) + memberTypes = type.getStruct()->begin(); + + TType elementType; + if (type.isArray()) { + TType dereferenced(type, 0); + elementType.shallowCopy(dereferenced); + } else + elementType.shallowCopy(type); + + bool singleArg; + if (aggrNode) { + if (aggrNode->getOp() != EOpNull || aggrNode->getSequence().size() == 1) + singleArg = true; + else + singleArg = false; + } else + singleArg = true; + + TIntermTyped *newNode; + if (singleArg) { + // If structure constructor or array constructor is being called + // for only one parameter inside the structure, we need to call constructAggregate function once. + if (type.isArray()) + newNode = constructAggregate(node, elementType, 1, node->getLoc()); + else if (op == EOpConstructStruct) + newNode = constructAggregate(node, *(*memberTypes).type, 1, node->getLoc()); + else + newNode = constructBuiltIn(type, op, node->getAsTyped(), node->getLoc(), false); + + if (newNode && (type.isArray() || op == EOpConstructStruct)) + newNode = intermediate.setAggregateOperator(newNode, EOpConstructStruct, type, loc); + + return newNode; + } + + // + // Handle list of arguments. + // + TIntermSequence &sequenceVector = aggrNode->getSequence(); // Stores the information about the parameter to the constructor + // if the structure constructor contains more than one parameter, then construct + // each parameter + + int paramCount = 0; // keeps a track of the constructor parameter number being checked + + // for each parameter to the constructor call, check to see if the right type is passed or convert them + // to the right type if possible (and allowed). + // for structure constructors, just check if the right type is passed, no conversion is allowed. + + for (TIntermSequence::iterator p = sequenceVector.begin(); + p != sequenceVector.end(); p++, paramCount++) { + if (type.isArray()) + newNode = constructAggregate(*p, elementType, paramCount + 1, node->getLoc()); + else if (op == EOpConstructStruct) + newNode = constructAggregate(*p, *(memberTypes[paramCount]).type, paramCount + 1, node->getLoc()); + else + newNode = constructBuiltIn(type, op, (*p)->getAsTyped(), node->getLoc(), true); + + if (newNode) + *p = newNode; + else + return nullptr; + } + + TIntermTyped* constructor = intermediate.setAggregateOperator(aggrNode, op, type, loc); + + return constructor; +} + +// Function for constructor implementation. Calls addUnaryMath with appropriate EOp value +// for the parameter to the constructor (passed to this function). Essentially, it converts +// the parameter types correctly. If a constructor expects an int (like ivec2) and is passed a +// float, then float is converted to int. +// +// Returns nullptr for an error or the constructed node. +// +TIntermTyped* HlslParseContext::constructBuiltIn(const TType& type, TOperator op, TIntermTyped* node, const TSourceLoc& loc, bool subset) +{ + TIntermTyped* newNode; + TOperator basicOp; + + // + // First, convert types as needed. + // + switch (op) { + case EOpConstructVec2: + case EOpConstructVec3: + case EOpConstructVec4: + case EOpConstructMat2x2: + case EOpConstructMat2x3: + case EOpConstructMat2x4: + case EOpConstructMat3x2: + case EOpConstructMat3x3: + case EOpConstructMat3x4: + case EOpConstructMat4x2: + case EOpConstructMat4x3: + case EOpConstructMat4x4: + case EOpConstructFloat: + basicOp = EOpConstructFloat; + break; + + case EOpConstructDVec2: + case EOpConstructDVec3: + case EOpConstructDVec4: + case EOpConstructDMat2x2: + case EOpConstructDMat2x3: + case EOpConstructDMat2x4: + case EOpConstructDMat3x2: + case EOpConstructDMat3x3: + case EOpConstructDMat3x4: + case EOpConstructDMat4x2: + case EOpConstructDMat4x3: + case EOpConstructDMat4x4: + case EOpConstructDouble: + basicOp = EOpConstructDouble; + break; + + case EOpConstructIVec2: + case EOpConstructIVec3: + case EOpConstructIVec4: + case EOpConstructInt: + basicOp = EOpConstructInt; + break; + + case EOpConstructUVec2: + case EOpConstructUVec3: + case EOpConstructUVec4: + case EOpConstructUint: + basicOp = EOpConstructUint; + break; + + case EOpConstructBVec2: + case EOpConstructBVec3: + case EOpConstructBVec4: + case EOpConstructBool: + basicOp = EOpConstructBool; + break; + + default: + error(loc, "unsupported construction", "", ""); + + return nullptr; + } + newNode = intermediate.addUnaryMath(basicOp, node, node->getLoc()); + if (newNode == nullptr) { + error(loc, "can't convert", "constructor", ""); + return nullptr; + } + + // + // Now, if there still isn't an operation to do the construction, and we need one, add one. + // + + // Otherwise, skip out early. + if (subset || (newNode != node && newNode->getType() == type)) + return newNode; + + // setAggregateOperator will insert a new node for the constructor, as needed. + return intermediate.setAggregateOperator(newNode, op, type, loc); +} + +// This function tests for the type of the parameters to the structure or array constructor. Raises +// an error message if the expected type does not match the parameter passed to the constructor. +// +// Returns nullptr for an error or the input node itself if the expected and the given parameter types match. +// +TIntermTyped* HlslParseContext::constructAggregate(TIntermNode* node, const TType& type, int paramCount, const TSourceLoc& loc) +{ + TIntermTyped* converted = intermediate.addConversion(EOpConstructStruct, type, node->getAsTyped()); + if (! converted || converted->getType() != type) { + error(loc, "", "constructor", "cannot convert parameter %d from '%s' to '%s'", paramCount, + node->getAsTyped()->getType().getCompleteString().c_str(), type.getCompleteString().c_str()); + + return nullptr; + } + + return converted; +} + +// +// Do everything needed to add an interface block. +// +void HlslParseContext::declareBlock(const TSourceLoc& loc, TTypeList& typeList, const TString* instanceName, TArraySizes* arraySizes) +{ + // fix and check for member storage qualifiers and types that don't belong within a block + for (unsigned int member = 0; member < typeList.size(); ++member) { + TType& memberType = *typeList[member].type; + TQualifier& memberQualifier = memberType.getQualifier(); + const TSourceLoc& memberLoc = typeList[member].loc; + globalQualifierFix(memberLoc, memberQualifier); + memberQualifier.storage = currentBlockQualifier.storage; + } + + // This might be a redeclaration of a built-in block. If so, redeclareBuiltinBlock() will + // do all the rest. + if (! symbolTable.atBuiltInLevel() && builtInName(*blockName)) { + redeclareBuiltinBlock(loc, typeList, *blockName, instanceName, arraySizes); + return; + } + + // Make default block qualification, and adjust the member qualifications + + TQualifier defaultQualification; + switch (currentBlockQualifier.storage) { + case EvqUniform: defaultQualification = globalUniformDefaults; break; + case EvqBuffer: defaultQualification = globalBufferDefaults; break; + case EvqVaryingIn: defaultQualification = globalInputDefaults; break; + case EvqVaryingOut: defaultQualification = globalOutputDefaults; break; + default: defaultQualification.clear(); break; + } + + // Special case for "push_constant uniform", which has a default of std430, + // contrary to normal uniform defaults, and can't have a default tracked for it. + if (currentBlockQualifier.layoutPushConstant && ! currentBlockQualifier.hasPacking()) + currentBlockQualifier.layoutPacking = ElpStd430; + + // fix and check for member layout qualifiers + + mergeObjectLayoutQualifiers(defaultQualification, currentBlockQualifier, true); + + bool memberWithLocation = false; + bool memberWithoutLocation = false; + for (unsigned int member = 0; member < typeList.size(); ++member) { + TQualifier& memberQualifier = typeList[member].type->getQualifier(); + const TSourceLoc& memberLoc = typeList[member].loc; + if (memberQualifier.hasStream()) { + if (defaultQualification.layoutStream != memberQualifier.layoutStream) + error(memberLoc, "member cannot contradict block", "stream", ""); + } + + // "This includes a block's inheritance of the + // current global default buffer, a block member's inheritance of the block's + // buffer, and the requirement that any *xfb_buffer* declared on a block + // member must match the buffer inherited from the block." + if (memberQualifier.hasXfbBuffer()) { + if (defaultQualification.layoutXfbBuffer != memberQualifier.layoutXfbBuffer) + error(memberLoc, "member cannot contradict block (or what block inherited from global)", "xfb_buffer", ""); + } + + if (memberQualifier.hasPacking()) + error(memberLoc, "member of block cannot have a packing layout qualifier", typeList[member].type->getFieldName().c_str(), ""); + if (memberQualifier.hasLocation()) { + switch (currentBlockQualifier.storage) { + case EvqVaryingIn: + case EvqVaryingOut: + memberWithLocation = true; + break; + default: + break; + } + } else + memberWithoutLocation = true; + if (memberQualifier.hasAlign()) { + if (defaultQualification.layoutPacking != ElpStd140 && defaultQualification.layoutPacking != ElpStd430) + error(memberLoc, "can only be used with std140 or std430 layout packing", "align", ""); + } + + TQualifier newMemberQualification = defaultQualification; + mergeQualifiers(memberLoc, newMemberQualification, memberQualifier, false); + memberQualifier = newMemberQualification; + } + + // Process the members + fixBlockLocations(loc, currentBlockQualifier, typeList, memberWithLocation, memberWithoutLocation); + fixBlockXfbOffsets(currentBlockQualifier, typeList); + fixBlockUniformOffsets(currentBlockQualifier, typeList); + + // reverse merge, so that currentBlockQualifier now has all layout information + // (can't use defaultQualification directly, it's missing other non-layout-default-class qualifiers) + mergeObjectLayoutQualifiers(currentBlockQualifier, defaultQualification, true); + + // + // Build and add the interface block as a new type named 'blockName' + // + + TType blockType(&typeList, *blockName, currentBlockQualifier); + if (arraySizes) + blockType.newArraySizes(*arraySizes); + + // + // Don't make a user-defined type out of block name; that will cause an error + // if the same block name gets reused in a different interface. + // + // "Block names have no other use within a shader + // beyond interface matching; it is a compile-time error to use a block name at global scope for anything + // other than as a block name (e.g., use of a block name for a global variable name or function name is + // currently reserved)." + // + // Use the symbol table to prevent normal reuse of the block's name, as a variable entry, + // whose type is EbtBlock, but without all the structure; that will come from the type + // the instances point to. + // + TType blockNameType(EbtBlock, blockType.getQualifier().storage); + TVariable* blockNameVar = new TVariable(blockName, blockNameType); + if (! symbolTable.insert(*blockNameVar)) { + TSymbol* existingName = symbolTable.find(*blockName); + if (existingName->getType().getBasicType() == EbtBlock) { + if (existingName->getType().getQualifier().storage == blockType.getQualifier().storage) { + error(loc, "Cannot reuse block name within the same interface:", blockName->c_str(), blockType.getStorageQualifierString()); + return; + } + } else { + error(loc, "block name cannot redefine a non-block name", blockName->c_str(), ""); + return; + } + } + + // Add the variable, as anonymous or named instanceName. + // Make an anonymous variable if no name was provided. + if (! instanceName) + instanceName = NewPoolTString(""); + + TVariable& variable = *new TVariable(instanceName, blockType); + if (! symbolTable.insert(variable)) { + if (*instanceName == "") + error(loc, "nameless block contains a member that already has a name at global scope", blockName->c_str(), ""); + else + error(loc, "block instance name redefinition", variable.getName().c_str(), ""); + + return; + } + + if (isIoResizeArray(blockType)) { + ioArraySymbolResizeList.push_back(&variable); + checkIoArraysConsistency(loc, true); + } else + fixIoArraySize(loc, variable.getWritableType()); + + // Save it in the AST for linker use. + intermediate.addSymbolLinkageNode(linkage, variable); +} + +// +// "For a block, this process applies to the entire block, or until the first member +// is reached that has a location layout qualifier. When a block member is declared with a location +// qualifier, its location comes from that qualifier: The member's location qualifier overrides the block-level +// declaration. Subsequent members are again assigned consecutive locations, based on the newest location, +// until the next member declared with a location qualifier. The values used for locations do not have to be +// declared in increasing order." +void HlslParseContext::fixBlockLocations(const TSourceLoc& loc, TQualifier& qualifier, TTypeList& typeList, bool memberWithLocation, bool memberWithoutLocation) +{ + // "If a block has no block-level location layout qualifier, it is required that either all or none of its members + // have a location layout qualifier, or a compile-time error results." + if (! qualifier.hasLocation() && memberWithLocation && memberWithoutLocation) + error(loc, "either the block needs a location, or all members need a location, or no members have a location", "location", ""); + else { + if (memberWithLocation) { + // remove any block-level location and make it per *every* member + int nextLocation = 0; // by the rule above, initial value is not relevant + if (qualifier.hasAnyLocation()) { + nextLocation = qualifier.layoutLocation; + qualifier.layoutLocation = TQualifier::layoutLocationEnd; + if (qualifier.hasComponent()) { + // "It is a compile-time error to apply the *component* qualifier to a ... block" + error(loc, "cannot apply to a block", "component", ""); + } + if (qualifier.hasIndex()) { + error(loc, "cannot apply to a block", "index", ""); + } + } + for (unsigned int member = 0; member < typeList.size(); ++member) { + TQualifier& memberQualifier = typeList[member].type->getQualifier(); + const TSourceLoc& memberLoc = typeList[member].loc; + if (! memberQualifier.hasLocation()) { + if (nextLocation >= (int)TQualifier::layoutLocationEnd) + error(memberLoc, "location is too large", "location", ""); + memberQualifier.layoutLocation = nextLocation; + memberQualifier.layoutComponent = 0; + } + nextLocation = memberQualifier.layoutLocation + intermediate.computeTypeLocationSize(*typeList[member].type); + } + } + } +} + +void HlslParseContext::fixBlockXfbOffsets(TQualifier& qualifier, TTypeList& typeList) +{ + // "If a block is qualified with xfb_offset, all its + // members are assigned transform feedback buffer offsets. If a block is not qualified with xfb_offset, any + // members of that block not qualified with an xfb_offset will not be assigned transform feedback buffer + // offsets." + + if (! qualifier.hasXfbBuffer() || ! qualifier.hasXfbOffset()) + return; + + int nextOffset = qualifier.layoutXfbOffset; + for (unsigned int member = 0; member < typeList.size(); ++member) { + TQualifier& memberQualifier = typeList[member].type->getQualifier(); + bool containsDouble = false; + int memberSize = intermediate.computeTypeXfbSize(*typeList[member].type, containsDouble); + // see if we need to auto-assign an offset to this member + if (! memberQualifier.hasXfbOffset()) { + // "if applied to an aggregate containing a double, the offset must also be a multiple of 8" + if (containsDouble) + RoundToPow2(nextOffset, 8); + memberQualifier.layoutXfbOffset = nextOffset; + } else + nextOffset = memberQualifier.layoutXfbOffset; + nextOffset += memberSize; + } + + // The above gave all block members an offset, so we can take it off the block now, + // which will avoid double counting the offset usage. + qualifier.layoutXfbOffset = TQualifier::layoutXfbOffsetEnd; +} + +// Calculate and save the offset of each block member, using the recursively +// defined block offset rules and the user-provided offset and align. +// +// Also, compute and save the total size of the block. For the block's size, arrayness +// is not taken into account, as each element is backed by a separate buffer. +// +void HlslParseContext::fixBlockUniformOffsets(TQualifier& qualifier, TTypeList& typeList) +{ + if (! qualifier.isUniformOrBuffer()) + return; + if (qualifier.layoutPacking != ElpStd140 && qualifier.layoutPacking != ElpStd430) + return; + + int offset = 0; + int memberSize; + for (unsigned int member = 0; member < typeList.size(); ++member) { + TQualifier& memberQualifier = typeList[member].type->getQualifier(); + const TSourceLoc& memberLoc = typeList[member].loc; + + // "When align is applied to an array, it effects only the start of the array, not the array's internal stride." + + // modify just the children's view of matrix layout, if there is one for this member + TLayoutMatrix subMatrixLayout = typeList[member].type->getQualifier().layoutMatrix; + int dummyStride; + int memberAlignment = intermediate.getBaseAlignment(*typeList[member].type, memberSize, dummyStride, qualifier.layoutPacking == ElpStd140, + subMatrixLayout != ElmNone ? subMatrixLayout == ElmRowMajor : qualifier.layoutMatrix == ElmRowMajor); + if (memberQualifier.hasOffset()) { + // "The specified offset must be a multiple + // of the base alignment of the type of the block member it qualifies, or a compile-time error results." + if (! IsMultipleOfPow2(memberQualifier.layoutOffset, memberAlignment)) + error(memberLoc, "must be a multiple of the member's alignment", "offset", ""); + + // "It is a compile-time error to specify an offset that is smaller than the offset of the previous + // member in the block or that lies within the previous member of the block" + if (memberQualifier.layoutOffset < offset) + error(memberLoc, "cannot lie in previous members", "offset", ""); + + // "The offset qualifier forces the qualified member to start at or after the specified + // integral-constant expression, which will be its byte offset from the beginning of the buffer. + // "The actual offset of a member is computed as + // follows: If offset was declared, start with that offset, otherwise start with the next available offset." + offset = std::max(offset, memberQualifier.layoutOffset); + } + + // "The actual alignment of a member will be the greater of the specified align alignment and the standard + // (e.g., std140) base alignment for the member's type." + if (memberQualifier.hasAlign()) + memberAlignment = std::max(memberAlignment, memberQualifier.layoutAlign); + + // "If the resulting offset is not a multiple of the actual alignment, + // increase it to the first offset that is a multiple of + // the actual alignment." + RoundToPow2(offset, memberAlignment); + typeList[member].type->getQualifier().layoutOffset = offset; + offset += memberSize; + } +} + +// For an identifier that is already declared, add more qualification to it. +void HlslParseContext::addQualifierToExisting(const TSourceLoc& loc, TQualifier qualifier, const TString& identifier) +{ + TSymbol* symbol = symbolTable.find(identifier); + if (! symbol) { + error(loc, "identifier not previously declared", identifier.c_str(), ""); + return; + } + if (symbol->getAsFunction()) { + error(loc, "cannot re-qualify a function name", identifier.c_str(), ""); + return; + } + + if (qualifier.isAuxiliary() || + qualifier.isMemory() || + qualifier.isInterpolation() || + qualifier.hasLayout() || + qualifier.storage != EvqTemporary || + qualifier.precision != EpqNone) { + error(loc, "cannot add storage, auxiliary, memory, interpolation, layout, or precision qualifier to an existing variable", identifier.c_str(), ""); + return; + } + + // For read-only built-ins, add a new symbol for holding the modified qualifier. + // This will bring up an entire block, if a block type has to be modified (e.g., gl_Position inside a block) + if (symbol->isReadOnly()) + symbol = symbolTable.copyUp(symbol); + + if (qualifier.invariant) { + if (intermediate.inIoAccessed(identifier)) + error(loc, "cannot change qualification after use", "invariant", ""); + symbol->getWritableType().getQualifier().invariant = true; + } else if (qualifier.noContraction) { + if (intermediate.inIoAccessed(identifier)) + error(loc, "cannot change qualification after use", "precise", ""); + symbol->getWritableType().getQualifier().noContraction = true; + } else if (qualifier.specConstant) { + symbol->getWritableType().getQualifier().makeSpecConstant(); + if (qualifier.hasSpecConstantId()) + symbol->getWritableType().getQualifier().layoutSpecConstantId = qualifier.layoutSpecConstantId; + } else + warn(loc, "unknown requalification", "", ""); +} + +void HlslParseContext::addQualifierToExisting(const TSourceLoc& loc, TQualifier qualifier, TIdentifierList& identifiers) +{ + for (unsigned int i = 0; i < identifiers.size(); ++i) + addQualifierToExisting(loc, qualifier, *identifiers[i]); +} + +// +// Updating default qualifier for the case of a declaration with just a qualifier, +// no type, block, or identifier. +// +void HlslParseContext::updateStandaloneQualifierDefaults(const TSourceLoc& loc, const TPublicType& publicType) +{ + if (publicType.shaderQualifiers.vertices != TQualifier::layoutNotSet) { + assert(language == EShLangTessControl || language == EShLangGeometry); + const char* id = (language == EShLangTessControl) ? "vertices" : "max_vertices"; + + if (language == EShLangTessControl) + checkIoArraysConsistency(loc); + } + if (publicType.shaderQualifiers.invocations != TQualifier::layoutNotSet) { + if (! intermediate.setInvocations(publicType.shaderQualifiers.invocations)) + error(loc, "cannot change previously set layout value", "invocations", ""); + } + if (publicType.shaderQualifiers.geometry != ElgNone) { + if (publicType.qualifier.storage == EvqVaryingIn) { + switch (publicType.shaderQualifiers.geometry) { + case ElgPoints: + case ElgLines: + case ElgLinesAdjacency: + case ElgTriangles: + case ElgTrianglesAdjacency: + case ElgQuads: + case ElgIsolines: + if (intermediate.setInputPrimitive(publicType.shaderQualifiers.geometry)) { + if (language == EShLangGeometry) + checkIoArraysConsistency(loc); + } else + error(loc, "cannot change previously set input primitive", TQualifier::getGeometryString(publicType.shaderQualifiers.geometry), ""); + break; + default: + error(loc, "cannot apply to input", TQualifier::getGeometryString(publicType.shaderQualifiers.geometry), ""); + } + } else if (publicType.qualifier.storage == EvqVaryingOut) { + switch (publicType.shaderQualifiers.geometry) { + case ElgPoints: + case ElgLineStrip: + case ElgTriangleStrip: + if (! intermediate.setOutputPrimitive(publicType.shaderQualifiers.geometry)) + error(loc, "cannot change previously set output primitive", TQualifier::getGeometryString(publicType.shaderQualifiers.geometry), ""); + break; + default: + error(loc, "cannot apply to 'out'", TQualifier::getGeometryString(publicType.shaderQualifiers.geometry), ""); + } + } else + error(loc, "cannot apply to:", TQualifier::getGeometryString(publicType.shaderQualifiers.geometry), GetStorageQualifierString(publicType.qualifier.storage)); + } + if (publicType.shaderQualifiers.spacing != EvsNone) + intermediate.setVertexSpacing(publicType.shaderQualifiers.spacing); + if (publicType.shaderQualifiers.order != EvoNone) + intermediate.setVertexOrder(publicType.shaderQualifiers.order); + if (publicType.shaderQualifiers.pointMode) + intermediate.setPointMode(); + for (int i = 0; i < 3; ++i) { + if (publicType.shaderQualifiers.localSize[i] > 1) { + int max = 0; + switch (i) { + case 0: max = resources.maxComputeWorkGroupSizeX; break; + case 1: max = resources.maxComputeWorkGroupSizeY; break; + case 2: max = resources.maxComputeWorkGroupSizeZ; break; + default: break; + } + if (intermediate.getLocalSize(i) > (unsigned int)max) + error(loc, "too large; see gl_MaxComputeWorkGroupSize", "local_size", ""); + + // Fix the existing constant gl_WorkGroupSize with this new information. + TVariable* workGroupSize = getEditableVariable("gl_WorkGroupSize"); + workGroupSize->getWritableConstArray()[i].setUConst(intermediate.getLocalSize(i)); + } + if (publicType.shaderQualifiers.localSizeSpecId[i] != TQualifier::layoutNotSet) { + intermediate.setLocalSizeSpecId(i, publicType.shaderQualifiers.localSizeSpecId[i]); + // Set the workgroup built-in variable as a specialization constant + TVariable* workGroupSize = getEditableVariable("gl_WorkGroupSize"); + workGroupSize->getWritableType().getQualifier().specConstant = true; + } + } + if (publicType.shaderQualifiers.earlyFragmentTests) + intermediate.setEarlyFragmentTests(); + + const TQualifier& qualifier = publicType.qualifier; + + switch (qualifier.storage) { + case EvqUniform: + if (qualifier.hasMatrix()) + globalUniformDefaults.layoutMatrix = qualifier.layoutMatrix; + if (qualifier.hasPacking()) + globalUniformDefaults.layoutPacking = qualifier.layoutPacking; + break; + case EvqBuffer: + if (qualifier.hasMatrix()) + globalBufferDefaults.layoutMatrix = qualifier.layoutMatrix; + if (qualifier.hasPacking()) + globalBufferDefaults.layoutPacking = qualifier.layoutPacking; + break; + case EvqVaryingIn: + break; + case EvqVaryingOut: + if (qualifier.hasStream()) + globalOutputDefaults.layoutStream = qualifier.layoutStream; + if (qualifier.hasXfbBuffer()) + globalOutputDefaults.layoutXfbBuffer = qualifier.layoutXfbBuffer; + if (globalOutputDefaults.hasXfbBuffer() && qualifier.hasXfbStride()) { + if (! intermediate.setXfbBufferStride(globalOutputDefaults.layoutXfbBuffer, qualifier.layoutXfbStride)) + error(loc, "all stride settings must match for xfb buffer", "xfb_stride", "%d", qualifier.layoutXfbBuffer); + } + break; + default: + error(loc, "default qualifier requires 'uniform', 'buffer', 'in', or 'out' storage qualification", "", ""); + return; + } +} + +// +// Take the sequence of statements that has been built up since the last case/default, +// put it on the list of top-level nodes for the current (inner-most) switch statement, +// and follow that by the case/default we are on now. (See switch topology comment on +// TIntermSwitch.) +// +void HlslParseContext::wrapupSwitchSubsequence(TIntermAggregate* statements, TIntermNode* branchNode) +{ + TIntermSequence* switchSequence = switchSequenceStack.back(); + + if (statements) { + if (switchSequence->size() == 0) + error(statements->getLoc(), "cannot have statements before first case/default label", "switch", ""); + statements->setOperator(EOpSequence); + switchSequence->push_back(statements); + } + if (branchNode) { + // check all previous cases for the same label (or both are 'default') + for (unsigned int s = 0; s < switchSequence->size(); ++s) { + TIntermBranch* prevBranch = (*switchSequence)[s]->getAsBranchNode(); + if (prevBranch) { + TIntermTyped* prevExpression = prevBranch->getExpression(); + TIntermTyped* newExpression = branchNode->getAsBranchNode()->getExpression(); + if (prevExpression == nullptr && newExpression == nullptr) + error(branchNode->getLoc(), "duplicate label", "default", ""); + else if (prevExpression != nullptr && + newExpression != nullptr && + prevExpression->getAsConstantUnion() && + newExpression->getAsConstantUnion() && + prevExpression->getAsConstantUnion()->getConstArray()[0].getIConst() == + newExpression->getAsConstantUnion()->getConstArray()[0].getIConst()) + error(branchNode->getLoc(), "duplicated value", "case", ""); + } + } + switchSequence->push_back(branchNode); + } +} + +// +// Turn the top-level node sequence built up of wrapupSwitchSubsequence +// into a switch node. +// +TIntermNode* HlslParseContext::addSwitch(const TSourceLoc& loc, TIntermTyped* expression, TIntermAggregate* lastStatements) +{ + wrapupSwitchSubsequence(lastStatements, nullptr); + + if (expression == nullptr || + (expression->getBasicType() != EbtInt && expression->getBasicType() != EbtUint) || + expression->getType().isArray() || expression->getType().isMatrix() || expression->getType().isVector()) + error(loc, "condition must be a scalar integer expression", "switch", ""); + + // If there is nothing to do, drop the switch but still execute the expression + TIntermSequence* switchSequence = switchSequenceStack.back(); + if (switchSequence->size() == 0) + return expression; + + if (lastStatements == nullptr) { + // emulate a break for error recovery + lastStatements = intermediate.makeAggregate(intermediate.addBranch(EOpBreak, loc)); + lastStatements->setOperator(EOpSequence); + switchSequence->push_back(lastStatements); + } + + TIntermAggregate* body = new TIntermAggregate(EOpSequence); + body->getSequence() = *switchSequenceStack.back(); + body->setLoc(loc); + + TIntermSwitch* switchNode = new TIntermSwitch(expression, body); + switchNode->setLoc(loc); + + return switchNode; +} + +} // end namespace glslang diff --git a/hlsl/hlslParseHelper.h b/hlsl/hlslParseHelper.h new file mode 100755 index 00000000..6f920d8c --- /dev/null +++ b/hlsl/hlslParseHelper.h @@ -0,0 +1,229 @@ +// +//Copyright (C) 2016 Google, Inc. +// +//All rights reserved. +// +//Redistribution and use in source and binary forms, with or without +//modification, are permitted provided that the following conditions +//are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +//POSSIBILITY OF SUCH DAMAGE. +// +#ifndef HLSL_PARSE_INCLUDED_ +#define HLSL_PARSE_INCLUDED_ + +#include "../glslang/MachineIndependent/parseVersions.h" +#include "../glslang/MachineIndependent/ParseHelper.h" + +namespace glslang { + +class HlslParseContext : public TParseContextBase { +public: + HlslParseContext(TSymbolTable&, TIntermediate&, bool parsingBuiltins, + int version, EProfile, int spv, int vulkan, EShLanguage, TInfoSink&, + bool forwardCompatible = false, EShMessages messages = EShMsgDefault); + virtual ~HlslParseContext(); + void setLimits(const TBuiltInResource&); + bool parseShaderStrings(TPpContext&, TInputScanner& input, bool versionWillBeError = false); + void getPreamble(std::string&); + + void C_DECL error(const TSourceLoc&, const char* szReason, const char* szToken, + const char* szExtraInfoFormat, ...); + void C_DECL warn(const TSourceLoc&, const char* szReason, const char* szToken, + const char* szExtraInfoFormat, ...); + void C_DECL ppError(const TSourceLoc&, const char* szReason, const char* szToken, + const char* szExtraInfoFormat, ...); + void C_DECL ppWarn(const TSourceLoc&, const char* szReason, const char* szToken, + const char* szExtraInfoFormat, ...); + + void reservedPpErrorCheck(const TSourceLoc&, const char* name, const char* op) { } + bool lineContinuationCheck(const TSourceLoc&, bool endOfComment) { return true; } + bool lineDirectiveShouldSetNextLine() const { return true; } + bool builtInName(const TString&); + + void handlePragma(const TSourceLoc&, const TVector&); + TIntermTyped* handleVariable(const TSourceLoc&, TSymbol* symbol, const TString* string); + TIntermTyped* handleBracketDereference(const TSourceLoc&, TIntermTyped* base, TIntermTyped* index); + void checkIndex(const TSourceLoc&, const TType&, int& index); + + void makeEditable(TSymbol*&); + TVariable* getEditableVariable(const char* name); + bool isIoResizeArray(const TType&) const; + void fixIoArraySize(const TSourceLoc&, TType&); + void handleIoResizeArrayAccess(const TSourceLoc&, TIntermTyped* base); + void checkIoArraysConsistency(const TSourceLoc&, bool tailOnly = false); + int getIoArrayImplicitSize() const; + void checkIoArrayConsistency(const TSourceLoc&, int requiredSize, const char* feature, TType&, const TString&); + + TIntermTyped* handleBinaryMath(const TSourceLoc&, const char* str, TOperator op, TIntermTyped* left, TIntermTyped* right); + TIntermTyped* handleUnaryMath(const TSourceLoc&, const char* str, TOperator op, TIntermTyped* childNode); + TIntermTyped* handleDotDereference(const TSourceLoc&, TIntermTyped* base, const TString& field); + TFunction* handleFunctionDeclarator(const TSourceLoc&, TFunction& function, bool prototype); + TIntermAggregate* handleFunctionDefinition(const TSourceLoc&, TFunction&); + void handleFunctionArgument(TFunction*, TIntermTyped*& arguments, TIntermTyped* newArg); + TIntermTyped* handleFunctionCall(const TSourceLoc&, TFunction*, TIntermNode*); + TIntermTyped* handleLengthMethod(const TSourceLoc&, TFunction*, TIntermNode*); + void addInputArgumentConversions(const TFunction&, TIntermNode*&) const; + TIntermTyped* addOutputArgumentConversions(const TFunction&, TIntermAggregate&) const; + void builtInOpCheck(const TSourceLoc&, const TFunction&, TIntermOperator&); + TFunction* handleConstructorCall(const TSourceLoc&, const TType&); + + bool parseVectorFields(const TSourceLoc&, const TString&, int vecSize, TVectorFields&); + void assignError(const TSourceLoc&, const char* op, TString left, TString right); + void unaryOpError(const TSourceLoc&, const char* op, TString operand); + void binaryOpError(const TSourceLoc&, const char* op, TString left, TString right); + void variableCheck(TIntermTyped*& nodePtr); + void constantValueCheck(TIntermTyped* node, const char* token); + void integerCheck(const TIntermTyped* node, const char* token); + void globalCheck(const TSourceLoc&, const char* token); + bool constructorError(const TSourceLoc&, TIntermNode*, TFunction&, TOperator, TType&); + bool constructorTextureSamplerError(const TSourceLoc&, const TFunction&); + void arraySizeCheck(const TSourceLoc&, TIntermTyped* expr, TArraySize&); + void arraySizeRequiredCheck(const TSourceLoc&, const TArraySizes&); + void structArrayCheck(const TSourceLoc&, const TType& structure); + void arrayDimMerge(TType& type, const TArraySizes* sizes); + bool voidErrorCheck(const TSourceLoc&, const TString&, TBasicType); + void boolCheck(const TSourceLoc&, const TIntermTyped*); + void globalQualifierFix(const TSourceLoc&, TQualifier&); + bool structQualifierErrorCheck(const TSourceLoc&, const TPublicType& pType); + void mergeQualifiers(const TSourceLoc&, TQualifier& dst, const TQualifier& src, bool force); + int computeSamplerTypeIndex(TSampler&); + TSymbol* redeclareBuiltinVariable(const TSourceLoc&, const TString&, const TQualifier&, const TShaderQualifiers&, bool& newDeclaration); + void redeclareBuiltinBlock(const TSourceLoc&, TTypeList& typeList, const TString& blockName, const TString* instanceName, TArraySizes* arraySizes); + void paramCheckFix(const TSourceLoc&, const TStorageQualifier&, TType& type); + void paramCheckFix(const TSourceLoc&, const TQualifier&, TType& type); + void specializationCheck(const TSourceLoc&, const TType&, const char* op); + + void setLayoutQualifier(const TSourceLoc&, TPublicType&, TString&); + void setLayoutQualifier(const TSourceLoc&, TPublicType&, TString&, const TIntermTyped*); + void mergeObjectLayoutQualifiers(TQualifier& dest, const TQualifier& src, bool inheritOnly); + void checkNoShaderLayouts(const TSourceLoc&, const TShaderQualifiers&); + + const TFunction* findFunction(const TSourceLoc& loc, const TFunction& call, bool& builtIn); + TIntermNode* declareVariable(const TSourceLoc&, TString& identifier, const TType&, TArraySizes* typeArray = 0, TIntermTyped* initializer = 0); + TIntermTyped* addConstructor(const TSourceLoc&, TIntermNode*, const TType&, TOperator); + TIntermTyped* constructAggregate(TIntermNode*, const TType&, int, const TSourceLoc&); + TIntermTyped* constructBuiltIn(const TType&, TOperator, TIntermTyped*, const TSourceLoc&, bool subset); + void declareBlock(const TSourceLoc&, TTypeList& typeList, const TString* instanceName = 0, TArraySizes* arraySizes = 0); + void fixBlockLocations(const TSourceLoc&, TQualifier&, TTypeList&, bool memberWithLocation, bool memberWithoutLocation); + void fixBlockXfbOffsets(TQualifier&, TTypeList&); + void fixBlockUniformOffsets(TQualifier&, TTypeList&); + void addQualifierToExisting(const TSourceLoc&, TQualifier, const TString& identifier); + void addQualifierToExisting(const TSourceLoc&, TQualifier, TIdentifierList&); + void updateStandaloneQualifierDefaults(const TSourceLoc&, const TPublicType&); + void wrapupSwitchSubsequence(TIntermAggregate* statements, TIntermNode* branchNode); + TIntermNode* addSwitch(const TSourceLoc&, TIntermTyped* expression, TIntermAggregate* body); + + void updateImplicitArraySize(const TSourceLoc&, TIntermNode*, int index); + + void nestStatement() { ++statementNestingLevel; } + void unnestStatement() { --statementNestingLevel; } + void nestLooping() { ++loopNestingLevel; } + void unnestLooping() { --loopNestingLevel; } + void pushScope() { symbolTable.push(); } + void popScope() { symbolTable.pop(0); } + +protected: + void inheritGlobalDefaults(TQualifier& dst) const; + TVariable* makeInternalVariable(const char* name, const TType&) const; + TVariable* declareNonArray(const TSourceLoc&, TString& identifier, TType&, bool& newDeclaration); + void declareArray(const TSourceLoc&, TString& identifier, const TType&, TSymbol*&, bool& newDeclaration); + TIntermNode* executeInitializer(const TSourceLoc&, TIntermTyped* initializer, TVariable* variable); + TIntermTyped* convertInitializerList(const TSourceLoc&, const TType&, TIntermTyped* initializer); + TOperator mapTypeToConstructorOp(const TType&) const; + void outputMessage(const TSourceLoc&, const char* szReason, const char* szToken, + const char* szExtraInfoFormat, TPrefixType prefix, + va_list args); + + // Current state of parsing + struct TPragma contextPragma; + int loopNestingLevel; // 0 if outside all loops + int structNestingLevel; // 0 if outside blocks and structures + int controlFlowNestingLevel; // 0 if outside all flow control + int statementNestingLevel; // 0 if outside all flow control or compound statements + TList switchSequenceStack; // case, node, case, case, node, ...; ensure only one node between cases; stack of them for nesting + TList switchLevel; // the statementNestingLevel the current switch statement is at, which must match the level of its case statements + bool inEntrypoint; // if inside a function, true if the function is the entry point + bool postMainReturn; // if inside a function, true if the function is the entry point and this is after a return statement + const TType* currentFunctionType; // the return type of the function that's currently being parsed + bool functionReturnsValue; // true if a non-void function has a return + const TString* blockName; + TQualifier currentBlockQualifier; + TBuiltInResource resources; + TLimits& limits; + + HlslParseContext(HlslParseContext&); + HlslParseContext& operator=(HlslParseContext&); + + TMap extensionBehavior; // for each extension string, what its current behavior is set to + static const int maxSamplerIndex = EsdNumDims * (EbtNumTypes * (2 * 2 * 2)); // see computeSamplerTypeIndex() + bool afterEOF; + TQualifier globalBufferDefaults; + TQualifier globalUniformDefaults; + TQualifier globalInputDefaults; + TQualifier globalOutputDefaults; + TString currentCaller; // name of last function body entered (not valid when at global scope) + TIdSetType inductiveLoopIds; + TVector needsIndexLimitationChecking; + + // + // Geometry shader input arrays: + // - array sizing is based on input primitive and/or explicit size + // + // Tessellation control output arrays: + // - array sizing is based on output layout(vertices=...) and/or explicit size + // + // Both: + // - array sizing is retroactive + // - built-in block redeclarations interact with this + // + // Design: + // - use a per-context "resize-list", a list of symbols whose array sizes + // can be fixed + // + // - the resize-list starts empty at beginning of user-shader compilation, it does + // not have built-ins in it + // + // - on built-in array use: copyUp() symbol and add it to the resize-list + // + // - on user array declaration: add it to the resize-list + // + // - on block redeclaration: copyUp() symbol and add it to the resize-list + // * note, that appropriately gives an error if redeclaring a block that + // was already used and hence already copied-up + // + // - on seeing a layout declaration that sizes the array, fix everything in the + // resize-list, giving errors for mismatch + // + // - on seeing an array size declaration, give errors on mismatch between it and previous + // array-sizing declarations + // + TVector ioArraySymbolResizeList; +}; + +} // end namespace glslang + +#endif // HLSL_PARSE_INCLUDED_ diff --git a/hlsl/hlslParseables.cpp b/hlsl/hlslParseables.cpp new file mode 100755 index 00000000..18f7ca4a --- /dev/null +++ b/hlsl/hlslParseables.cpp @@ -0,0 +1,662 @@ +// +//Copyright (C) 2016 LunarG, Inc. +// +//All rights reserved. +// +//Redistribution and use in source and binary forms, with or without +//modification, are permitted provided that the following conditions +//are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +//POSSIBILITY OF SUCH DAMAGE. +// + +// +// Create strings that declare built-in definitions, add built-ins programmatically +// that cannot be expressed in the strings, and establish mappings between +// built-in functions and operators. +// +// Where to put a built-in: +// TBuiltInParseablesHlsl::initialize(version,profile) context-independent textual built-ins; add them to the right string +// TBuiltInParseablesHlsl::initialize(resources,...) context-dependent textual built-ins; add them to the right string +// TBuiltInParseablesHlsl::identifyBuiltIns(...,symbolTable) context-independent programmatic additions/mappings to the symbol table, +// including identifying what extensions are needed if a version does not allow a symbol +// TBuiltInParseablesHlsl::identifyBuiltIns(...,symbolTable, resources) context-dependent programmatic additions/mappings to the +// symbol table, including identifying what extensions are needed if a version does +// not allow a symbol +// + +#include "hlslParseables.h" +#include +#include + +namespace { // anonymous namespace functions + +const char* BaseTypeName(const char* argOrder, const char* scalarName, const char* vecName, const char* matName) +{ + switch (*argOrder) { + case 'S': return scalarName; + case 'V': return vecName; + case 'M': return matName; + default: return "UNKNOWN_TYPE"; + } +} + +// Create and return a type name. This is done in GLSL, not HLSL conventions, until such +// time as builtins are parsed using the HLSL parser. +// +// order: S = scalar, V = vector, M = matrix +// argType: F = float, D = double, I = int, U = uint, B = bool, S = sampler +// dim0 = vector dimension, or matrix 1st dimension +// dim1 = matrix 2nd dimension +glslang::TString& AppendTypeName(glslang::TString& s, const char* argOrder, const char* argType, int dim0, int dim1) +{ + const bool transpose = (argOrder[0] == '^'); + + // Take transpose of matrix dimensions + if (transpose) { + std::swap(dim0, dim1); + ++argOrder; + } + + switch (*argType) { + case '-': s += "void"; break; + case 'F': s += BaseTypeName(argOrder, "float", "vec", "mat"); break; + case 'D': s += BaseTypeName(argOrder, "double", "dvec", "dmat"); break; + case 'I': s += BaseTypeName(argOrder, "int", "ivec", "imat"); break; + case 'U': s += BaseTypeName(argOrder, "uint", "uvec", "umat"); break; + case 'B': s += BaseTypeName(argOrder, "bool", "bvec", "bmat"); break; + case 'S': s += BaseTypeName(argOrder, "sampler", "sampler", "sampler"); break; // TODO: + default: s += "UNKNOWN_TYPE"; break; + } + + // handle fixed vector sizes, such as float3, and only ever 3. + const int fixedVecSize = isdigit(argOrder[1]) ? (argOrder[1] - '0') : 0; + if (fixedVecSize != 0) + dim0 = dim1 = fixedVecSize; + + // Add sampler dimensions + if (*argType == 'S') { + switch (dim0) { + case 1: s += "1D"; break; + case 2: s += "2D"; break; + case 3: s += "3D"; break; + case 4: s += "Cube"; break; + default: s += "UNKNOWN_SAMPLER"; break; + } + } + + // verify dimensions + if ((*argOrder == 'V' || *argOrder == 'M') && (dim0 < 1 || dim0 > 4) || + (*argOrder == 'M' && (dim1 < 1 || dim1 > 4))) { + s += "UNKNOWN_DIMENSION"; + return s; + } + + switch (*argOrder) { + case '-': break; // no dimensions for voids + case 'S': break; // no dimensions on scalars + case 'V': s += ('0' + dim0); break; + case 'M': s += ('0' + dim0); s += 'x'; s += ('0' + dim1); break; + } + + return s; +} + +// TODO: the GLSL parser is currently used to parse HLSL prototypes. However, many valid HLSL prototypes +// are not valid GLSL prototypes. This rejects the invalid ones. Thus, there is a single switch below +// to enable creation of the entire HLSL space. +inline bool IsValidGlsl(const char* cname, char retOrder, char retType, char argOrder, char argType, + int dim0, int dim1, int dim0Max, int dim1Max) +{ + const bool isVec = dim0Max > 1 || argType == 'V'; + const bool isMat = dim1Max > 1 || argType == 'M'; + + if (argType == 'D' || // avoid double args + retType == 'D' || // avoid double return + (isVec && dim0 == 1) || // avoid vec1 + (isMat && dim0 == 1 && dim1 == 1)) // avoid mat1x1 + return false; + + const std::string name(cname); // for ease of comparison. slow, but temporary, until HLSL parser is online. + + if (isMat && dim0 != dim1) // TODO: avoid mats until we find the right GLSL profile + return false; + + if (isMat && (argType == 'I' || argType == 'U' || argType == 'B') || + retOrder == 'M' && (retType == 'I' || retType == 'U' || retType == 'B')) + return false; + + if (name == "GetRenderTargetSamplePosition" || + name == "tex1D" || + name == "tex1Dgrad") + return false; + + return true; +} + + +// Return true for the end of a single argument key, which can be the end of the string, or +// the comma separator. +inline bool IsEndOfArg(const char* arg) +{ + return arg == nullptr || *arg == '\0' || *arg == ','; +} + + +// return position of end of argument specifier +inline const char* FindEndOfArg(const char* arg) +{ + while (!IsEndOfArg(arg)) + ++arg; + + return *arg == '\0' ? nullptr : arg; +} + + +// Return pointer to beginning of Nth argument specifier in the string. +inline const char* NthArg(const char* arg, int n) +{ + for (int x=0; x 0) // handle fixed sized vectors + dim0Min = dim0Max = fixedVecSize; +} + +} // end anonymous namespace + +namespace glslang { + +TBuiltInParseablesHlsl::TBuiltInParseablesHlsl() +{ +} + +// +// Add all context-independent built-in functions and variables that are present +// for the given version and profile. Share common ones across stages, otherwise +// make stage-specific entries. +// +// Most built-ins variables can be added as simple text strings. Some need to +// be added programmatically, which is done later in IdentifyBuiltIns() below. +// +void TBuiltInParseablesHlsl::initialize(int version, EProfile profile, int spv, int vulkan) +{ + static const EShLanguageMask EShLangAll = EShLanguageMask(EShLangCount - 1); + + // This structure encodes the prototype information for each HLSL intrinsic. + // Because explicit enumeration would be cumbersome, it's procedurally generated. + // orderKey can be: + // S = scalar, V = vector, M = matrix, - = void + // typekey can be: + // D = double, F = float, U = uint, I = int, B = bool, S = sampler, - = void + // An empty order or type key repeats the first one. E.g: SVM,, means 3 args each of SVM. + // '>' as first letter of order creates an output paremeter + // '<' as first letter of order creates an input paremeter + // '^' as first letter of order takes transpose dimensions + + static const struct { + const char* name; // intrinsic name + const char* retOrder; // return type key: empty matches order of 1st argument + const char* retType; // return type key: empty matches type of 1st argument + const char* argOrder; // argument order key + const char* argType; // argument type key + unsigned int stage; // stage mask + } hlslIntrinsics[] = { + // name retOrd retType argOrder argType stage mask + // ----------------------------------------------------------------------------------------------- + { "abort", nullptr, nullptr, "-", "-", EShLangAll }, + { "abs", nullptr, nullptr, "SVM", "DFUI", EShLangAll }, + { "acos", nullptr, nullptr, "SVM", "F", EShLangAll }, + { "all", "S", "B", "SVM", "BFI", EShLangAll }, + { "AllMemoryBarrier", nullptr, nullptr, "-", "-", EShLangComputeMask }, + { "AllMemoryBarrierWithGroupSync", nullptr, nullptr, "-", "-", EShLangComputeMask }, + { "any", "S", "B", "SVM", "BFI", EShLangAll }, + { "asdouble", "S", "D", "S,", "U,", EShLangAll }, + { "asdouble", "V2", "D", "V2,", "U,", EShLangAll }, + { "asfloat", nullptr, "F", "SVM", "BFIU", EShLangAll }, + { "asin", nullptr, nullptr, "SVM", "F", EShLangAll }, + { "asint", nullptr, "I", "SVM", "FU", EShLangAll }, + { "asuint", nullptr, "U", "SVM", "FU", EShLangAll }, + { "atan", nullptr, nullptr, "SVM", "F", EShLangAll }, + { "atan2", nullptr, nullptr, "SVM,", "F,", EShLangAll }, + { "ceil", nullptr, nullptr, "SVM", "F", EShLangAll }, + { "CheckAccessFullyMapped", "S", "B" , "S", "U", EShLangFragmentMask | EShLangComputeMask }, + { "clamp", nullptr, nullptr, "SVM,,", "FUI,,", EShLangAll }, + { "clip", "-", "-", "SVM", "F", EShLangFragmentMask }, + { "cos", nullptr, nullptr, "SVM", "F", EShLangAll }, + { "cosh", nullptr, nullptr, "SVM", "F", EShLangAll }, + { "countbits", nullptr, nullptr, "SV", "U", EShLangAll }, + { "cross", nullptr, nullptr, "V3,", "F,", EShLangAll }, + { "D3DCOLORtoUBYTE4", "V4", "I", "V4", "F", EShLangAll }, + { "ddx", nullptr, nullptr, "SVM", "F", EShLangFragmentMask }, + { "ddx_coarse", nullptr, nullptr, "SVM", "F", EShLangFragmentMask }, + { "ddx_fine", nullptr, nullptr, "SVM", "F", EShLangFragmentMask }, + { "ddy", nullptr, nullptr, "SVM", "F", EShLangFragmentMask }, + { "ddy_coarse", nullptr, nullptr, "SVM", "F", EShLangFragmentMask }, + { "ddy_fine", nullptr, nullptr, "SVM", "F", EShLangFragmentMask }, + { "degrees", nullptr, nullptr, "SVM", "F", EShLangAll }, + { "determinant", "S", "F", "M", "F", EShLangAll }, + { "DeviceMemoryBarrier", nullptr, nullptr, "-", "-", EShLangFragmentMask | EShLangComputeMask }, + { "DeviceMemoryBarrierWithGroupSync", nullptr, nullptr, "-", "-", EShLangComputeMask }, + { "distance", "S", "F", "V,", "F,", EShLangAll }, + { "dot", "S", nullptr, "V,", "FI,", EShLangAll }, + { "dst", nullptr, nullptr, "V,", "F,", EShLangAll }, + // { "errorf", "-", "-", "", "", EShLangAll }, TODO: varargs + { "EvaluateAttributeAtCentroid", nullptr, nullptr, "SVM", "F", EShLangFragmentMask }, + { "EvaluateAttributeAtSample", nullptr, nullptr, "SVM,S", "F,U", EShLangFragmentMask }, + { "EvaluateAttributeSnapped", nullptr, nullptr, "SVM,V2", "F,F", EShLangFragmentMask }, + { "exp", nullptr, nullptr, "SVM", "F", EShLangAll }, + { "exp2", nullptr, nullptr, "SVM", "F", EShLangAll }, + { "f16tof32", nullptr, "F", "SV", "U", EShLangAll }, + { "f32tof16", nullptr, "U", "SV", "F", EShLangAll }, + { "faceforward", nullptr, nullptr, "V,,", "F,,", EShLangAll }, + { "firstbithigh", nullptr, nullptr, "SV", "UI", EShLangAll }, + { "firstbitlow", nullptr, nullptr, "SV", "UI", EShLangAll }, + { "floor", nullptr, nullptr, "SVM", "F", EShLangAll }, + { "fma", nullptr, nullptr, "SVM,,", "D,,", EShLangAll }, + { "fmod", nullptr, nullptr, "SVM,", "F,", EShLangAll }, + { "frac", nullptr, nullptr, "SVM", "F", EShLangAll }, + { "frexp", nullptr, nullptr, "SVM,", "F,", EShLangAll }, + { "fwidth", nullptr, nullptr, "SVM", "F", EShLangAll }, + { "GetRenderTargetSampleCount", "S", "U", "-", "-", EShLangAll }, + { "GetRenderTargetSamplePosition", "V2", "F", "V1", "I", EShLangAll }, + { "GroupMemoryBarrier", nullptr, nullptr, "-", "-", EShLangComputeMask }, + { "GroupMemoryBarrierWithGroupSync", nullptr, nullptr, "-", "-", EShLangComputeMask }, + { "InterlockedAdd", "-", "-", "SVM,,>", "UI,,", EShLangFragmentMask | EShLangComputeMask }, + { "InterlockedAnd", "-", "-", "SVM,,>", "UI,,", EShLangFragmentMask | EShLangComputeMask }, + { "InterlockedCompareExchange", "-", "-", "SVM,,,>", "UI,,,", EShLangFragmentMask | EShLangComputeMask }, + { "InterlockedCompareStore", "-", "-", "SVM,,", "UI,,", EShLangFragmentMask | EShLangComputeMask }, + { "InterlockedExchange", "-", "-", "SVM,,>", "UI,,", EShLangFragmentMask | EShLangComputeMask }, + { "InterlockedMax", "-", "-", "SVM,,>", "UI,,", EShLangFragmentMask | EShLangComputeMask }, + { "InterlockedMin", "-", "-", "SVM,,>", "UI,,", EShLangFragmentMask | EShLangComputeMask }, + { "InterlockedOr", "-", "-", "SVM,,>", "UI,,", EShLangFragmentMask | EShLangComputeMask }, + { "InterlockedXor", "-", "-", "SVM,,>", "UI,,", EShLangFragmentMask | EShLangComputeMask }, + { "isfinite", nullptr, "B" , "SVM", "F", EShLangAll }, + { "isinf", nullptr, "B" , "SVM", "F", EShLangAll }, + { "isnan", nullptr, "B" , "SVM", "F", EShLangAll }, + { "ldexp", nullptr, nullptr, "SVM,", "F,", EShLangAll }, + { "length", "S", "F", "V", "F", EShLangAll }, + { "lit", "V4", "F", "S,,", "F,,", EShLangAll }, + { "log", nullptr, nullptr, "SVM", "F", EShLangAll }, + { "log10", nullptr, nullptr, "SVM", "F", EShLangAll }, + { "log2", nullptr, nullptr, "SVM", "F", EShLangAll }, + { "mad", nullptr, nullptr, "SVM,,", "DFUI,,", EShLangAll }, + { "max", nullptr, nullptr, "SVM,", "FI,", EShLangAll }, + { "min", nullptr, nullptr, "SVM,", "FI,", EShLangAll }, + { "modf", nullptr, nullptr, "SVM,>", "FI,", EShLangAll }, + { "msad4", "V4", "U", "S,V2,V4", "U,,", EShLangAll }, + { "mul", "S", nullptr, "S,S", "FI,", EShLangAll }, + { "mul", "V", nullptr, "S,V", "FI,", EShLangAll }, + { "mul", "M", nullptr, "S,M", "FI,", EShLangAll }, + { "mul", "V", nullptr, "V,S", "FI,", EShLangAll }, + { "mul", "S", nullptr, "V,V", "FI,", EShLangAll }, + { "mul", "V", nullptr, "V,M", "FI,", EShLangAll }, + { "mul", "M", nullptr, "M,S", "FI,", EShLangAll }, + { "mul", "V", nullptr, "M,V", "FI,", EShLangAll }, + { "mul", "M", nullptr, "M,M", "FI,", EShLangAll }, + { "noise", "S", "F", "V", "F", EShLangFragmentMask }, + { "normalize", nullptr, nullptr, "V", "F", EShLangAll }, + { "pow", nullptr, nullptr, "SVM,", "F,", EShLangAll }, + // { "printf", "-", "-", "", "", EShLangAll }, TODO: varargs + { "Process2DQuadTessFactorsAvg", "-", "-", "V4,V2,>V4,>V2,>V2", "F,,,,", EShLangTessControlMask }, + { "Process2DQuadTessFactorsMax", "-", "-", "V4,V2,>V4,>V2,>V2", "F,,,,", EShLangTessControlMask }, + { "Process2DQuadTessFactorsMin", "-", "-", "V4,V2,>V4,>V2,>V2", "F,,,,", EShLangTessControlMask }, + { "ProcessIsolineTessFactors", "-", "-", "S,,>,>", "F,,,", EShLangTessControlMask }, + { "ProcessQuadTessFactorsAvg", "-", "-", "V4,S,>V4,>V2,>V2", "F,,,,", EShLangTessControlMask }, + { "ProcessQuadTessFactorsMax", "-", "-", "V4,S,>V4,>V2,>V2", "F,,,,", EShLangTessControlMask }, + { "ProcessQuadTessFactorsMin", "-", "-", "V4,S,>V4,>V2,>V2", "F,,,,", EShLangTessControlMask }, + { "ProcessTriTessFactorsAvg", "-", "-", "V3,S,>V3,>S,>S", "F,,,,", EShLangTessControlMask }, + { "ProcessTriTessFactorsMax", "-", "-", "V3,S,>V3,>S,>S", "F,,,,", EShLangTessControlMask }, + { "ProcessTriTessFactorsMin", "-", "-", "V3,S,>V3,>S,>S", "F,,,,", EShLangTessControlMask }, + { "radians", nullptr, nullptr, "SVM", "F", EShLangAll }, + { "rcp", nullptr, nullptr, "SVM", "FD", EShLangAll }, + { "reflect", nullptr, nullptr, "V,", "F,", EShLangAll }, + { "refract", nullptr, nullptr, "V,V,S", "F,,", EShLangAll }, + { "reversebits", nullptr, nullptr, "SV", "U", EShLangAll }, + { "round", nullptr, nullptr, "SVM", "F", EShLangAll }, + { "rsqrt", nullptr, nullptr, "SVM", "F", EShLangAll }, + { "saturate", nullptr, nullptr , "SVM", "F", EShLangAll }, + { "sign", nullptr, nullptr, "SVM", "FI", EShLangAll }, + { "sin", nullptr, nullptr, "SVM", "F", EShLangAll }, + { "sincos", "-", "-", "SVM,>,>", "F,,", EShLangAll }, + { "sinh", nullptr, nullptr, "SVM", "F", EShLangAll }, + { "smoothstep", nullptr, nullptr, "SVM,,", "F,,", EShLangAll }, + { "sqrt", nullptr, nullptr, "SVM", "F", EShLangAll }, + { "step", nullptr, nullptr, "SVM,", "F,", EShLangAll }, + { "tan", nullptr, nullptr, "SVM", "F", EShLangAll }, + { "tanh", nullptr, nullptr, "SVM", "F", EShLangAll }, + { "tex1D", "V4", "F", "S1,S", "S,F", EShLangFragmentMask }, + { "tex1D", "V4", "F", "S1,S,V1,V1", "S,F,F,F",EShLangFragmentMask }, + { "tex1Dbias", "V4", "F", "S1,V4", "S,F", EShLangFragmentMask }, + { "tex1Dgrad", "V4", "F", "S1,V1,V1,V1","S,F,F,F",EShLangFragmentMask }, + { "tex1Dlod", "V4", "F", "S1,V4", "S,F", EShLangFragmentMask }, + { "tex1Dproj", "V4", "F", "S1,V4", "S,F", EShLangFragmentMask }, + { "tex2D", "V4", "F", "S2,V2", "S,F", EShLangFragmentMask }, + { "tex2D", "V4", "F", "S2,V2,V2,V2","S,F,F,F",EShLangFragmentMask }, + { "tex2Dbias", "V4", "F", "S2,V4", "S,F", EShLangFragmentMask }, + { "tex2Dgrad", "V4", "F", "S2,V2,V2,V2","S,F,F,F",EShLangFragmentMask }, + { "tex2Dlod", "V4", "F", "S2,V4", "S,F", EShLangFragmentMask }, + { "tex2Dproj", "V4", "F", "S2,V4", "S,F", EShLangFragmentMask }, + { "tex3D", "V4", "F", "S3,V3", "S,F", EShLangFragmentMask }, + { "tex3D", "V4", "F", "S3,V3,V3,V3","S,F,F,F",EShLangFragmentMask }, + { "tex3Dbias", "V4", "F", "S3,V4", "S,F", EShLangFragmentMask }, + { "tex3Dgrad", "V4", "F", "S3,V3,V3,V3","S,F,F,F",EShLangFragmentMask }, + { "tex3Dlod", "V4", "F", "S3,V4", "S,F", EShLangFragmentMask }, + { "tex3Dproj", "V4", "F", "S3,V4", "S,F", EShLangFragmentMask }, + { "texCUBE", "V4", "F", "S4,V3", "S,F", EShLangFragmentMask }, + { "texCUBE", "V4", "F", "S4,V3,V3,V3","S,F,F,F",EShLangFragmentMask }, + { "texCUBEbias", "V4", "F", "S4,V4", "S,F", EShLangFragmentMask }, + { "texCUBEgrad", "V4", "F", "S4,V3,V3,V3","S,F,F,F",EShLangFragmentMask }, + { "texCUBElod", "V4", "F", "S4,V4", "S,F", EShLangFragmentMask }, + { "texCUBEproj", "V4", "F", "S4,V4", "S,F", EShLangFragmentMask }, + { "transpose", "^M", nullptr, "M", "F", EShLangAll }, + { "trunc", nullptr, nullptr, "SVM", "F", EShLangAll }, + + // Mark end of list, since we want to avoid a range-based for, as some compilers don't handle it yet. + { nullptr, nullptr, nullptr, nullptr, nullptr, 0 }, + }; + + // Set this to true to avoid generating prototypes that will be invalid for the GLSL parser. + // TODO: turn it off (and remove the code) when the HLSL parser can be used to parse builtins. + static const bool skipInvalidGlsl = true; + + // Create prototypes for the intrinsics. TODO: Avoid ranged based for until all compilers can handle it. + for (int icount = 0; hlslIntrinsics[icount].name; ++icount) { + const auto& intrinsic = hlslIntrinsics[icount]; + + for (int stage = 0; stage < EShLangCount; ++stage) { // for each stage... + if ((intrinsic.stage & (1< 0 ? ", ": ""); // comma separator if needed + + if (*nthArgOrder == '>') { // output params + ++nthArgOrder; + s.append("out "); + } else if (*nthArgOrder == '<') { // input params + ++nthArgOrder; + s.append("in "); + } + + // Comma means use the 1st argument order and type. + if (*nthArgOrder == ',' || *nthArgOrder == '\0') nthArgOrder = argOrder; + if (*nthArgType == ',' || *nthArgType == '\0') nthArgType = argType; + + AppendTypeName(s, nthArgOrder, nthArgType, dim0, dim1); // Add first argument + } + + s.append(");\n"); // close paren and trailing semicolon + } + } + } + + if (fixedVecSize > 0) // skip over number for fixed size vectors + ++argOrder; + } + + if (intrinsic.stage == EShLangAll) // common builtins are only added once. + break; + } + } + + // printf("Common:\n%s\n", getCommonString().c_str()); + // printf("Frag:\n%s\n", getStageString(EShLangFragment).c_str()); + // printf("Vertex:\n%s\n", getStageString(EShLangVertex).c_str()); + // printf("Geo:\n%s\n", getStageString(EShLangGeometry).c_str()); + // printf("TessCtrl:\n%s\n", getStageString(EShLangTessControl).c_str()); + // printf("TessEval:\n%s\n", getStageString(EShLangTessEvaluation).c_str()); + // printf("Compute:\n%s\n", getStageString(EShLangCompute).c_str()); +} + +// +// Add context-dependent built-in functions and variables that are present +// for the given version and profile. All the results are put into just the +// commonBuiltins, because it is called for just a specific stage. So, +// add stage-specific entries to the commonBuiltins, and only if that stage +// was requested. +// +void TBuiltInParseablesHlsl::initialize(const TBuiltInResource &resources, int version, EProfile profile, int spv, + int vulkan, EShLanguage language) +{ +} + + +// +// Finish adding/processing context-independent built-in symbols. +// 1) Programmatically add symbols that could not be added by simple text strings above. +// 2) Map built-in functions to operators, for those that will turn into an operation node +// instead of remaining a function call. +// 3) Tag extension-related symbols added to their base version with their extensions, so +// that if an early version has the extension turned off, there is an error reported on use. +// +void TBuiltInParseablesHlsl::identifyBuiltIns(int version, EProfile profile, int spv, int vulkan, EShLanguage language, + TSymbolTable& symbolTable) +{ + // symbolTable.relateToOperator("abort"); + symbolTable.relateToOperator("abs", EOpAbs); + symbolTable.relateToOperator("acos", EOpAcos); + symbolTable.relateToOperator("all", EOpAll); + // symbolTable.relateToOperator("AllMemoryBarrier"); + // symbolTable.relateToOperator("AllMemoryBarrierWithGroupSync"); + symbolTable.relateToOperator("any", EOpAny); + // symbolTable.relateToOperator("asdouble"); + // symbolTable.relateToOperator("asfloat"); + symbolTable.relateToOperator("asin", EOpAsin); + // symbolTable.relateToOperator("asint"); + // symbolTable.relateToOperator("asuint"); + symbolTable.relateToOperator("atan", EOpAtan); + symbolTable.relateToOperator("atan2", EOpAtan); + symbolTable.relateToOperator("ceil", EOpCeil); + // symbolTable.relateToOperator("CheckAccessFullyMapped"); + symbolTable.relateToOperator("clamp", EOpClamp); + // symbolTable.relateToOperator("clip"); + symbolTable.relateToOperator("cos", EOpCos); + symbolTable.relateToOperator("cosh", EOpCosh); + symbolTable.relateToOperator("countbits", EOpBitCount); + symbolTable.relateToOperator("cross", EOpCross); + // symbolTable.relateToOperator("D3DCOLORtoUBYTE4"); + symbolTable.relateToOperator("ddx", EOpDPdx); + symbolTable.relateToOperator("ddx_coarse", EOpDPdxCoarse); + symbolTable.relateToOperator("ddx_fine", EOpDPdxFine); + symbolTable.relateToOperator("ddy", EOpDPdy); + symbolTable.relateToOperator("ddy_coarse", EOpDPdyCoarse); + symbolTable.relateToOperator("ddy_fine", EOpDPdyFine); + symbolTable.relateToOperator("degrees", EOpDegrees); + symbolTable.relateToOperator("determinant", EOpDeterminant); + // symbolTable.relateToOperator("DeviceMemoryBarrier"); + // symbolTable.relateToOperator("DeviceMemoryBarrierWithGroupSync"); + symbolTable.relateToOperator("distance", EOpDistance); + symbolTable.relateToOperator("dot", EOpDot); + // symbolTable.relateToOperator("dst"); + // symbolTable.relateToOperator("errorf"); + symbolTable.relateToOperator("EvaluateAttributeAtCentroid", EOpInterpolateAtCentroid); + symbolTable.relateToOperator("EvaluateAttributeAtSample", EOpInterpolateAtSample); + // symbolTable.relateToOperator("EvaluateAttributeSnapped"); // TODO: hsnflr positions. new op? + symbolTable.relateToOperator("exp", EOpExp); + symbolTable.relateToOperator("exp2", EOpExp2); + // symbolTable.relateToOperator("f16tof32"); + // symbolTable.relateToOperator("f32tof16"); + symbolTable.relateToOperator("faceforward", EOpFaceForward); + symbolTable.relateToOperator("firstbithigh", EOpFindMSB); + symbolTable.relateToOperator("firstbitlow", EOpFindLSB); + symbolTable.relateToOperator("floor", EOpFloor); + symbolTable.relateToOperator("fma", EOpFma); + // symbolTable.relateToOperator("fmod"); + symbolTable.relateToOperator("frac", EOpFract); + symbolTable.relateToOperator("frexp", EOpFrexp); + symbolTable.relateToOperator("fwidth", EOpFwidth); + // symbolTable.relateToOperator("GetRenderTargetSampleCount"); + // symbolTable.relateToOperator("GetRenderTargetSamplePosition"); + // symbolTable.relateToOperator("GroupMemoryBarrier"); + // symbolTable.relateToOperator("GroupMemoryBarrierWithGroupSync"); + // symbolTable.relateToOperator("InterlockedAdd"); + // symbolTable.relateToOperator("InterlockedAnd"); + // symbolTable.relateToOperator("InterlockedCompareExchange"); + // symbolTable.relateToOperator("InterlockedCompareStore"); + // symbolTable.relateToOperator("InterlockedExchange"); + // symbolTable.relateToOperator("InterlockedMax"); + // symbolTable.relateToOperator("InterlockedMin"); + // symbolTable.relateToOperator("InterlockedOr"); + // symbolTable.relateToOperator("InterlockedXor"); + // symbolTable.relateToOperator("isfinite"); + symbolTable.relateToOperator("isinf", EOpIsInf); + symbolTable.relateToOperator("isnan", EOpIsNan); + symbolTable.relateToOperator("ldexp", EOpLdexp); + symbolTable.relateToOperator("length", EOpLength); + // symbolTable.relateToOperator("lit"); + symbolTable.relateToOperator("log", EOpLog); + // symbolTable.relateToOperator("log10"); + symbolTable.relateToOperator("log2", EOpLog2); + // symbolTable.relateToOperator("mad"); + symbolTable.relateToOperator("max", EOpMax); + symbolTable.relateToOperator("min", EOpMin); + symbolTable.relateToOperator("modf", EOpModf); + // symbolTable.relateToOperator("msad4"); + // symbolTable.relateToOperator("mul"); + // symbolTable.relateToOperator("noise", EOpNoise); // TODO: check return type + symbolTable.relateToOperator("normalize", EOpNormalize); + symbolTable.relateToOperator("pow", EOpPow); + // symbolTable.relateToOperator("printf"); + // symbolTable.relateToOperator("Process2DQuadTessFactorsAvg"); + // symbolTable.relateToOperator("Process2DQuadTessFactorsMax"); + // symbolTable.relateToOperator("Process2DQuadTessFactorsMin"); + // symbolTable.relateToOperator("ProcessIsolineTessFactors"); + // symbolTable.relateToOperator("ProcessQuadTessFactorsAvg"); + // symbolTable.relateToOperator("ProcessQuadTessFactorsMax"); + // symbolTable.relateToOperator("ProcessQuadTessFactorsMin"); + // symbolTable.relateToOperator("ProcessTriTessFactorsAvg"); + // symbolTable.relateToOperator("ProcessTriTessFactorsMax"); + // symbolTable.relateToOperator("ProcessTriTessFactorsMin"); + symbolTable.relateToOperator("radians", EOpRadians); + // symbolTable.relateToOperator("rcp"); + symbolTable.relateToOperator("reflect", EOpReflect); + symbolTable.relateToOperator("refract", EOpRefract); + symbolTable.relateToOperator("reversebits", EOpBitFieldReverse); + symbolTable.relateToOperator("round", EOpRoundEven); + symbolTable.relateToOperator("rsqrt", EOpInverseSqrt); + // symbolTable.relateToOperator("saturate"); + symbolTable.relateToOperator("sign", EOpSign); + symbolTable.relateToOperator("sin", EOpSin); + // symbolTable.relateToOperator("sincos"); + symbolTable.relateToOperator("sinh", EOpSinh); + symbolTable.relateToOperator("smoothstep", EOpSmoothStep); + symbolTable.relateToOperator("sqrt", EOpSqrt); + symbolTable.relateToOperator("step", EOpStep); + symbolTable.relateToOperator("tan", EOpTan); + symbolTable.relateToOperator("tanh", EOpTanh); + symbolTable.relateToOperator("tex1D", EOpTexture); + // symbolTable.relateToOperator("tex1Dbias", // TODO: + symbolTable.relateToOperator("tex1Dgrad", EOpTextureGrad); + symbolTable.relateToOperator("tex1Dlod", EOpTextureLod); + symbolTable.relateToOperator("tex1Dproj", EOpTextureProj); + symbolTable.relateToOperator("tex2D", EOpTexture); + // symbolTable.relateToOperator("tex2Dbias", // TODO: + symbolTable.relateToOperator("tex2Dgrad", EOpTextureGrad); + symbolTable.relateToOperator("tex2Dlod", EOpTextureLod); + // symbolTable.relateToOperator("tex2Dproj", EOpTextureProj); + symbolTable.relateToOperator("tex3D", EOpTexture); + // symbolTable.relateToOperator("tex3Dbias"); // TODO + symbolTable.relateToOperator("tex3Dgrad", EOpTextureGrad); + symbolTable.relateToOperator("tex3Dlod", EOpTextureLod); + // symbolTable.relateToOperator("tex3Dproj", EOpTextureProj); + symbolTable.relateToOperator("texCUBE", EOpTexture); + // symbolTable.relateToOperator("texCUBEbias", // TODO + symbolTable.relateToOperator("texCUBEgrad", EOpTextureGrad); + symbolTable.relateToOperator("texCUBElod", EOpTextureLod); + // symbolTable.relateToOperator("texCUBEproj", EOpTextureProj); + symbolTable.relateToOperator("transpose", EOpTranspose); + symbolTable.relateToOperator("trunc", EOpTrunc); +} + +// +// Add context-dependent (resource-specific) built-ins not handled by the above. These +// would be ones that need to be programmatically added because they cannot +// be added by simple text strings. For these, also +// 1) Map built-in functions to operators, for those that will turn into an operation node +// instead of remaining a function call. +// 2) Tag extension-related symbols added to their base version with their extensions, so +// that if an early version has the extension turned off, there is an error reported on use. +// +void TBuiltInParseablesHlsl::identifyBuiltIns(int version, EProfile profile, int spv, int /*vulkan*/, EShLanguage language, + TSymbolTable& symbolTable, const TBuiltInResource &resources) +{ +} + + +} // end namespace glslang diff --git a/hlsl/hlslParseables.h b/hlsl/hlslParseables.h new file mode 100755 index 00000000..c09c1ecf --- /dev/null +++ b/hlsl/hlslParseables.h @@ -0,0 +1,61 @@ +// +//Copyright (C) 2016 LunarG, Inc. +// +//All rights reserved. +// +//Redistribution and use in source and binary forms, with or without +//modification, are permitted provided that the following conditions +//are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of 3Dlabs Inc. Ltd. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +//POSSIBILITY OF SUCH DAMAGE. +// + +#ifndef _HLSLPARSEABLES_INCLUDED_ +#define _HLSLPARSEABLES_INCLUDED_ + +#include "../glslang/MachineIndependent/Initialize.h" + +namespace glslang { + +// +// This is an HLSL specific derivation of TBuiltInParseables. See comment +// above TBuiltInParseables for details. +// +class TBuiltInParseablesHlsl : public TBuiltInParseables { +public: + POOL_ALLOCATOR_NEW_DELETE(GetThreadPoolAllocator()) + TBuiltInParseablesHlsl(); + void initialize(int version, EProfile, int spv, int vulkan); + void initialize(const TBuiltInResource& resources, int version, EProfile, int spv, int vulkan, EShLanguage); + + void identifyBuiltIns(int version, EProfile profile, int spv, int vulkan, EShLanguage language, TSymbolTable& symbolTable); + + void identifyBuiltIns(int version, EProfile profile, int spv, int /*vulkan*/, EShLanguage language, TSymbolTable& symbolTable, const TBuiltInResource &resources); +}; + +} // end namespace glslang + +#endif // _HLSLPARSEABLES_INCLUDED_ diff --git a/hlsl/hlslScanContext.cpp b/hlsl/hlslScanContext.cpp new file mode 100755 index 00000000..ab96bad6 --- /dev/null +++ b/hlsl/hlslScanContext.cpp @@ -0,0 +1,621 @@ +// +//Copyright (C) 2016 Google, Inc. +// +//All rights reserved. +// +//Redistribution and use in source and binary forms, with or without +//modification, are permitted provided that the following conditions +//are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of Google, Inc., nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +//POSSIBILITY OF SUCH DAMAGE. +// + +// +// HLSL scanning, leveraging the scanning done by the preprocessor. +// + +#include +#include +#include + +#include "../glslang/Include/Types.h" +#include "../glslang/MachineIndependent/SymbolTable.h" +#include "../glslang/MachineIndependent/ParseHelper.h" +#include "hlslScanContext.h" +#include "hlslTokens.h" +//#include "Scan.h" + +// preprocessor includes +#include "../glslang/MachineIndependent/preprocessor/PpContext.h" +#include "../glslang/MachineIndependent/preprocessor/PpTokens.h" + +namespace { + +struct str_eq +{ + bool operator()(const char* lhs, const char* rhs) const + { + return strcmp(lhs, rhs) == 0; + } +}; + +struct str_hash +{ + size_t operator()(const char* str) const + { + // djb2 + unsigned long hash = 5381; + int c; + + while ((c = *str++) != 0) + hash = ((hash << 5) + hash) + c; + + return hash; + } +}; + +// A single global usable by all threads, by all versions, by all languages. +// After a single process-level initialization, this is read only and thread safe +std::unordered_map* KeywordMap = nullptr; +std::unordered_set* ReservedSet = nullptr; + +}; + +namespace glslang { + +void HlslScanContext::fillInKeywordMap() +{ + if (KeywordMap != nullptr) { + // this is really an error, as this should called only once per process + // but, the only risk is if two threads called simultaneously + return; + } + KeywordMap = new std::unordered_map; + + (*KeywordMap)["static"] = EHTokStatic; + (*KeywordMap)["const"] = EHTokConst; + (*KeywordMap)["unorm"] = EHTokUnorm; + (*KeywordMap)["snorm"] = EHTokSNorm; + (*KeywordMap)["extern"] = EHTokExtern; + (*KeywordMap)["uniform"] = EHTokUniform; + (*KeywordMap)["volatile"] = EHTokVolatile; + (*KeywordMap)["shared"] = EHTokShared; + (*KeywordMap)["groupshared"] = EHTokGroupShared; + (*KeywordMap)["linear"] = EHTokLinear; + (*KeywordMap)["centroid"] = EHTokCentroid; + (*KeywordMap)["nointerpolation"] = EHTokNointerpolation; + (*KeywordMap)["noperspective"] = EHTokNoperspective; + (*KeywordMap)["sample"] = EHTokSample; + (*KeywordMap)["row_major"] = EHTokRowMajor; + (*KeywordMap)["column_major"] = EHTokColumnMajor; + (*KeywordMap)["packoffset"] = EHTokPackOffset; + + (*KeywordMap)["Buffer"] = EHTokBuffer; + (*KeywordMap)["vector"] = EHTokVector; + (*KeywordMap)["matrix"] = EHTokMatrix; + + (*KeywordMap)["void"] = EHTokVoid; + (*KeywordMap)["bool"] = EHTokBool; + (*KeywordMap)["int"] = EHTokInt; + (*KeywordMap)["uint"] = EHTokUint; + (*KeywordMap)["dword"] = EHTokDword; + (*KeywordMap)["half"] = EHTokHalf; + (*KeywordMap)["float"] = EHTokFloat; + (*KeywordMap)["double"] = EHTokDouble; + (*KeywordMap)["min16float"] = EHTokMin16float; + (*KeywordMap)["min10float"] = EHTokMin10float; + (*KeywordMap)["min16int"] = EHTokMin16int; + (*KeywordMap)["min12int"] = EHTokMin12int; + (*KeywordMap)["min16uint"] = EHTokMin16int; + + (*KeywordMap)["bool1"] = EHTokBool1; + (*KeywordMap)["bool2"] = EHTokBool2; + (*KeywordMap)["bool3"] = EHTokBool3; + (*KeywordMap)["bool4"] = EHTokBool4; + (*KeywordMap)["float1"] = EHTokFloat1; + (*KeywordMap)["float2"] = EHTokFloat2; + (*KeywordMap)["float3"] = EHTokFloat3; + (*KeywordMap)["float4"] = EHTokFloat4; + (*KeywordMap)["int1"] = EHTokInt1; + (*KeywordMap)["int2"] = EHTokInt2; + (*KeywordMap)["int3"] = EHTokInt3; + (*KeywordMap)["int4"] = EHTokInt4; + (*KeywordMap)["double1"] = EHTokDouble1; + (*KeywordMap)["double2"] = EHTokDouble2; + (*KeywordMap)["double3"] = EHTokDouble3; + (*KeywordMap)["double4"] = EHTokDouble4; + (*KeywordMap)["uint1"] = EHTokUint1; + (*KeywordMap)["uint2"] = EHTokUint2; + (*KeywordMap)["uint3"] = EHTokUint3; + (*KeywordMap)["uint4"] = EHTokUint4; + + (*KeywordMap)["int1x1"] = EHTokInt1x1; + (*KeywordMap)["int1x2"] = EHTokInt1x2; + (*KeywordMap)["int1x3"] = EHTokInt1x3; + (*KeywordMap)["int1x4"] = EHTokInt1x4; + (*KeywordMap)["int2x1"] = EHTokInt2x1; + (*KeywordMap)["int2x2"] = EHTokInt2x2; + (*KeywordMap)["int2x3"] = EHTokInt2x3; + (*KeywordMap)["int2x4"] = EHTokInt2x4; + (*KeywordMap)["int3x1"] = EHTokInt3x1; + (*KeywordMap)["int3x2"] = EHTokInt3x2; + (*KeywordMap)["int3x3"] = EHTokInt3x3; + (*KeywordMap)["int3x4"] = EHTokInt3x4; + (*KeywordMap)["int4x1"] = EHTokInt4x1; + (*KeywordMap)["int4x2"] = EHTokInt4x2; + (*KeywordMap)["int4x3"] = EHTokInt4x3; + (*KeywordMap)["int4x4"] = EHTokInt4x4; + (*KeywordMap)["float1x1"] = EHTokFloat1x1; + (*KeywordMap)["float1x2"] = EHTokFloat1x2; + (*KeywordMap)["float1x3"] = EHTokFloat1x3; + (*KeywordMap)["float1x4"] = EHTokFloat1x4; + (*KeywordMap)["float2x1"] = EHTokFloat2x1; + (*KeywordMap)["float2x2"] = EHTokFloat2x2; + (*KeywordMap)["float2x3"] = EHTokFloat2x3; + (*KeywordMap)["float2x4"] = EHTokFloat2x4; + (*KeywordMap)["float3x1"] = EHTokFloat3x1; + (*KeywordMap)["float3x2"] = EHTokFloat3x2; + (*KeywordMap)["float3x3"] = EHTokFloat3x3; + (*KeywordMap)["float3x4"] = EHTokFloat3x4; + (*KeywordMap)["float4x1"] = EHTokFloat4x1; + (*KeywordMap)["float4x2"] = EHTokFloat4x2; + (*KeywordMap)["float4x3"] = EHTokFloat4x3; + (*KeywordMap)["float4x4"] = EHTokFloat4x4; + (*KeywordMap)["double1x1"] = EHTokDouble1x1; + (*KeywordMap)["double1x2"] = EHTokDouble1x2; + (*KeywordMap)["double1x3"] = EHTokDouble1x3; + (*KeywordMap)["double1x4"] = EHTokDouble1x4; + (*KeywordMap)["double2x1"] = EHTokDouble2x1; + (*KeywordMap)["double2x2"] = EHTokDouble2x2; + (*KeywordMap)["double2x3"] = EHTokDouble2x3; + (*KeywordMap)["double2x4"] = EHTokDouble2x4; + (*KeywordMap)["double3x1"] = EHTokDouble3x1; + (*KeywordMap)["double3x2"] = EHTokDouble3x2; + (*KeywordMap)["double3x3"] = EHTokDouble3x3; + (*KeywordMap)["double3x4"] = EHTokDouble3x4; + (*KeywordMap)["double4x1"] = EHTokDouble4x1; + (*KeywordMap)["double4x2"] = EHTokDouble4x2; + (*KeywordMap)["double4x3"] = EHTokDouble4x3; + (*KeywordMap)["double4x4"] = EHTokDouble4x4; + + (*KeywordMap)["sampler"] = EHTokSampler; + (*KeywordMap)["sampler1D"] = EHTokSampler1d; + (*KeywordMap)["sampler2D"] = EHTokSampler2d; + (*KeywordMap)["sampler3D"] = EHTokSampler3d; + (*KeywordMap)["samplerCube"] = EHTokSamplerCube; + (*KeywordMap)["sampler_state"] = EHTokSamplerState; + (*KeywordMap)["SamplerState"] = EHTokSamplerState; + (*KeywordMap)["SamplerComparisonState"] = EHTokSamplerComparisonState; + (*KeywordMap)["texture"] = EHTokTexture; + (*KeywordMap)["Texture1D"] = EHTokTexture1d; + (*KeywordMap)["Texture1DArray"] = EHTokTexture1darray; + (*KeywordMap)["Texture2D"] = EHTokTexture2d; + (*KeywordMap)["Texture2DArray"] = EHTokTexture2darray; + (*KeywordMap)["Texture3D"] = EHTokTexture3d; + (*KeywordMap)["TextureCube"] = EHTokTextureCube; + + (*KeywordMap)["struct"] = EHTokStruct; + (*KeywordMap)["typedef"] = EHTokTypedef; + + (*KeywordMap)["true"] = EHTokBoolConstant; + (*KeywordMap)["false"] = EHTokBoolConstant; + + (*KeywordMap)["for"] = EHTokFor; + (*KeywordMap)["do"] = EHTokDo; + (*KeywordMap)["while"] = EHTokWhile; + (*KeywordMap)["break"] = EHTokBreak; + (*KeywordMap)["continue"] = EHTokContinue; + (*KeywordMap)["if"] = EHTokIf; + (*KeywordMap)["else"] = EHTokElse; + (*KeywordMap)["discard"] = EHTokDiscard; + (*KeywordMap)["return"] = EHTokReturn; + (*KeywordMap)["switch"] = EHTokSwitch; + (*KeywordMap)["case"] = EHTokCase; + (*KeywordMap)["default"] = EHTokDefault; + + // TODO: get correct set here + ReservedSet = new std::unordered_set; + + ReservedSet->insert("auto"); + ReservedSet->insert("catch"); + ReservedSet->insert("char"); + ReservedSet->insert("class"); + ReservedSet->insert("const_cast"); + ReservedSet->insert("enum"); + ReservedSet->insert("explicit"); + ReservedSet->insert("friend"); + ReservedSet->insert("goto"); + ReservedSet->insert("long"); + ReservedSet->insert("mutable"); + ReservedSet->insert("new"); + ReservedSet->insert("operator"); + ReservedSet->insert("private"); + ReservedSet->insert("protected"); + ReservedSet->insert("public"); + ReservedSet->insert("reinterpret_cast"); + ReservedSet->insert("short"); + ReservedSet->insert("signed"); + ReservedSet->insert("sizeof"); + ReservedSet->insert("static_cast"); + ReservedSet->insert("template"); + ReservedSet->insert("this"); + ReservedSet->insert("throw"); + ReservedSet->insert("try"); + ReservedSet->insert("typename"); + ReservedSet->insert("union"); + ReservedSet->insert("unsigned"); + ReservedSet->insert("using"); + ReservedSet->insert("virtual"); +} + +void HlslScanContext::deleteKeywordMap() +{ + delete KeywordMap; + KeywordMap = nullptr; + delete ReservedSet; + ReservedSet = nullptr; +} + +// Wrapper for tokenizeClass()"] = to get everything inside the token. +void HlslScanContext::tokenize(HlslToken& token) +{ + token.isType = false; + EHlslTokenClass tokenClass = tokenizeClass(token); + token.tokenClass = tokenClass; + if (token.isType) + afterType = true; +} + +// +// Fill in token information for the next token, except for the token class. +// Returns the enum value of the token class of the next token found. +// Return 0 (EndOfTokens) on end of input. +// +EHlslTokenClass HlslScanContext::tokenizeClass(HlslToken& token) +{ + do { + parserToken = &token; + TPpToken ppToken; + tokenText = ppContext.tokenize(&ppToken); + if (tokenText == nullptr) + return EHTokNone; + + loc = ppToken.loc; + parserToken->loc = loc; + switch (ppToken.token) { + case ';': afterType = false; return EHTokSemicolon; + case ',': afterType = false; return EHTokComma; + case ':': return EHTokColon; + case '=': afterType = false; return EHTokAssign; + case '(': afterType = false; return EHTokLeftParen; + case ')': afterType = false; return EHTokRightParen; + case '.': field = true; return EHTokDot; + case '!': return EHTokBang; + case '-': return EHTokDash; + case '~': return EHTokTilde; + case '+': return EHTokPlus; + case '*': return EHTokStar; + case '/': return EHTokSlash; + case '%': return EHTokPercent; + case '<': return EHTokLeftAngle; + case '>': return EHTokRightAngle; + case '|': return EHTokVerticalBar; + case '^': return EHTokCaret; + case '&': return EHTokAmpersand; + case '?': return EHTokQuestion; + case '[': return EHTokLeftBracket; + case ']': return EHTokRightBracket; + case '{': return EHTokLeftBrace; + case '}': return EHTokRightBrace; + case '\\': + parseContext.error(loc, "illegal use of escape character", "\\", ""); + break; + + case PpAtomAdd: return EHTokAddAssign; + case PpAtomSub: return EHTokSubAssign; + case PpAtomMul: return EHTokMulAssign; + case PpAtomDiv: return EHTokDivAssign; + case PpAtomMod: return EHTokModAssign; + + case PpAtomRight: return EHTokRightOp; + case PpAtomLeft: return EHTokLeftOp; + + case PpAtomRightAssign: return EHTokRightAssign; + case PpAtomLeftAssign: return EHTokLeftAssign; + case PpAtomAndAssign: return EHTokAndAssign; + case PpAtomOrAssign: return EHTokOrAssign; + case PpAtomXorAssign: return EHTokXorAssign; + + case PpAtomAnd: return EHTokAndOp; + case PpAtomOr: return EHTokOrOp; + case PpAtomXor: return EHTokXorOp; + + case PpAtomEQ: return EHTokEqOp; + case PpAtomGE: return EHTokGeOp; + case PpAtomNE: return EHTokNeOp; + case PpAtomLE: return EHTokLeOp; + + case PpAtomDecrement: return EHTokDecOp; + case PpAtomIncrement: return EHTokIncOp; + + case PpAtomConstInt: parserToken->i = ppToken.ival; return EHTokIntConstant; + case PpAtomConstUint: parserToken->i = ppToken.ival; return EHTokUintConstant; + case PpAtomConstFloat: parserToken->d = ppToken.dval; return EHTokFloatConstant; + case PpAtomConstDouble: parserToken->d = ppToken.dval; return EHTokDoubleConstant; + case PpAtomIdentifier: + { + EHlslTokenClass token = tokenizeIdentifier(); + field = false; + return token; + } + + case EndOfInput: return EHTokNone; + + default: + char buf[2]; + buf[0] = (char)ppToken.token; + buf[1] = 0; + parseContext.error(loc, "unexpected token", buf, ""); + break; + } + } while (true); +} + +EHlslTokenClass HlslScanContext::tokenizeIdentifier() +{ + if (ReservedSet->find(tokenText) != ReservedSet->end()) + return reservedWord(); + + auto it = KeywordMap->find(tokenText); + if (it == KeywordMap->end()) { + // Should have an identifier of some sort + return identifierOrType(); + } + keyword = it->second; + + switch (keyword) { + + // qualifiers + case EHTokStatic: + case EHTokConst: + case EHTokSNorm: + case EHTokUnorm: + case EHTokExtern: + case EHTokUniform: + case EHTokVolatile: + case EHTokShared: + case EHTokGroupShared: + case EHTokLinear: + case EHTokCentroid: + case EHTokNointerpolation: + case EHTokNoperspective: + case EHTokSample: + case EHTokRowMajor: + case EHTokColumnMajor: + case EHTokPackOffset: + return keyword; + + // template types + case EHTokBuffer: + case EHTokVector: + case EHTokMatrix: + return keyword; + + // scalar types + case EHTokVoid: + case EHTokBool: + case EHTokInt: + case EHTokUint: + case EHTokDword: + case EHTokHalf: + case EHTokFloat: + case EHTokDouble: + case EHTokMin16float: + case EHTokMin10float: + case EHTokMin16int: + case EHTokMin12int: + case EHTokMin16uint: + + // vector types + case EHTokBool1: + case EHTokBool2: + case EHTokBool3: + case EHTokBool4: + case EHTokFloat1: + case EHTokFloat2: + case EHTokFloat3: + case EHTokFloat4: + case EHTokInt1: + case EHTokInt2: + case EHTokInt3: + case EHTokInt4: + case EHTokDouble1: + case EHTokDouble2: + case EHTokDouble3: + case EHTokDouble4: + case EHTokUint1: + case EHTokUint2: + case EHTokUint3: + case EHTokUint4: + + // matrix types + case EHTokInt1x1: + case EHTokInt1x2: + case EHTokInt1x3: + case EHTokInt1x4: + case EHTokInt2x1: + case EHTokInt2x2: + case EHTokInt2x3: + case EHTokInt2x4: + case EHTokInt3x1: + case EHTokInt3x2: + case EHTokInt3x3: + case EHTokInt3x4: + case EHTokInt4x1: + case EHTokInt4x2: + case EHTokInt4x3: + case EHTokInt4x4: + case EHTokFloat1x1: + case EHTokFloat1x2: + case EHTokFloat1x3: + case EHTokFloat1x4: + case EHTokFloat2x1: + case EHTokFloat2x2: + case EHTokFloat2x3: + case EHTokFloat2x4: + case EHTokFloat3x1: + case EHTokFloat3x2: + case EHTokFloat3x3: + case EHTokFloat3x4: + case EHTokFloat4x1: + case EHTokFloat4x2: + case EHTokFloat4x3: + case EHTokFloat4x4: + case EHTokDouble1x1: + case EHTokDouble1x2: + case EHTokDouble1x3: + case EHTokDouble1x4: + case EHTokDouble2x1: + case EHTokDouble2x2: + case EHTokDouble2x3: + case EHTokDouble2x4: + case EHTokDouble3x1: + case EHTokDouble3x2: + case EHTokDouble3x3: + case EHTokDouble3x4: + case EHTokDouble4x1: + case EHTokDouble4x2: + case EHTokDouble4x3: + case EHTokDouble4x4: + parserToken->isType = true; + return keyword; + + // texturing types + case EHTokSampler: + case EHTokSampler1d: + case EHTokSampler2d: + case EHTokSampler3d: + case EHTokSamplerCube: + case EHTokSamplerState: + case EHTokSamplerComparisonState: + case EHTokTexture: + case EHTokTexture1d: + case EHTokTexture1darray: + case EHTokTexture2d: + case EHTokTexture2darray: + case EHTokTexture3d: + case EHTokTextureCube: + parserToken->isType = true; + return keyword; + + // variable, user type, ... + case EHTokStruct: + case EHTokTypedef: + + case EHTokBoolConstant: + if (strcmp("true", tokenText) == 0) + parserToken->b = true; + else + parserToken->b = false; + return keyword; + + // control flow + case EHTokFor: + case EHTokDo: + case EHTokWhile: + case EHTokBreak: + case EHTokContinue: + case EHTokIf: + case EHTokElse: + case EHTokDiscard: + case EHTokReturn: + case EHTokCase: + case EHTokSwitch: + case EHTokDefault: + return keyword; + + default: + parseContext.infoSink.info.message(EPrefixInternalError, "Unknown glslang keyword", loc); + return EHTokNone; + } +} + +EHlslTokenClass HlslScanContext::identifierOrType() +{ + parserToken->string = NewPoolTString(tokenText); + if (field) + return EHTokIdentifier; + + parserToken->symbol = parseContext.symbolTable.find(*parserToken->string); + if (afterType == false && parserToken->symbol) { + if (const TVariable* variable = parserToken->symbol->getAsVariable()) { + if (variable->isUserType()) { + afterType = true; + + return EHTokTypeName; + } + } + } + + return EHTokIdentifier; +} + +// Give an error for use of a reserved symbol. +// However, allow built-in declarations to use reserved words, to allow +// extension support before the extension is enabled. +EHlslTokenClass HlslScanContext::reservedWord() +{ + if (! parseContext.symbolTable.atBuiltInLevel()) + parseContext.error(loc, "Reserved word.", tokenText, "", ""); + + return EHTokNone; +} + +EHlslTokenClass HlslScanContext::identifierOrReserved(bool reserved) +{ + if (reserved) { + reservedWord(); + + return EHTokNone; + } + + if (parseContext.forwardCompatible) + parseContext.warn(loc, "using future reserved keyword", tokenText, ""); + + return identifierOrType(); +} + +// For a keyword that was never reserved, until it suddenly +// showed up. +EHlslTokenClass HlslScanContext::nonreservedKeyword(int version) +{ + if (parseContext.version < version) + return identifierOrType(); + + return keyword; +} + +} // end namespace glslang diff --git a/hlsl/hlslScanContext.h b/hlsl/hlslScanContext.h new file mode 100755 index 00000000..d761e3a8 --- /dev/null +++ b/hlsl/hlslScanContext.h @@ -0,0 +1,112 @@ +// +//Copyright (C) 2016 Google, Inc. +// +//All rights reserved. +// +//Redistribution and use in source and binary forms, with or without +//modification, are permitted provided that the following conditions +//are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of Google, Inc., nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +//POSSIBILITY OF SUCH DAMAGE. +// + +// +// This holds context specific to the HLSL scanner, which +// sits between the preprocessor scanner and HLSL parser. +// + +#ifndef HLSLSCANCONTEXT_H_ +#define HLSLSCANCONTEXT_H_ + +#include "../glslang/MachineIndependent/ParseHelper.h" +#include "hlslTokens.h" + +namespace glslang { + +class TPpContext; +class TPpToken; + + +// +// Everything needed to fully describe a token. +// +struct HlslToken { + HlslToken() : isType(false), string(nullptr), symbol(nullptr) { loc.init(); } + TSourceLoc loc; // location of token in the source + EHlslTokenClass tokenClass; // what kind of token it is + bool isType; // true if the token represents a type + union { // what data the token holds + glslang::TString *string; // for identifiers + int i; // for literals + unsigned int u; + bool b; + double d; + }; + glslang::TSymbol* symbol; // if a symbol table lookup was done already, this is the result +}; + +// +// The state of scanning and translating raw tokens to slightly richer +// semantics, like knowing if an identifier is an existing symbol, or +// user-defined type. +// +class HlslScanContext { +public: + HlslScanContext(TParseContextBase& parseContext, TPpContext& ppContext) + : parseContext(parseContext), ppContext(ppContext), afterType(false), field(false) { } + virtual ~HlslScanContext() { } + + static void fillInKeywordMap(); + static void deleteKeywordMap(); + + void tokenize(HlslToken&); + +protected: + HlslScanContext(HlslScanContext&); + HlslScanContext& operator=(HlslScanContext&); + + EHlslTokenClass tokenizeClass(HlslToken&); + EHlslTokenClass tokenizeIdentifier(); + EHlslTokenClass identifierOrType(); + EHlslTokenClass reservedWord(); + EHlslTokenClass identifierOrReserved(bool reserved); + EHlslTokenClass nonreservedKeyword(int version); + + TParseContextBase& parseContext; + TPpContext& ppContext; + bool afterType; // true if we've recognized a type, so can only be looking for an identifier + bool field; // true if we're on a field, right after a '.' + TSourceLoc loc; + TPpToken* ppToken; + HlslToken* parserToken; + + const char* tokenText; + EHlslTokenClass keyword; +}; + +} // end namespace glslang + +#endif // HLSLSCANCONTEXT_H_ diff --git a/hlsl/hlslTokenStream.cpp b/hlsl/hlslTokenStream.cpp new file mode 100755 index 00000000..47f779a8 --- /dev/null +++ b/hlsl/hlslTokenStream.cpp @@ -0,0 +1,106 @@ +// +//Copyright (C) 2016 Google, Inc. +// +//All rights reserved. +// +//Redistribution and use in source and binary forms, with or without +//modification, are permitted provided that the following conditions +//are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of Google, Inc., nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +//POSSIBILITY OF SUCH DAMAGE. +// + +#include "hlslTokenStream.h" + +namespace glslang { + +void HlslTokenStream::pushPreToken(const HlslToken& tok) +{ + assert(preTokenStackSize == 0); + preTokenStack = tok; + ++preTokenStackSize; +} + +HlslToken HlslTokenStream::popPreToken() +{ + assert(preTokenStackSize == 1); + --preTokenStackSize; + + return preTokenStack; +} + +void HlslTokenStream::pushTokenBuffer(const HlslToken& tok) +{ + tokenBuffer = tok; +} + +HlslToken HlslTokenStream::popTokenBuffer() +{ + return tokenBuffer; +} + +// Load 'token' with the next token in the stream of tokens. +void HlslTokenStream::advanceToken() +{ + pushTokenBuffer(token); + if (preTokenStackSize > 0) + token = popPreToken(); + else + scanner.tokenize(token); +} + +void HlslTokenStream::recedeToken() +{ + pushPreToken(token); + token = popTokenBuffer(); +} + +// Return the current token class. +EHlslTokenClass HlslTokenStream::peek() const +{ + return token.tokenClass; +} + +// Return true, without advancing to the next token, if the current token is +// the expected (passed in) token class. +bool HlslTokenStream::peekTokenClass(EHlslTokenClass tokenClass) const +{ + return peek() == tokenClass; +} + +// Return true and advance to the next token if the current token is the +// expected (passed in) token class. +bool HlslTokenStream::acceptTokenClass(EHlslTokenClass tokenClass) +{ + if (peekTokenClass(tokenClass)) { + advanceToken(); + return true; + } + + return false; +} + +} // end namespace glslang diff --git a/hlsl/hlslTokenStream.h b/hlsl/hlslTokenStream.h new file mode 100755 index 00000000..83365c4c --- /dev/null +++ b/hlsl/hlslTokenStream.h @@ -0,0 +1,82 @@ +// +//Copyright (C) 2016 Google, Inc. +// +//All rights reserved. +// +//Redistribution and use in source and binary forms, with or without +//modification, are permitted provided that the following conditions +//are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of Google, Inc., nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +//POSSIBILITY OF SUCH DAMAGE. +// + +#ifndef HLSLTOKENSTREAM_H_ +#define HLSLTOKENSTREAM_H_ + +#include "hlslScanContext.h" + +namespace glslang { + + class HlslTokenStream { + public: + explicit HlslTokenStream(HlslScanContext& scanner) + : scanner(scanner), preTokenStackSize(0) { } + virtual ~HlslTokenStream() { } + + public: + void advanceToken(); + void recedeToken(); + bool acceptTokenClass(EHlslTokenClass); + EHlslTokenClass peek() const; + bool peekTokenClass(EHlslTokenClass) const; + + protected: + HlslToken token; // the token we are currently looking at, but have not yet accepted + + private: + HlslScanContext& scanner; // lexical scanner, to get next token + + // Previously scanned tokens, returned for future advances, + // so logically in front of the token stream. + // Is logically a stack; needs last in last out semantics. + // Currently implemented as a stack of size 1. + HlslToken preTokenStack; + int preTokenStackSize; + void pushPreToken(const HlslToken&); + HlslToken popPreToken(); + + // Previously scanned tokens, not yet return for future advances, + // but available for that. + // Is logically a fifo for normal advances, and a stack for recession. + // Currently implemented with an intrinsic size of 1. + HlslToken tokenBuffer; + void pushTokenBuffer(const HlslToken&); + HlslToken popTokenBuffer(); + }; + +} // end namespace glslang + +#endif // HLSLTOKENSTREAM_H_ diff --git a/hlsl/hlslTokens.h b/hlsl/hlslTokens.h new file mode 100755 index 00000000..bc472fec --- /dev/null +++ b/hlsl/hlslTokens.h @@ -0,0 +1,248 @@ +// +//Copyright (C) 2016 Google, Inc. +// +//All rights reserved. +// +//Redistribution and use in source and binary forms, with or without +//modification, are permitted provided that the following conditions +//are met: +// +// Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// +// Neither the name of Google, Inc., nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +//"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +//FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +//COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +//INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +//BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +//CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +//LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +//ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +//POSSIBILITY OF SUCH DAMAGE. +// + +#ifndef EHLSLTOKENS_H_ +#define EHLSLTOKENS_H_ + +namespace glslang { + +enum EHlslTokenClass { + EHTokNone = 0, + + // qualifiers + EHTokStatic, + EHTokConst, + EHTokSNorm, + EHTokUnorm, + EHTokExtern, + EHTokUniform, + EHTokVolatile, + EHTokShared, + EHTokGroupShared, + EHTokLinear, + EHTokCentroid, + EHTokNointerpolation, + EHTokNoperspective, + EHTokSample, + EHTokRowMajor, + EHTokColumnMajor, + EHTokPackOffset, + + // template types + EHTokBuffer, + EHTokVector, + EHTokMatrix, + + // scalar types + EHTokVoid, + EHTokBool, + EHTokInt, + EHTokUint, + EHTokDword, + EHTokHalf, + EHTokFloat, + EHTokDouble, + EHTokMin16float, + EHTokMin10float, + EHTokMin16int, + EHTokMin12int, + EHTokMin16uint, + + // vector types + EHTokBool1, + EHTokBool2, + EHTokBool3, + EHTokBool4, + EHTokFloat1, + EHTokFloat2, + EHTokFloat3, + EHTokFloat4, + EHTokInt1, + EHTokInt2, + EHTokInt3, + EHTokInt4, + EHTokDouble1, + EHTokDouble2, + EHTokDouble3, + EHTokDouble4, + EHTokUint1, + EHTokUint2, + EHTokUint3, + EHTokUint4, + + // matrix types + EHTokInt1x1, + EHTokInt1x2, + EHTokInt1x3, + EHTokInt1x4, + EHTokInt2x1, + EHTokInt2x2, + EHTokInt2x3, + EHTokInt2x4, + EHTokInt3x1, + EHTokInt3x2, + EHTokInt3x3, + EHTokInt3x4, + EHTokInt4x1, + EHTokInt4x2, + EHTokInt4x3, + EHTokInt4x4, + EHTokFloat1x1, + EHTokFloat1x2, + EHTokFloat1x3, + EHTokFloat1x4, + EHTokFloat2x1, + EHTokFloat2x2, + EHTokFloat2x3, + EHTokFloat2x4, + EHTokFloat3x1, + EHTokFloat3x2, + EHTokFloat3x3, + EHTokFloat3x4, + EHTokFloat4x1, + EHTokFloat4x2, + EHTokFloat4x3, + EHTokFloat4x4, + EHTokDouble1x1, + EHTokDouble1x2, + EHTokDouble1x3, + EHTokDouble1x4, + EHTokDouble2x1, + EHTokDouble2x2, + EHTokDouble2x3, + EHTokDouble2x4, + EHTokDouble3x1, + EHTokDouble3x2, + EHTokDouble3x3, + EHTokDouble3x4, + EHTokDouble4x1, + EHTokDouble4x2, + EHTokDouble4x3, + EHTokDouble4x4, + + // texturing types + EHTokSampler, + EHTokSampler1d, + EHTokSampler2d, + EHTokSampler3d, + EHTokSamplerCube, + EHTokSamplerState, + EHTokSamplerComparisonState, + EHTokTexture, + EHTokTexture1d, + EHTokTexture1darray, + EHTokTexture2d, + EHTokTexture2darray, + EHTokTexture3d, + EHTokTextureCube, + + // variable, user type, ... + EHTokIdentifier, + EHTokTypeName, + EHTokStruct, + EHTokTypedef, + + // constant + EHTokFloatConstant, + EHTokDoubleConstant, + EHTokIntConstant, + EHTokUintConstant, + EHTokBoolConstant, + + // control flow + EHTokFor, + EHTokDo, + EHTokWhile, + EHTokBreak, + EHTokContinue, + EHTokIf, + EHTokElse, + EHTokDiscard, + EHTokReturn, + EHTokSwitch, + EHTokCase, + EHTokDefault, + + // expressions + EHTokLeftOp, + EHTokRightOp, + EHTokIncOp, + EHTokDecOp, + EHTokLeOp, + EHTokGeOp, + EHTokEqOp, + EHTokNeOp, + EHTokAndOp, + EHTokOrOp, + EHTokXorOp, + EHTokAssign, + EHTokMulAssign, + EHTokDivAssign, + EHTokAddAssign, + EHTokModAssign, + EHTokLeftAssign, + EHTokRightAssign, + EHTokAndAssign, + EHTokXorAssign, + EHTokOrAssign, + EHTokSubAssign, + EHTokLeftParen, + EHTokRightParen, + EHTokLeftBracket, + EHTokRightBracket, + EHTokLeftBrace, + EHTokRightBrace, + EHTokDot, + EHTokComma, + EHTokColon, + EHTokSemicolon, + EHTokBang, + EHTokDash, + EHTokTilde, + EHTokPlus, + EHTokStar, + EHTokSlash, + EHTokPercent, + EHTokLeftAngle, + EHTokRightAngle, + EHTokVerticalBar, + EHTokCaret, + EHTokAmpersand, + EHTokQuestion, +}; + +} // end namespace glslang + +#endif // EHLSLTOKENS_H_ \ No newline at end of file diff --git a/index.php b/index.php deleted file mode 100644 index 9a4bbcd9..00000000 --- a/index.php +++ /dev/null @@ -1,81 +0,0 @@ - - - - GLSL Reference Parser - - - - -

- [About] - - - -

-

About GLSL Reference Parser

-

- The GLSL Reference Parser provides a front end for parsing and - operating on OpenGL Shading Language code. It was originally - developed by 3Dlabs and is being maintained and updated by LunarG. The README has some additional information. -

- -

- You can download the source from the - Khronos public-access Subversion server . For example, using the Subversion - command-line client: -

- -

- svn checkout --username anonymous --password anonymous - https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang/ glslang -

- -
- -

Requirements

-

TBD. Builds on Windows and Linux.

- - -
- - -
-

- Get BuGLe at SourceForge.net. Fast, secure and Free Open Source software downloads - - -