HLSL to GLSL language translator based on ATI's HLSL2GLSL. Used in Unity.

Overview

HLSL to GLSL shader language translator

⚠️ As of mid-2016, the project is unlikely to have any significant developments. At Unity we are moving to a different shader compilation pipeline. So from my side there won't be significant work done on it. You might want to look into HLSLParser, HLSLcc or glslang instead. ⚠️

DX9 style HLSL in, GLSL / GLSL ES out.

A continued development from ATI's HLSL2GLSL, with preprocessor code based on mojoshader. I'm changing it to make it work for Unity's use cases; might totally not work for yours!

For an opposite tool (GLSL ES to HLSL translator), look at Google's ANGLE.

See badly maintained change log.

Notes

  • Only Direct3D 9 style HLSL is supported. No Direct3D 10/11 "template like" syntax, no geometry/tesselation/compute shaders, no abstract interfaces.
  • Platform support:
    • Windows via Visual Studio 2010 (hlslang.sln).
    • Mac via Xcode 5 (hlslang.xcodeproj).
    • Other platforms may or might not work. Some people have contributed CMake build scripts, but I am not maintaining them.
  • On Windows, the library is built with _HAS_ITERATOR_DEBUGGING=0,_SECURE_SCL=0 defines, which affect MSVC's STL behavior. If this does not match defines in your application, totally strange things can start to happen!
  • The library is not currently thread-safe.

Status

Used in Unity and bitsquid engines, and some other studios -- seems to work quite ok.

Support for DX11 features might or might not get added due to the bad condition the original code is in (very obscure and inefficient), instead maybe a new cross-compiler will be made. Someday. Maybe.

No optimizations are performed on the generated GLSL, so it is expected that your platform will have a decent GLSL compiler. Or, use GLSL Optimizer, at Unity we use it to optimize shaders produced by HLSL2GLSL; gives a substantial performance boost on mobile platforms.

Comments
  • Fixes ported from bitbucket

    Fixes ported from bitbucket

    Hello Aras,

    I took some time to rebase my fork of hlsl2glslfork onto the new git code, looks to work well for our shaders at Eugen Systems, maybe you'd like to merge or cherry pick some of these.

    Cheers,

    Maxime.

    opened by mawww 11
  • Compiling on linux?

    Compiling on linux?

    Has anyone tried building on linux recently? I had to #include <cstdlib> and <cstring> to glslCommon.cpp.

    Now I'm having an error in Linux/ossource.cpp: First it tries to #include "InitializeDll.h", which I comment out. Then error: ‘DetachThread’ was not declared in this scope

    The code:

    void DetachThreadLinux(void *)
    {
        DetachThread();
    }
    

    Doesn't look right. Maybe pthread_detach(), but what argument? I went with: pthread_detach(pthread_self());, but now I'm just making stuff up. I got a lib. Can't yet test if it works for other reasons, but I suggest someone try building linux and make sure it works at git head.

    opened by TurkeyMan 5
  • Howto section on README.md

    Howto section on README.md

    it would be nice to know how to use this library on Unity, i can figure it out how to link the library in a c++ project and use it correctly, but have not idea of how to link c++ static libraries to a Unity project.

    opened by MarianoGnu 4
  • Fix parser and lexer scripts to work with modern Bison/Flex.

    Fix parser and lexer scripts to work with modern Bison/Flex.

    There were some odd platform-specific macro checks... I removed these since hours of trying to figure out the purpose of them bore fruitless.

    YYPARSE_PARAM and YYLEX_PARAM are both deprecated. We must now use parser parameters in order to change the parameters.

    yyerror oddly didn't require a contextual parameter despite bison being set as a pure parser. We now accept the contextual parameter but do nothing with it. I'm not sure how this was done and I'm not aware of a way to bring back that functionality.

    %pure_parser has been a deprecated parameter for years. We now use %define api.pure full.

    Please do not pull blindly. I cannot fully test this patch. I need people to test.

    opened by computerquip 4
  • Trouble building on linux

    Trouble building on linux

    Hi, I had some trouble building on linux (Ubuntu 15.04):

    $ make
    [  3%] Executing Bison on hlslang.y
    hlslang.y:109.1-12: warning: deprecated directive, use ‘%pure-parser’ [-Wdeprecated]
     %pure_parser /* Just in case is called from multiple threads */
     ^^^^^^^^^^^^
    [  6%] Executing flex on hlslang.l
    Scanning dependencies of target hlsl2glsl
    [  9%] Building CXX object CMakeFiles/hlsl2glsl.dir/hlslang/GLSLCodeGen/glslCommon.cpp.o
    [ 12%] Building CXX object CMakeFiles/hlsl2glsl.dir/hlslang/GLSLCodeGen/glslFunction.cpp.o
    [ 15%] Building CXX object CMakeFiles/hlsl2glsl.dir/hlslang/GLSLCodeGen/glslOutput.cpp.o
    [ 18%] Building CXX object CMakeFiles/hlsl2glsl.dir/hlslang/GLSLCodeGen/glslStruct.cpp.o
    [ 21%] Building CXX object CMakeFiles/hlsl2glsl.dir/hlslang/GLSLCodeGen/glslSymbol.cpp.o
    [ 25%] Building CXX object CMakeFiles/hlsl2glsl.dir/hlslang/GLSLCodeGen/hlslCrossCompiler.cpp.o
    [ 28%] Building CXX object CMakeFiles/hlsl2glsl.dir/hlslang/GLSLCodeGen/hlslLinker.cpp.o
    [ 31%] Building CXX object CMakeFiles/hlsl2glsl.dir/hlslang/GLSLCodeGen/hlslSupportLib.cpp.o
    [ 34%] Building CXX object CMakeFiles/hlsl2glsl.dir/hlslang/GLSLCodeGen/propagateMutable.cpp.o
    [ 37%] Building CXX object CMakeFiles/hlsl2glsl.dir/hlslang/GLSLCodeGen/typeSamplers.cpp.o
    [ 40%] Building CXX object CMakeFiles/hlsl2glsl.dir/hlslang/MachineIndependent/HLSL2GLSL.cpp.o
    [ 43%] Building CXX object CMakeFiles/hlsl2glsl.dir/hlslang/MachineIndependent/InfoSink.cpp.o
    [ 46%] Building CXX object CMakeFiles/hlsl2glsl.dir/hlslang/MachineIndependent/Initialize.cpp.o
    [ 50%] Building CXX object CMakeFiles/hlsl2glsl.dir/hlslang/MachineIndependent/Intermediate.cpp.o
    [ 53%] Building CXX object CMakeFiles/hlsl2glsl.dir/hlslang/MachineIndependent/intermOut.cpp.o
    [ 56%] Building CXX object CMakeFiles/hlsl2glsl.dir/hlslang/MachineIndependent/IntermTraverse.cpp.o
    [ 59%] Building CXX object CMakeFiles/hlsl2glsl.dir/hlslang/MachineIndependent/ParseHelper.cpp.o
    [ 62%] Building CXX object CMakeFiles/hlsl2glsl.dir/hlslang/MachineIndependent/PoolAlloc.cpp.o
    [ 65%] Building CXX object CMakeFiles/hlsl2glsl.dir/hlslang/MachineIndependent/RemoveTree.cpp.o
    [ 68%] Building CXX object CMakeFiles/hlsl2glsl.dir/hlslang/MachineIndependent/SymbolTable.cpp.o
    [ 71%] Building CXX object CMakeFiles/hlsl2glsl.dir/hlslang/MachineIndependent/ConstantFolding.cpp.o
    [ 75%] Building CXX object CMakeFiles/hlsl2glsl.dir/hlslang/MachineIndependent/preprocessor/mojoshader_common.cpp.o
    [ 78%] Building CXX object CMakeFiles/hlsl2glsl.dir/hlslang/MachineIndependent/preprocessor/mojoshader_lexer.cpp.o
    [ 81%] Building CXX object CMakeFiles/hlsl2glsl.dir/hlslang/MachineIndependent/preprocessor/mojoshader_preprocessor.cpp.o
    [ 84%] Building CXX object CMakeFiles/hlsl2glsl.dir/hlslang/MachineIndependent/preprocessor/mojoshader.cpp.o
    [ 87%] Building CXX object CMakeFiles/hlsl2glsl.dir/hlslang/MachineIndependent/preprocessor/sourceloc.cpp.o
    [ 90%] Building CXX object CMakeFiles/hlsl2glsl.dir/hlslang/OSDependent/Linux/ossource.cpp.o
    [ 93%] Building CXX object CMakeFiles/hlsl2glsl.dir/hlslang/MachineIndependent/Gen_hlslang.cpp.o
    [ 96%] Building CXX object CMakeFiles/hlsl2glsl.dir/hlslang/MachineIndependent/hlslang_tab.cpp.o
    hlslang_tab.cpp: In function ‘int yyparse()’:
    hlslang_tab.cpp:2223:30: error: too few arguments to function ‘int yylex(YYSTYPE*, void*)’
    hlslang.y:105:16: note: declared here
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:187:13: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:196:17: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:249:13: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:254:17: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:256:17: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:257:13: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:261:5: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:267:12: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:270:12: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:274:7: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:282:5: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:316:13: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:320:13: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:326:19: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:335:18: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:350:17: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:367:21: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:378:19: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:395:13: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:402:13: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:404:135: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:412:13: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:414:135: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:425:13: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:428:42: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:444:17: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:458:17: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:468:17: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:478:27: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:567:13: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:640:74: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:654:7: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:666:7: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:679:7: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:681:128: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:689:13: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:691:128: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:700:138: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:718:71: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:58:5: note: in expansion of macro ‘parseContext’
    hlslang.y:754:7: note: in expansion of macro ‘UNSUPPORTED_FEATURE’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:761:40: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:762:40: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:763:40: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:768:40: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:769:40: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:774:40: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:775:40: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:780:40: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:781:40: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:782:40: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:783:40: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:788:40: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:789:40: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:794:40: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:799:40: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:804:40: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:809:40: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:814:40: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:819:40: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:825:12: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:828:182: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:841:13: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:843:42: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:58:5: note: in expansion of macro ‘parseContext’
    hlslang.y:857:7: note: in expansion of macro ‘UNSUPPORTED_FEATURE’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:58:5: note: in expansion of macro ‘parseContext’
    hlslang.y:860:7: note: in expansion of macro ‘UNSUPPORTED_FEATURE’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:58:5: note: in expansion of macro ‘parseContext’
    hlslang.y:861:7: note: in expansion of macro ‘UNSUPPORTED_FEATURE’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:58:5: note: in expansion of macro ‘parseContext’
    hlslang.y:862:7: note: in expansion of macro ‘UNSUPPORTED_FEATURE’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:58:5: note: in expansion of macro ‘parseContext’
    hlslang.y:863:7: note: in expansion of macro ‘UNSUPPORTED_FEATURE’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:58:5: note: in expansion of macro ‘parseContext’
    hlslang.y:864:7: note: in expansion of macro ‘UNSUPPORTED_FEATURE’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:874:13: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:883:13: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:904:54: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:937:54: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:992:13: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:1012:5: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:1017:13: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:1038:13: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:1041:13: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:1049:13: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:1052:13: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:1063:13: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:1066:13: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:1075:13: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:1078:13: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:1086:13: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:1089:13: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:1093:13: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:1104:13: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:1107:13: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:1111:13: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:1133:13: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:1138:13: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:1140:13: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:1148:13: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:1153:13: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:1155:13: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:1189:13: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:1192:13: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:1195:13: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:1198:18: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:1207:13: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:1210:13: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:1213:13: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:1231:13: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:1234:13: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:1237:13: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:1259:13: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:1263:13: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:1271:18: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:1287:13: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:1291:13: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:1304:18: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:1319:13: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:1324:9: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:1337:8: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:1340:8: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:1343:8: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:1355:22: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:1358:22: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:1361:22: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:1364:21: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:1372:13: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:1375:13: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:1378:13: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:1387:21: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:1395:13: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:1398:13: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:1402:13: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:1421:7: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:1425:7: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:1435:9: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:1447:13: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:1451:13: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:1465:9: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:1477:7: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:1482:9: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:1492:8: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:1495:8: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:1498:8: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:1501:22: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:1528:45: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:1535:13: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:1557:13: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:1570:13: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:63:20: note: in expansion of macro ‘parseContext’
    hlslang.y:1583:9: note: in expansion of macro ‘SET_BASIC_TYPE’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:63:20: note: in expansion of macro ‘parseContext’
    hlslang.y:1586:9: note: in expansion of macro ‘SET_BASIC_TYPE’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:63:20: note: in expansion of macro ‘parseContext’
    hlslang.y:1589:9: note: in expansion of macro ‘SET_BASIC_TYPE’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:63:20: note: in expansion of macro ‘parseContext’
    hlslang.y:1592:9: note: in expansion of macro ‘SET_BASIC_TYPE’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:63:20: note: in expansion of macro ‘parseContext’
    hlslang.y:1595:9: note: in expansion of macro ‘SET_BASIC_TYPE’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:63:20: note: in expansion of macro ‘parseContext’
    hlslang.y:1598:9: note: in expansion of macro ‘SET_BASIC_TYPE’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:1601:27: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:1612:27: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:1623:27: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:63:20: note: in expansion of macro ‘parseContext’
    hlslang.y:1634:9: note: in expansion of macro ‘SET_BASIC_TYPE’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:63:20: note: in expansion of macro ‘parseContext’
    hlslang.y:1638:9: note: in expansion of macro ‘SET_BASIC_TYPE’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:63:20: note: in expansion of macro ‘parseContext’
    hlslang.y:1642:9: note: in expansion of macro ‘SET_BASIC_TYPE’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:63:20: note: in expansion of macro ‘parseContext’
    hlslang.y:1646:9: note: in expansion of macro ‘SET_BASIC_TYPE’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:63:20: note: in expansion of macro ‘parseContext’
    hlslang.y:1650:9: note: in expansion of macro ‘SET_BASIC_TYPE’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:63:20: note: in expansion of macro ‘parseContext’
    hlslang.y:1654:9: note: in expansion of macro ‘SET_BASIC_TYPE’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:63:20: note: in expansion of macro ‘parseContext’
    hlslang.y:1658:9: note: in expansion of macro ‘SET_BASIC_TYPE’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:63:20: note: in expansion of macro ‘parseContext’
    hlslang.y:1662:9: note: in expansion of macro ‘SET_BASIC_TYPE’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:63:20: note: in expansion of macro ‘parseContext’
    hlslang.y:1666:9: note: in expansion of macro ‘SET_BASIC_TYPE’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:63:20: note: in expansion of macro ‘parseContext’
    hlslang.y:1670:9: note: in expansion of macro ‘SET_BASIC_TYPE’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:63:20: note: in expansion of macro ‘parseContext’
    hlslang.y:1674:9: note: in expansion of macro ‘SET_BASIC_TYPE’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:63:20: note: in expansion of macro ‘parseContext’
    hlslang.y:1678:9: note: in expansion of macro ‘SET_BASIC_TYPE’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:63:20: note: in expansion of macro ‘parseContext’
    hlslang.y:1682:9: note: in expansion of macro ‘SET_BASIC_TYPE’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:63:20: note: in expansion of macro ‘parseContext’
    hlslang.y:1686:9: note: in expansion of macro ‘SET_BASIC_TYPE’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:63:20: note: in expansion of macro ‘parseContext’
    hlslang.y:1690:9: note: in expansion of macro ‘SET_BASIC_TYPE’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:63:20: note: in expansion of macro ‘parseContext’
    hlslang.y:1694:9: note: in expansion of macro ‘SET_BASIC_TYPE’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:51:6: note: in expansion of macro ‘parseContext’
    hlslang.y:1698:3: note: in expansion of macro ‘NONSQUARE_MATRIX_CHECK’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:63:20: note: in expansion of macro ‘parseContext’
    hlslang.y:1699:9: note: in expansion of macro ‘SET_BASIC_TYPE’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:51:6: note: in expansion of macro ‘parseContext’
    hlslang.y:1703:3: note: in expansion of macro ‘NONSQUARE_MATRIX_CHECK’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:63:20: note: in expansion of macro ‘parseContext’
    hlslang.y:1704:9: note: in expansion of macro ‘SET_BASIC_TYPE’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:51:6: note: in expansion of macro ‘parseContext’
    hlslang.y:1708:3: note: in expansion of macro ‘NONSQUARE_MATRIX_CHECK’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:63:20: note: in expansion of macro ‘parseContext’
    hlslang.y:1709:9: note: in expansion of macro ‘SET_BASIC_TYPE’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:63:20: note: in expansion of macro ‘parseContext’
    hlslang.y:1713:9: note: in expansion of macro ‘SET_BASIC_TYPE’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:51:6: note: in expansion of macro ‘parseContext’
    hlslang.y:1717:3: note: in expansion of macro ‘NONSQUARE_MATRIX_CHECK’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:63:20: note: in expansion of macro ‘parseContext’
    hlslang.y:1718:9: note: in expansion of macro ‘SET_BASIC_TYPE’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:51:6: note: in expansion of macro ‘parseContext’
    hlslang.y:1722:3: note: in expansion of macro ‘NONSQUARE_MATRIX_CHECK’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:63:20: note: in expansion of macro ‘parseContext’
    hlslang.y:1723:9: note: in expansion of macro ‘SET_BASIC_TYPE’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:51:6: note: in expansion of macro ‘parseContext’
    hlslang.y:1727:3: note: in expansion of macro ‘NONSQUARE_MATRIX_CHECK’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:63:20: note: in expansion of macro ‘parseContext’
    hlslang.y:1728:9: note: in expansion of macro ‘SET_BASIC_TYPE’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:63:20: note: in expansion of macro ‘parseContext’
    hlslang.y:1732:9: note: in expansion of macro ‘SET_BASIC_TYPE’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:63:20: note: in expansion of macro ‘parseContext’
    hlslang.y:1736:9: note: in expansion of macro ‘SET_BASIC_TYPE’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:51:6: note: in expansion of macro ‘parseContext’
    hlslang.y:1740:3: note: in expansion of macro ‘NONSQUARE_MATRIX_CHECK’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:63:20: note: in expansion of macro ‘parseContext’
    hlslang.y:1741:9: note: in expansion of macro ‘SET_BASIC_TYPE’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:51:6: note: in expansion of macro ‘parseContext’
    hlslang.y:1745:3: note: in expansion of macro ‘NONSQUARE_MATRIX_CHECK’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:63:20: note: in expansion of macro ‘parseContext’
    hlslang.y:1746:9: note: in expansion of macro ‘SET_BASIC_TYPE’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:51:6: note: in expansion of macro ‘parseContext’
    hlslang.y:1750:3: note: in expansion of macro ‘NONSQUARE_MATRIX_CHECK’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:63:20: note: in expansion of macro ‘parseContext’
    hlslang.y:1751:9: note: in expansion of macro ‘SET_BASIC_TYPE’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:63:20: note: in expansion of macro ‘parseContext’
    hlslang.y:1755:9: note: in expansion of macro ‘SET_BASIC_TYPE’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:51:6: note: in expansion of macro ‘parseContext’
    hlslang.y:1759:3: note: in expansion of macro ‘NONSQUARE_MATRIX_CHECK’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:63:20: note: in expansion of macro ‘parseContext’
    hlslang.y:1760:9: note: in expansion of macro ‘SET_BASIC_TYPE’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:51:6: note: in expansion of macro ‘parseContext’
    hlslang.y:1764:3: note: in expansion of macro ‘NONSQUARE_MATRIX_CHECK’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:63:20: note: in expansion of macro ‘parseContext’
    hlslang.y:1765:9: note: in expansion of macro ‘SET_BASIC_TYPE’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:51:6: note: in expansion of macro ‘parseContext’
    hlslang.y:1769:3: note: in expansion of macro ‘NONSQUARE_MATRIX_CHECK’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:63:20: note: in expansion of macro ‘parseContext’
    hlslang.y:1770:9: note: in expansion of macro ‘SET_BASIC_TYPE’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:63:20: note: in expansion of macro ‘parseContext’
    hlslang.y:1774:9: note: in expansion of macro ‘SET_BASIC_TYPE’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:63:20: note: in expansion of macro ‘parseContext’
    hlslang.y:1778:9: note: in expansion of macro ‘SET_BASIC_TYPE’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:51:6: note: in expansion of macro ‘parseContext’
    hlslang.y:1782:3: note: in expansion of macro ‘NONSQUARE_MATRIX_CHECK’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:63:20: note: in expansion of macro ‘parseContext’
    hlslang.y:1783:9: note: in expansion of macro ‘SET_BASIC_TYPE’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:51:6: note: in expansion of macro ‘parseContext’
    hlslang.y:1787:3: note: in expansion of macro ‘NONSQUARE_MATRIX_CHECK’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:63:20: note: in expansion of macro ‘parseContext’
    hlslang.y:1788:9: note: in expansion of macro ‘SET_BASIC_TYPE’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:51:6: note: in expansion of macro ‘parseContext’
    hlslang.y:1792:3: note: in expansion of macro ‘NONSQUARE_MATRIX_CHECK’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:63:20: note: in expansion of macro ‘parseContext’
    hlslang.y:1793:9: note: in expansion of macro ‘SET_BASIC_TYPE’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:63:20: note: in expansion of macro ‘parseContext’
    hlslang.y:1797:9: note: in expansion of macro ‘SET_BASIC_TYPE’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:51:6: note: in expansion of macro ‘parseContext’
    hlslang.y:1801:3: note: in expansion of macro ‘NONSQUARE_MATRIX_CHECK’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:63:20: note: in expansion of macro ‘parseContext’
    hlslang.y:1802:9: note: in expansion of macro ‘SET_BASIC_TYPE’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:51:6: note: in expansion of macro ‘parseContext’
    hlslang.y:1806:3: note: in expansion of macro ‘NONSQUARE_MATRIX_CHECK’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:63:20: note: in expansion of macro ‘parseContext’
    hlslang.y:1807:9: note: in expansion of macro ‘SET_BASIC_TYPE’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:51:6: note: in expansion of macro ‘parseContext’
    hlslang.y:1811:3: note: in expansion of macro ‘NONSQUARE_MATRIX_CHECK’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:63:20: note: in expansion of macro ‘parseContext’
    hlslang.y:1812:9: note: in expansion of macro ‘SET_BASIC_TYPE’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:63:20: note: in expansion of macro ‘parseContext’
    hlslang.y:1816:9: note: in expansion of macro ‘SET_BASIC_TYPE’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:63:20: note: in expansion of macro ‘parseContext’
    hlslang.y:1820:9: note: in expansion of macro ‘SET_BASIC_TYPE’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:63:20: note: in expansion of macro ‘parseContext’
    hlslang.y:1823:9: note: in expansion of macro ‘SET_BASIC_TYPE’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:63:20: note: in expansion of macro ‘parseContext’
    hlslang.y:1826:9: note: in expansion of macro ‘SET_BASIC_TYPE’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:63:20: note: in expansion of macro ‘parseContext’
    hlslang.y:1829:9: note: in expansion of macro ‘SET_BASIC_TYPE’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:63:20: note: in expansion of macro ‘parseContext’
    hlslang.y:1832:3: note: in expansion of macro ‘SET_BASIC_TYPE’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:63:20: note: in expansion of macro ‘parseContext’
    hlslang.y:1835:3: note: in expansion of macro ‘SET_BASIC_TYPE’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:63:20: note: in expansion of macro ‘parseContext’
    hlslang.y:1838:9: note: in expansion of macro ‘SET_BASIC_TYPE’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:63:20: note: in expansion of macro ‘parseContext’
    hlslang.y:1841:9: note: in expansion of macro ‘SET_BASIC_TYPE’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:63:20: note: in expansion of macro ‘parseContext’
    hlslang.y:1844:3: note: in expansion of macro ‘SET_BASIC_TYPE’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:63:20: note: in expansion of macro ‘parseContext’
    hlslang.y:1847:3: note: in expansion of macro ‘SET_BASIC_TYPE’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:63:20: note: in expansion of macro ‘parseContext’
    hlslang.y:1850:9: note: in expansion of macro ‘SET_BASIC_TYPE’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:63:20: note: in expansion of macro ‘parseContext’
    hlslang.y:1853:9: note: in expansion of macro ‘SET_BASIC_TYPE’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:63:20: note: in expansion of macro ‘parseContext’
    hlslang.y:1856:9: note: in expansion of macro ‘SET_BASIC_TYPE’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:63:20: note: in expansion of macro ‘parseContext’
    hlslang.y:1859:9: note: in expansion of macro ‘SET_BASIC_TYPE’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:1863:41: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:63:20: note: in expansion of macro ‘parseContext’
    hlslang.y:1871:9: note: in expansion of macro ‘SET_BASIC_TYPE’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:1880:15: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:1903:21: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:1916:13: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:1932:21: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:1973:13: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:1983:13: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:2019:7: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:2019:7: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:2059:13: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:2061:140: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:2082:13: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:2087:13: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:2089:13: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:2092:14: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:2102:7: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:2103:9: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:2107:9: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:2108:13: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:2112:11: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:2114:7: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:2115:9: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:2157:13: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:2164:13: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:2172:13: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:2179:13: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:2195:9: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:2210:9: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:2214:9: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:2231:54: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:2301:13: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:2305:9: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:2342:41: note: in expansion of macro ‘parseContext’
    CMakeFiles/hlsl2glsl.dir/build.make:714: recipe for target 'CMakeFiles/hlsl2glsl.dir/hlslang/MachineIndependent/hlslang_tab.cpp.o' failed
    make[2]: *** [CMakeFiles/hlsl2glsl.dir/hlslang/MachineIndependent/hlslang_tab.cpp.o] Error 1
    CMakeFiles/Makefile2:60: recipe for target 'CMakeFiles/hlsl2glsl.dir/all' failed
    make[1]: *** [CMakeFiles/hlsl2glsl.dir/all] Error 2
    Makefile:76: recipe for target 'all' failed
    make: *** [all] Error 2
    
    
    opened by stuaxo 3
  • Compilation issue with Yacc 3.0.2

    Compilation issue with Yacc 3.0.2

    [email protected]~/hlsl2glslfork/build # make
    [  3%] Executing Bison on hlslang.y
    hlslang.y:109.1-12: warning: deprecated directive, use ‘%pure-parser’ [-Wdeprecated]
     %pure_parser /* Just in case is called from multiple threads */
     ^^^^^^^^^^^^
    [  6%] Executing flex on hlslang.l
    Scanning dependencies of target hlsl2glsl
    [  9%] Building CXX object CMakeFiles/hlsl2glsl.dir/hlslang/MachineIndependent/Gen_hlslang.cpp.o
    [ 12%] Building CXX object CMakeFiles/hlsl2glsl.dir/hlslang/MachineIndependent/hlslang_tab.cpp.o
    hlslang_tab.cpp: In function ‘int yyparse()’:
    hlslang_tab.cpp:2223:30: error: too few arguments to function ‘int yylex(YYSTYPE*, void*)’
    hlslang.y:105:16: note: declared here
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:187:13: note: in expansion of macro ‘parseContext’
    hlslang.y:36:46: error: ‘parseContextLocal’ was not declared in this scope
    hlslang.y:196:17: note: in expansion of macro ‘parseContext’
    ...
    

    And a lot more.

    I guess it's because YYPARSE_PARAM has been deprecated/removed.

    opened by arcanis 3
  • Is the description accurate?

    Is the description accurate?

    I'm using this tool because it's the only active project for translating HLSL source to GLSL source (oh the torment...). The description slightly scares me as to whether I should invest time into the tool.

    The library is not currently thread-safe.

    This isn't specific enough. Not that this should probably be run in a threaded environment too often... but calling construct compiler and shipping the compiler off in a thread to Hlsl2Glsl_Parse and Hlsl2Glsl_Translate seems like an optimal route, especially if we have a few hundred shaders that are large. Can this be improved?

    Support for DX11 features might or might not get added due to the bad condition the original code is in (very obscure and inefficient), instead maybe a new cross-compiler will be made. Someday. Maybe.

    Is this really the case? Is the code that bad? If so, should I look into making new tools? How is the translation done? Is there an IR format hlsl2glsl uses? There's a lot of things that aren't very clear that I think would be good to document so I don't spend weeks looking into the features/capabilities/potential of the codebase.

    opened by computerquip 2
  • Win32 compile fix

    Win32 compile fix

    1. There is no "main.cpp" in the OSDependent/ directory.
    2. VS 2013 does not pull in std::min and std::max without including in Intermediate.cpp
    3. YY_NO_UNISTD_H seems to not be implemented/respected by the included bison and flex EXEs, and since this directory is already in the includes, add a dummy "unistd.h" so that compiles work.
    opened by raymond-w-ko 2
  • ::malloc has not been declared

    ::malloc has not been declared

    I'm getting this strange error "::malloc has not been declared" when I try and build for linux x64.

    The problem is described here: http://nerdland.net/unstumping-the-internet/malloc-has-not-been-declared/ But this project uses cmake rather than autoconf. What needs to be done to fix it?

    opened by TurkeyMan 2
  • Fix Linux build.

    Fix Linux build.

    Add missing include files and remove outdated functions from OS-specific code. Instead of putting a dummy unistd.h on the include path, disable its inclusion the right way.

    opened by zeux 2
  • Always use attributes for gles

    Always use attributes for gles

    I hope this is ok as my next branch/pull request will build on top of it.

    I considered adding an option for this feature but since the specs ( http://www.khronos.org/files/opengles_shading_language.pdf ) directly state "There are no built-in attribute names in OpenGL ES", I decided against it. If this lack of option is a deal-breaker for you then no worries, I will add one, hopefully defaulting to enabled though :-)

    opened by mingwandroid 2
  • How do I use this from the Command Line?

    How do I use this from the Command Line?

    I am wanting to convert some HLSL shader files I have to GLSL and I have managed to compile this tool, but it only seems to work on the test directory. There is no documentation at all. How can I use this to convert my HLSL to GLSL files?

    Thanks in advance

    Swuth

    opened by swuth 0
  • Fix bison calls in Windows

    Fix bison calls in Windows

    You can't use a relative path for bison executable, bacause you don't know where CMake locates the make files. Also the header algorithm is required in Intermediate.cpp because you are using std::min and std::max.

    opened by OgreTransporter 0
  • Can't build on Ubuntu 15.10

    Can't build on Ubuntu 15.10

    Need some help please, I'm getting this error message while trying to build with "cmake . && make":

    [  3%] Executing Bison on hlslang.y
    /bin/sh: 1: bison: not found
    CMakeFiles/hlsl2glsl.dir/build.make:59: recipe for target 'hlslang/MachineIndependent/hlslang_tab.cpp' failed
    make[2]: *** [hlslang/MachineIndependent/hlslang_tab.cpp] Error 127
    CMakeFiles/Makefile2:60: recipe for target 'CMakeFiles/hlsl2glsl.dir/all' failed
    make[1]: *** [CMakeFiles/hlsl2glsl.dir/all] Error 2
    Makefile:75: recipe for target 'all' failed
    make: *** [all] Error 2
    
    opened by Victoralm 2
  • Explicitly request a context version.

    Explicitly request a context version.

    Mesa doesn't default to the latest context. We can either make a context, test GL_VERSION, and parse the result... or just use GLEW and test versions until we get a minimum of each level we need for a given GLSL version.

    Alternatively, we can get rid of freeglut and create a GLX/Xlib context with pixmap. I don't really think it's worth the trouble though...

    The code looks odd but it's easy to explain. glewInit is below of freeglut window initialization because glew requires a context to work. This context isn't created in glutInit but glutCreateWindow. We also have no way to create a context with the desired settings... so we create a dummy context to fetch capabilities, set the capabilities, destroy the dummy context/window, and create a new context/window with desired settings. A core profile is required because Mesa does not support ARB_compatibility.

    opened by computerquip 2
  • Some tests fail under mesa, need to ask for GL core context for GLSL 1.50 support

    Some tests fail under mesa, need to ask for GL core context for GLSL 1.50 support

    Using pull request #63 I was able to build in Linux, some of the tests fail under mesa -

    test array-globalconst-init-in.txt
      glsl compile error:
    0:1(10): error: GLSL 1.50 is not supported. Supported versions are: 1.10, 1.20, 1.30, 1.00 ES, and 3.00 ES
    

    Mesa does support GLSL 1.50, but you need to ask for a core context, if you use the workaround of overridding the GL version, they all pass -

    MESA_GL_VERSION_OVERRIDE=3.3 MESA_GLSL_VERSION_OVERRIDE=330 ./hlsl2glsltest ../tests/

    The solution is that the tests need to ask for the right version by setting the correct window hints.

    opened by stuaxo 3
Owner
Aras Pranckevičius
Code plumber at Unity
Aras Pranckevičius
HLSL Parser and Translator for HLSL, GLSL, and MSL.

HLSLParser This is a fork of Unknownworld's hlslparser adapted to our needs in The Witness. We currently use it to translate pseudo-HLSL shaders (usin

null 316 Nov 15, 2022
GLSL optimizer based on Mesa's GLSL compiler. Used to be used in Unity for mobile shader optimization.

GLSL optimizer ⚠️ As of mid-2016, the project is unlikely to have any significant developments. At Unity we are moving to a different shader compilati

Aras Pranckevičius 1.6k Nov 18, 2022
glslcc: Cross-compiler for GLSL shader language (GLSL->HLSL,METAL,GLES,GLSLv3)

glslcc: Cross-compiler for GLSL shader language (GLSL->HLSL,METAL,GLES,GLSLv3) @septag glslcc is a command line tool that converts GLSL code to HLSL,

Sepehr Taghdisian 432 Nov 24, 2022
⚔️ A tool for cross compiling shaders. Convert between GLSL, HLSL, Metal Shader Language, or older versions of GLSL.

A cross compiler for shader languages. Convert between SPIR-V, GLSL / GLSL ES, HLSL, Metal Shader Language, or older versions of a given language. Cross Shader wraps glslang and SPIRV-Cross, exposing a simpler interface to transpile shaders.

Alain Galvan 179 Nov 18, 2022
exp2swift translator which translates STEP schema files described in ISO 10303-11 STEP EXPRESS language to the Swift programing language.

STEPswiftcode/ exp2swift exp2swift translator which translates STEP schema files described in ISO 10303-11 STEP EXPRESS language to the Swift programi

Tsutomu Yoshida 1 Jan 3, 2022
Minify and obfuscate GLSL or HLSL code

Shader Minifier Shader Minifier is a tool that minifies and obfuscates shader code (GLSL and HLSL). Its original use-case is for the demoscene, for op

Laurent Le Brun 245 Nov 27, 2022
Shader cross compiler to translate HLSL (Shader Model 4 and 5) to GLSL

XShaderCompiler ("Cross Shader Compiler") Features Cross compiles HLSL shader code (Shader Model 4 and 5) into GLSL Simple to integrate into other pro

Lukas Hermanns 346 Oct 1, 2022
Khronos-reference front end for GLSL/ESSL, partial front end for HLSL, and a SPIR-V generator.

News Visual Studio 2013 is no longer supported As scheduled, Microsoft Visual Studio 2013 is no longer officially supported. Please upgrade to at leas

The Khronos Group 2.3k Nov 24, 2022
LLVM IR and optimizer for shaders, including front-end adapters for GLSL and SPIR-V and back-end adapter for GLSL

Licensing LunarGLASS is available via a three clause BSD-style open source license. Goals The primary goals of the LunarGLASS project are: Reduce the

LunarG, Inc. 154 Sep 12, 2022
A Visual Studio extension that provides enhanced support for editing High Level Shading Language (HLSL) files

HLSL Tools for Visual Studio This extension is for Visual Studio 2017 / 2019. Go here for the Visual Studio Code extension. HLSL Tools is a Visual Stu

Tim Jones 427 Nov 22, 2022
VSIX Project that provides GLSL language integration.

GLSL language integration (for VS2017, 2019 and 2022) Download this extension from Visual Studio Marketplace version VS2017 & 2019 or VS 2022 preview

Daniel Scherzer 206 Nov 24, 2022
A concatenative functional language to be used as a sidekick for the mlatu language

gerku _, | | __ _, ___ ,_ __ | | __ _, _, /\___ / _` | / _ \| '__)| |

Remo Dentato 9 Jan 14, 2022
『HLSL シェーダーの魔導書』(ISBN978-4-7981-6428-1)のサンプルファイル

# サンプルデータについて 本データは、『HLSL シェーダーの魔導書』(清原 隆行 著、翔泳社 刊)の付属データです。 なお、本データは以下のサイトから入手可能です。 - Github:https://github.com/shoeisha-books/hlsl-grimoire-sampl

SEBook 翔泳社の本 98 Nov 18, 2022
ShaderConductor is a tool designed for cross-compiling HLSL to other shading languages

ShaderConductor ShaderConductor is a tool designed for cross-compiling HLSL to other shading languages. Features Converts HLSL to readable, usable and

Microsoft 1.5k Nov 25, 2022
Powerful automated tool for reverse engineering Unity IL2CPP binaries

Powerful automated tool for reverse engineering Unity IL2CPP binaries

Katy 2k Nov 26, 2022
A universal way to create a noclip mod in Unity games (Mono/IIL2CPP)

Universal-Unity-NoClip This projects aim to show how a noclip mod can be created in any unity game, regardless if its using an il2cpp or mono backend.

Jonah 23 Nov 11, 2022
Adds proper Apple Pencil support to Unity's InputSystem.

This project aims to create an Apple Pencil device for Unity's InputSystem package. The problem: Unity does not fully integrate with Apple Pencil. App

Oliver Smith 12 Nov 19, 2022
A native plugin for Unity that provides simple packet division and restoration.

uPacketDivision This is a native plug-in that divides a given data (System.IntPtr or array) into specified sizes and restores them regardless of the i

hecomi 4 Feb 20, 2022