diff options
author | Brian Paul <brianp@vmware.com> | 2009-02-17 15:57:46 -0700 |
---|---|---|
committer | Brian Paul <brianp@vmware.com> | 2009-02-17 16:17:13 -0700 |
commit | edd8cb8c872369b5a1d1abfd221ac12e27169acb (patch) | |
tree | bb4898d663e6795e982aa31bb115d7983573f73f /src/mesa | |
parent | f88a9015985f1e308496803630221f284a94f397 (diff) |
glsl: added --params option to stand-alone GLSL compiler
Prints program parameter info
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/drivers/glslcompiler/glslcompiler.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mesa/drivers/glslcompiler/glslcompiler.c b/src/mesa/drivers/glslcompiler/glslcompiler.c index 918ec41856..54a4c1a7c6 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); |