From: Brian Paul Date: Tue, 17 Feb 2009 22:57:46 +0000 (-0700) Subject: glsl: added --params option to stand-alone GLSL compiler X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=edd8cb8c872369b5a1d1abfd221ac12e27169acb;p=mesa.git glsl: added --params option to stand-alone GLSL compiler Prints program parameter info --- diff --git a/src/mesa/drivers/glslcompiler/glslcompiler.c b/src/mesa/drivers/glslcompiler/glslcompiler.c index 918ec418563..54a4c1a7c6d 100644 --- a/src/mesa/drivers/glslcompiler/glslcompiler.c +++ b/src/mesa/drivers/glslcompiler/glslcompiler.c @@ -72,6 +72,7 @@ struct options { const char *VertFile; const char *FragFile; const char *OutputFile; + GLboolean Params; }; static struct options Options; @@ -228,6 +229,8 @@ PrintShaderInstructions(GLuint shader, FILE *f) struct gl_shader *sh = _mesa_lookup_shader(ctx, shader); struct gl_program *prog = sh->Program; _mesa_fprint_program_opt(stdout, prog, Options.Mode, Options.LineNumbers); + if (Options.Params) + _mesa_print_program_parameters(ctx, prog); } @@ -258,6 +261,7 @@ Usage(void) printf(" --debug emit debug-style instructions\n"); printf(" --number, -n emit line numbers\n"); printf(" --output, -o FILE output filename\n"); + printf(" --params also emit program parameter info\n"); printf(" --help display this information\n"); } @@ -272,6 +276,7 @@ ParseOptions(int argc, char *argv[]) Options.VertFile = NULL; Options.FragFile = NULL; Options.OutputFile = NULL; + Options.Params = GL_FALSE; if (argc == 1) { Usage(); @@ -305,6 +310,9 @@ ParseOptions(int argc, char *argv[]) Options.OutputFile = argv[i + 1]; i++; } + else if (strcmp(argv[i], "--params") == 0) { + Options.Params = GL_TRUE; + } else if (strcmp(argv[i], "--help") == 0) { Usage(); exit(0);