}
static GLboolean
-do_optimization(struct exec_list *ir, const char *optimization)
+do_optimization(struct exec_list *ir, const char *optimization,
+ const struct gl_shader_compiler_options *options)
{
int int_0;
int int_1;
if (sscanf(optimization, "do_common_optimization ( %d , %d ) ",
&int_0, &int_1) == 2) {
- return do_common_optimization(ir, int_0 != 0, false, int_1);
+ return do_common_optimization(ir, int_0 != 0, false, int_1, options);
} else if (strcmp(optimization, "do_algebraic") == 0) {
return do_algebraic(ir);
} else if (strcmp(optimization, "do_constant_folding") == 0) {
static GLboolean
do_optimization_passes(struct exec_list *ir, char **optimizations,
- int num_optimizations, bool quiet)
+ int num_optimizations, bool quiet,
+ const struct gl_shader_compiler_options *options)
{
GLboolean overall_progress = false;
if (!quiet) {
printf("*** Running optimization %s...", optimization);
}
- GLboolean progress = do_optimization(ir, optimization);
+ GLboolean progress = do_optimization(ir, optimization, options);
if (!quiet) {
printf("%s\n", progress ? "progress" : "no progress");
}
/* Optimization passes */
if (!state->error) {
GLboolean progress;
+ const struct gl_shader_compiler_options *options =
+ &ctx->ShaderCompilerOptions[_mesa_shader_type_to_index(shader_type)];
do {
progress = do_optimization_passes(shader->ir, &argv[optind],
- argc - optind, quiet != 0);
+ argc - optind, quiet != 0, options);
} while (loop && progress);
}