#include "lima_screen.h"
#include "lima_context.h"
+#include "lima_submit.h"
#include "lima_program.h"
#include "lima_bo.h"
#include "ir/lima_ir.h"
.lower_bitops = true,
.lower_rotate = true,
.lower_sincos = true,
+ .lower_fceil = true,
};
static const nir_shader_compiler_options fs_nir_options = {
.lower_fsign = true,
.lower_rotate = true,
.lower_fdot = true,
+ .lower_fdph = true,
.lower_bitops = true,
.lower_vector_cmp = true,
};
bool progress;
NIR_PASS_V(s, nir_lower_viewport_transform);
+ NIR_PASS_V(s, nir_lower_point_size, 1.0f, 100.0f);
NIR_PASS_V(s, nir_lower_io, nir_var_all, type_size, 0);
NIR_PASS_V(s, nir_lower_load_const_to_scalar);
NIR_PASS_V(s, lima_nir_lower_uniform_to_scalar);
} while (progress);
NIR_PASS_V(s, nir_lower_int_to_float);
- NIR_PASS_V(s, nir_lower_bool_to_float);
-
- /* Some ops must be lowered after being converted from int ops,
- * so re-run nir_opt_algebraic after int lowering. */
+ /* Run opt_algebraic between int_to_float and bool_to_float because
+ * int_to_float emits ftrunc, and ftrunc lowering generates bool ops
+ */
do {
progress = false;
NIR_PASS(progress, s, nir_opt_algebraic);
} while (progress);
+ NIR_PASS_V(s, nir_lower_bool_to_float);
+
NIR_PASS_V(s, nir_copy_prop);
NIR_PASS_V(s, nir_opt_dce);
NIR_PASS_V(s, nir_lower_locals_to_regs);
NIR_PASS_V(s, nir_lower_vars_to_ssa);
NIR_PASS(progress, s, nir_lower_alu_to_scalar, lima_alu_to_scalar_filter_cb, NULL);
- NIR_PASS(progress, s, nir_lower_phis_to_scalar);
NIR_PASS(progress, s, nir_copy_prop);
NIR_PASS(progress, s, nir_opt_remove_phis);
NIR_PASS(progress, s, nir_opt_dce);
nir_var_shader_in |
nir_var_shader_out |
nir_var_function_temp);
+ NIR_PASS(progress, s, lima_nir_split_load_input);
} while (progress);
NIR_PASS_V(s, nir_lower_int_to_float);
return NULL;
}
+ so->uses_discard = nir->info.fs.uses_discard;
+
return so;
}
struct lima_fs_shader_state *so = hwcso;
if (so->bo)
- lima_bo_free(so->bo);
+ lima_bo_unreference(so->bo);
ralloc_free(so);
}
fs->shader = NULL;
}
- ctx->pp_max_stack_size = MAX2(ctx->pp_max_stack_size, ctx->fs->stack_size);
+ struct lima_submit *submit = lima_submit_get(ctx);
+ submit->pp_max_stack_size = MAX2(submit->pp_max_stack_size, ctx->fs->stack_size);
return true;
}
return NULL;
}
+ ralloc_free(nir);
+
return so;
}
struct lima_vs_shader_state *so = hwcso;
if (so->bo)
- lima_bo_free(so->bo);
+ lima_bo_unreference(so->bo);
ralloc_free(so);
}