Commit 4b642a6d by Shahbaz Youssefi Committed by Commit Bot

Desktop GLSL input + Vulkan GLSL output in shader_translator

This is a sample program that can be used to compile a shader and inspect the intermediate tree or the output from the shader translator. This change adds support for the recently added desktop GLSL inputs as well as the ability to produce Vulkan GLSL output. Bug: angleproject:3453 Change-Id: I1f378e8d84b74636d6a47ce1aaff5f1f55f5bbb3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1784881Reviewed-by: 's avatarCody Northrop <cnorthrop@google.com> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
parent d4b3120e
...@@ -146,6 +146,16 @@ int main(int argc, char *argv[]) ...@@ -146,6 +146,16 @@ int main(int argc, char *argv[])
resources.FragmentPrecisionHigh = 1; resources.FragmentPrecisionHigh = 1;
} }
break; break;
case 'd':
if (argv[0][4] == 'c')
{
spec = SH_GL_COMPATIBILITY_SPEC;
}
else
{
spec = SH_GL_CORE_SPEC;
}
break;
default: default:
failCode = EFailUsage; failCode = EFailUsage;
} }
...@@ -171,6 +181,10 @@ int main(int argc, char *argv[]) ...@@ -171,6 +181,10 @@ int main(int argc, char *argv[])
} }
compileOptions |= SH_INITIALIZE_UNINITIALIZED_LOCALS; compileOptions |= SH_INITIALIZE_UNINITIALIZED_LOCALS;
break; break;
case 'v':
output = SH_GLSL_VULKAN_OUTPUT;
compileOptions |= SH_INITIALIZE_UNINITIALIZED_LOCALS;
break;
case 'h': case 'h':
if (argv[0][4] == '1' && argv[0][5] == '1') if (argv[0][4] == '1' && argv[0][5] == '1')
{ {
...@@ -378,10 +392,13 @@ void usage() ...@@ -378,10 +392,13 @@ void usage()
" -s=w : use WebGL 1.0 spec\n" " -s=w : use WebGL 1.0 spec\n"
" -s=wn : use WebGL 1.0 spec with no highp support in fragment shaders\n" " -s=wn : use WebGL 1.0 spec with no highp support in fragment shaders\n"
" -s=w2 : use WebGL 2.0 spec\n" " -s=w2 : use WebGL 2.0 spec\n"
" -s=d : use Desktop Core spec (in development)\n"
" -s=dc : use Desktop Compatibility spec (in development)\n"
" -b=e : output GLSL ES code (this is by default)\n" " -b=e : output GLSL ES code (this is by default)\n"
" -b=g : output GLSL code (compatibility profile)\n" " -b=g : output GLSL code (compatibility profile)\n"
" -b=g[NUM]: output GLSL code (NUM can be 130, 140, 150, 330, 400, 410, 420, 430, " " -b=g[NUM]: output GLSL code (NUM can be 130, 140, 150, 330, 400, 410, 420, 430, "
"440, 450)\n" "440, 450)\n"
" -b=v : output Vulkan GLSL code\n"
" -b=h9 : output HLSL9 code\n" " -b=h9 : output HLSL9 code\n"
" -b=h11 : output HLSL11 code\n" " -b=h11 : output HLSL11 code\n"
" -x=i : enable GL_OES_EGL_image_external\n" " -x=i : enable GL_OES_EGL_image_external\n"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment