/* Do some optimization at compile time to reduce shader IR size
* and reduce later work if the same shader is linked multiple times
*/
- while (do_common_optimization(shader->ir, false, false, 32, options,
+ while (do_common_optimization(shader->ir, false, false, options,
ctx->Const.NativeIntegers))
;
bool
do_common_optimization(exec_list *ir, bool linked,
bool uniform_locations_assigned,
- unsigned max_unroll_iterations,
const struct gl_shader_compiler_options *options,
bool native_integers)
{
loop_state *ls = analyze_loop_variables(ir);
if (ls->loop_found) {
progress = set_loop_controls(ir, ls) || progress;
- progress = unroll_loops(ir, ls, max_unroll_iterations) || progress;
+ progress = unroll_loops(ir, ls, options->MaxUnrollIterations) || progress;
}
delete ls;
bool do_common_optimization(exec_list *ir, bool linked,
bool uniform_locations_assigned,
- unsigned max_unroll_iterations,
const struct gl_shader_compiler_options *options,
bool native_integers);
lower_clip_distance(prog->_LinkedShaders[i]);
}
- unsigned max_unroll = ctx->ShaderCompilerOptions[i].MaxUnrollIterations;
-
while (do_common_optimization(prog->_LinkedShaders[i]->ir, true, false,
- max_unroll, &ctx->ShaderCompilerOptions[i],
+ &ctx->ShaderCompilerOptions[i],
ctx->Const.NativeIntegers))
;
}
int int_3;
int int_4;
- if (sscanf(optimization, "do_common_optimization ( %d , %d ) ",
- &int_0, &int_1) == 2) {
- return do_common_optimization(ir, int_0 != 0, false, int_1, options, true);
+ if (sscanf(optimization, "do_common_optimization ( %d ) ", &int_0) == 1) {
+ return do_common_optimization(ir, int_0 != 0, false, options, true);
} else if (strcmp(optimization, "do_algebraic") == 0) {
return do_algebraic(ir, true);
} else if (strcmp(optimization, "do_constant_folding") == 0) {
false /* loops */
) || progress;
- progress = do_common_optimization(shader->base.ir, true, true, 32,
+ progress = do_common_optimization(shader->base.ir, true, true,
options, ctx->Const.NativeIntegers)
|| progress;
} while (progress);
const struct gl_shader_compiler_options *options =
&ctx->ShaderCompilerOptions[MESA_SHADER_FRAGMENT];
- while (do_common_optimization(p.shader->ir, false, false, 32, options,
+ while (do_common_optimization(p.shader->ir, false, false, options,
ctx->Const.NativeIntegers))
;
reparent_ir(p.shader->ir, p.shader->ir);
progress = do_lower_jumps(ir, true, true, options->EmitNoMainReturn, options->EmitNoCont, options->EmitNoLoops) || progress;
progress = do_common_optimization(ir, true, true,
- options->MaxUnrollIterations,
options, ctx->Const.NativeIntegers)
|| progress;
progress = do_lower_jumps(ir, true, true, options->EmitNoMainReturn, options->EmitNoCont, options->EmitNoLoops) || progress;
- progress = do_common_optimization(ir, true, true,
- options->MaxUnrollIterations,
- options,
+ progress = do_common_optimization(ir, true, true, options,
ctx->Const.NativeIntegers)
|| progress;