diff --git a/tools/shaderc/shaderc.cpp b/tools/shaderc/shaderc.cpp index a8c854d2c..50c2c0f5e 100644 --- a/tools/shaderc/shaderc.cpp +++ b/tools/shaderc/shaderc.cpp @@ -67,6 +67,17 @@ static const char* s_OES_texture_3D[] = NULL }; +static const char* s_130[] = +{ + "uint", + "uint2", + "uint3", + "uint4", + "isampler3D", + "usampler3D", + NULL +}; + const char* s_uniformTypeName[UniformType::Count] = { "int", @@ -1666,13 +1677,17 @@ int main(int _argc, const char* _argv[]) if (0 == essl) { + const bool need130 = 120 == glsl + && bx::findIdentifierMatch(input, s_130) + ; + if (0 != metal) { bx::stringPrintf(code, "#version 120\n"); } else { - bx::stringPrintf(code, "#version %s\n", profile); + bx::stringPrintf(code, "#version %s\n", need130 ? "130" : profile); } bx::stringPrintf(code