Lines Matching defs:nir

28 #include "compiler/nir/nir_builder.h"
338 nir_find_variable_with_driver_location(b->shader->nir,
348 if (b->shader->nir->info.internal) {
357 if (b->shader->nir->info.fs.uses_discard) {
375 nir_find_variable_with_driver_location(b->shader->nir,
419 unsigned num_ubos = b->shader->nir->info.num_ubos;
1341 ctx->nir->info.label ?: "",
1441 agx_optimize_nir(nir_shader *nir)
1450 NIR_PASS_V(nir, nir_lower_regs_to_ssa);
1451 NIR_PASS_V(nir, nir_lower_int64);
1452 NIR_PASS_V(nir, nir_lower_idiv, &idiv_options);
1453 NIR_PASS_V(nir, nir_lower_alu_to_scalar, NULL, NULL);
1454 NIR_PASS_V(nir, nir_lower_load_const_to_scalar);
1455 NIR_PASS_V(nir, nir_lower_flrp, 16 | 32 | 64, false);
1456 NIR_PASS_V(nir, agx_lower_sincos);
1457 NIR_PASS_V(nir, nir_shader_instructions_pass,
1464 NIR_PASS(progress, nir, nir_lower_var_copies);
1465 NIR_PASS(progress, nir, nir_lower_vars_to_ssa);
1467 NIR_PASS(progress, nir, nir_copy_prop);
1468 NIR_PASS(progress, nir, nir_opt_remove_phis);
1469 NIR_PASS(progress, nir, nir_lower_phis_to_scalar, true);
1470 NIR_PASS(progress, nir, nir_opt_dce);
1471 NIR_PASS(progress, nir, nir_opt_dead_cf);
1472 NIR_PASS(progress, nir, nir_opt_cse);
1473 NIR_PASS(progress, nir, nir_opt_peephole_select, 64, false, true);
1474 NIR_PASS(progress, nir, nir_opt_algebraic);
1475 NIR_PASS(progress, nir, nir_opt_constant_folding);
1477 NIR_PASS(progress, nir, nir_opt_undef);
1478 NIR_PASS(progress, nir, nir_lower_undef_to_zero);
1480 NIR_PASS(progress, nir, nir_opt_loop_unroll);
1483 NIR_PASS_V(nir, nir_opt_algebraic_late);
1484 NIR_PASS_V(nir, nir_opt_constant_folding);
1485 NIR_PASS_V(nir, nir_copy_prop);
1486 NIR_PASS_V(nir, nir_opt_dce);
1487 NIR_PASS_V(nir, nir_opt_cse);
1488 NIR_PASS_V(nir, nir_lower_alu_to_scalar, NULL, NULL);
1489 NIR_PASS_V(nir, nir_lower_load_const_to_scalar);
1496 NIR_PASS_V(nir, nir_opt_sink, move_all);
1497 NIR_PASS_V(nir, nir_opt_move, move_all);
1498 NIR_PASS_V(nir, nir_lower_phis_to_scalar, true);
1503 agx_remap_varyings_vs(nir_shader *nir, struct agx_varyings *varyings,
1508 nir_variable *pos = nir_find_variable_with_location(nir, nir_var_shader_out, VARYING_SLOT_POS);
1515 nir_foreach_shader_out_variable(var, nir) {
1527 nir_variable *psiz = nir_find_variable_with_location(nir, nir_var_shader_out, VARYING_SLOT_PSIZ);
1538 agx_remap_varyings_fs(nir_shader *nir, struct agx_varyings *varyings,
1564 nir_foreach_shader_in_variable(var, nir) {
1579 nir_foreach_shader_in_variable(var, nir) {
1613 agx_flat_varying_mask(nir_shader *nir)
1617 assert(nir->info.stage == MESA_SHADER_FRAGMENT);
1619 nir_foreach_shader_in_variable(var, nir) {
1628 agx_compile_shader_nir(nir_shader *nir,
1636 ctx->nir = nir;
1639 ctx->stage = nir->info.stage;
1643 out->writes_psiz = nir->info.outputs_written &
1647 NIR_PASS_V(nir, nir_lower_vars_to_ssa);
1650 NIR_PASS_V(nir, nir_lower_vars_to_scratch, nir_var_function_temp, 16,
1652 NIR_PASS_V(nir, nir_lower_indirect_derefs, nir_var_function_temp, ~0);
1657 NIR_PASS_V(nir, nir_lower_clip_halfz);
1660 NIR_PASS_V(nir, nir_split_var_copies);
1661 NIR_PASS_V(nir, nir_lower_global_vars_to_local);
1662 NIR_PASS_V(nir, nir_lower_var_copies);
1663 NIR_PASS_V(nir, nir_lower_vars_to_ssa);
1664 NIR_PASS_V(nir, nir_lower_io, nir_var_shader_in | nir_var_shader_out,
1672 NIR_PASS_V(nir, nir_lower_mediump_io,
1674 ~agx_flat_varying_mask(nir), false);
1676 NIR_PASS_V(nir, nir_shader_instructions_pass,
1680 NIR_PASS_V(nir, nir_lower_ssbo);
1684 NIR_PASS_V(nir, nir_lower_io_to_scalar, nir_var_shader_out);
1698 NIR_PASS_V(nir, nir_lower_tex, &lower_tex_options);
1699 NIR_PASS_V(nir, nir_legalize_16bit_sampler_srcs, tex_constraints);
1701 agx_optimize_nir(nir);
1704 NIR_PASS_V(nir, nir_lower_discard_if);
1708 agx_remap_varyings_vs(nir, &out->varyings, ctx->varyings);
1710 agx_remap_varyings_fs(nir, &out->varyings, ctx->varyings);
1713 bool skip_internal = nir->info.internal;
1717 nir_print_shader(nir, stdout);
1722 nir_foreach_function(func, nir) {