On Haswell, this cuts 1-3 instructions from 183 vertex shaders in
"Shadowrun Returns", "Shatter", and "Trine 2." It adds 2 instructions
to a single fragment shader in "Closure."
total instructions in shared programs: 278803 -> 278546 (-0.09%)
instructions in affected programs: 41930 -> 41673 (-0.61%)
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
#include "prog_parameter.h"
#include "prog_statevars.h"
#include "prog_instruction.h"
+#include "prog_optimize.h"
#include "program_parser.h"
return;
}
+ if ((ctx->_Shader->Flags & GLSL_NO_OPT) == 0)
+ _mesa_optimize_program(ctx, &prog);
+
free(program->Base.String);
/* Copy the relevant contents of the arb_program struct into the
return;
}
+ if ((ctx->_Shader->Flags & GLSL_NO_OPT) == 0)
+ _mesa_optimize_program(ctx, &prog);
+
free(program->Base.String);
/* Copy the relevant contents of the arb_program struct into the