From 86839f6e2e42e2a033cc7920cb436d81753b8179 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Sun, 18 Oct 2015 19:35:46 -0700 Subject: [PATCH] shaderc: GLSL autodetect use of profile 130. --- tools/shaderc/shaderc.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) 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