* DEALINGS IN THE SOFTWARE.
*/
+#include <stdlib.h>
#include <stdio.h>
#include <getopt.h>
{ "dump-ast", no_argument, &options.dump_ast, 1 },
{ "dump-hir", no_argument, &options.dump_hir, 1 },
{ "dump-lir", no_argument, &options.dump_lir, 1 },
+ { "dump-builder", no_argument, &options.dump_builder, 1 },
{ "link", no_argument, &options.do_link, 1 },
{ "just-log", no_argument, &options.just_log, 1 },
+ { "lower-precision", no_argument, &options.lower_precision, 1 },
{ "version", required_argument, NULL, 'v' },
{ NULL, 0, NULL, 0 }
};
/**
* \brief Print proper usage and exit with failure.
*/
-void
+static void
usage_fail(const char *name)
{
"Possible options are:\n";
printf(header, name);
for (const struct option *o = compiler_opts; o->name != 0; ++o) {
- printf(" --%s\n", o->name);
+ printf(" --%s", o->name);
+ if (o->has_arg == required_argument)
+ printf(" (mandatory)");
+ printf("\n");
}
exit(EXIT_FAILURE);
}
usage_fail(argv[0]);
struct gl_shader_program *whole_program;
+ static struct gl_context local_ctx;
- whole_program = standalone_compile_shader(&options, argc - optind, &argv[optind]);
+ whole_program = standalone_compile_shader(&options, argc - optind,
+ &argv[optind], &local_ctx);
if (!whole_program)
usage_fail(argv[0]);