diff options
Diffstat (limited to 'src/mesa/drivers/glslcompiler')
-rw-r--r-- | src/mesa/drivers/glslcompiler/Makefile | 4 | ||||
-rw-r--r-- | src/mesa/drivers/glslcompiler/glslcompiler.c | 26 |
2 files changed, 17 insertions, 13 deletions
diff --git a/src/mesa/drivers/glslcompiler/Makefile b/src/mesa/drivers/glslcompiler/Makefile index 858457ddd4..ffe4e0a234 100644 --- a/src/mesa/drivers/glslcompiler/Makefile +++ b/src/mesa/drivers/glslcompiler/Makefile @@ -33,7 +33,7 @@ default: $(PROGRAM) glslcompiler: $(OBJECTS) - $(CC) $(OBJECTS) -lm -lpthread -o $@ + $(CC) $(OBJECTS) $(GL_LIB_DEPS) -o $@ glslcompiler.o: glslcompiler.c @@ -41,4 +41,4 @@ glslcompiler.o: glslcompiler.c clean: - rm -f *.o *~ $(PROGRAM) + -rm -f *.o *~ $(PROGRAM) diff --git a/src/mesa/drivers/glslcompiler/glslcompiler.c b/src/mesa/drivers/glslcompiler/glslcompiler.c index 016b53d57a..54a4c1a7c6 100644 --- a/src/mesa/drivers/glslcompiler/glslcompiler.c +++ b/src/mesa/drivers/glslcompiler/glslcompiler.c @@ -45,11 +45,11 @@ */ -#include "imports.h" -#include "context.h" -#include "extensions.h" -#include "framebuffer.h" -#include "shaders.h" +#include "main/imports.h" +#include "main/context.h" +#include "main/extensions.h" +#include "main/framebuffer.h" +#include "main/shaders.h" #include "shader/shader_api.h" #include "shader/prog_print.h" #include "drivers/common/driverfuncs.h" @@ -72,6 +72,7 @@ struct options { const char *VertFile; const char *FragFile; const char *OutputFile; + GLboolean Params; }; static struct options Options; @@ -226,12 +227,10 @@ PrintShaderInstructions(GLuint shader, FILE *f) { GET_CURRENT_CONTEXT(ctx); struct gl_shader *sh = _mesa_lookup_shader(ctx, shader); - GLuint i; - - for (i = 0; i < sh->NumPrograms; i++) { - struct gl_program *prog = sh->Programs[i]; - _mesa_print_program_opt(prog, Options.Mode, Options.LineNumbers); - } + 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); } @@ -262,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"); } @@ -276,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(); @@ -309,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); |