Lines Matching defs:nir
24 #include "nir.h"
40 gl_nir_opts(nir_shader *nir)
47 NIR_PASS_V(nir, nir_lower_vars_to_ssa);
54 NIR_PASS(progress, nir, nir_remove_dead_variables,
59 NIR_PASS(progress, nir, nir_opt_copy_prop_vars);
60 NIR_PASS(progress, nir, nir_opt_dead_write_vars);
62 if (nir->options->lower_to_scalar) {
63 NIR_PASS_V(nir, nir_lower_alu_to_scalar,
64 nir->options->lower_to_scalar_filter, NULL);
65 NIR_PASS_V(nir, nir_lower_phis_to_scalar, false);
68 NIR_PASS_V(nir, nir_lower_alu);
69 NIR_PASS_V(nir, nir_lower_pack);
70 NIR_PASS(progress, nir, nir_copy_prop);
71 NIR_PASS(progress, nir, nir_opt_remove_phis);
72 NIR_PASS(progress, nir, nir_opt_dce);
73 if (nir_opt_trivial_continues(nir)) {
75 NIR_PASS(progress, nir, nir_copy_prop);
76 NIR_PASS(progress, nir, nir_opt_dce);
78 NIR_PASS(progress, nir, nir_opt_if, 0);
79 NIR_PASS(progress, nir, nir_opt_dead_cf);
80 NIR_PASS(progress, nir, nir_opt_cse);
81 NIR_PASS(progress, nir, nir_opt_peephole_select, 8, true, true);
83 NIR_PASS(progress, nir, nir_opt_phi_precision);
84 NIR_PASS(progress, nir, nir_opt_algebraic);
85 NIR_PASS(progress, nir, nir_opt_constant_folding);
87 if (!nir->info.flrp_lowered) {
89 (nir->options->lower_flrp16 ? 16 : 0) |
90 (nir->options->lower_flrp32 ? 32 : 0) |
91 (nir->options->lower_flrp64 ? 64 : 0);
96 NIR_PASS(lower_flrp_progress, nir, nir_lower_flrp,
100 NIR_PASS(progress, nir,
109 nir->info.flrp_lowered = true;
112 NIR_PASS(progress, nir, nir_opt_undef);
113 NIR_PASS(progress, nir, nir_opt_conditional_discard);
114 if (nir->options->max_unroll_iterations) {
115 NIR_PASS(progress, nir, nir_opt_loop_unroll);
443 nir_shader *nir, nir_variable_mode modes,
446 nir_foreach_variable_with_modes(var, nir, modes) {
531 nir_shader *nir = sh->Program->nir;
532 assert(nir);
537 nir, nir_var_shader_in | nir_var_system_value,
542 nir, nir_var_shader_out,
773 gl_nir_link_opts(linked_shader[i]->Program->nir,
774 linked_shader[i + 1]->Program->nir);
783 nir_remove_dead_variables(shader->Program->nir,
874 nir_foreach_function(function, prog->_LinkedShaders[i]->Program->nir) {
957 gl_nir_link_opts(linked_shader[i]->Program->nir,
958 linked_shader[i + 1]->Program->nir);
966 gl_nir_opts(linked_shader[0]->Program->nir);
972 nir_lower_const_arrays_to_uniforms(shader->Program->nir,
979 nir_remove_dead_variables(shader->Program->nir,