}
static void
-etna_lower_alu_impl(nir_function_impl *impl, struct etna_compile *c)
+etna_lower_alu_impl(nir_function_impl *impl, bool has_new_transcendentals)
{
nir_shader *shader = impl->function->shader;
if (alu->op == nir_op_fsin || alu->op == nir_op_fcos) {
b.cursor = nir_before_instr(instr);
- nir_ssa_def *imm = c->specs->has_new_transcendentals ?
+ nir_ssa_def *imm = has_new_transcendentals ?
nir_imm_float(&b, 1.0 / M_PI) :
nir_imm_float(&b, 2.0 / M_PI);
/* change transcendental ops to vec2 and insert vec1 mul for the result
* TODO: do this earlier (but it breaks with optimizations)
*/
- if (c->specs->has_new_transcendentals && (
+ if (has_new_transcendentals && (
alu->op == nir_op_fdiv || alu->op == nir_op_flog2 ||
alu->op == nir_op_fsin || alu->op == nir_op_fcos)) {
nir_ssa_def *ssa = &alu->dest.dest.ssa;
}
}
-static void etna_lower_alu(nir_shader *shader, struct etna_compile *c)
+static void etna_lower_alu(nir_shader *shader, bool has_new_transcendentals)
{
nir_foreach_function(function, shader) {
if (function->impl)
- etna_lower_alu_impl(function->impl, c);
+ etna_lower_alu_impl(function->impl, has_new_transcendentals);
}
}
NIR_PASS_V(s, nir_opt_dce);
- NIR_PASS_V(s, etna_lower_alu, c);
+ NIR_PASS_V(s, etna_lower_alu, c->specs->has_new_transcendentals);
if (DBG_ENABLED(ETNA_DBG_DUMP_SHADERS))
nir_print_shader(s, stdout);