Lines Matching defs:nir

36 #include "compiler/nir/nir_builder.h"
326 optimise_nir(nir_shader *nir, unsigned quirks, bool is_blend, bool is_blit)
330 (nir->options->lower_flrp16 ? 16 : 0) |
331 (nir->options->lower_flrp32 ? 32 : 0) |
332 (nir->options->lower_flrp64 ? 64 : 0);
334 NIR_PASS(progress, nir, nir_lower_regs_to_ssa);
339 NIR_PASS(progress, nir, nir_lower_idiv, &idiv_options);
350 NIR_PASS(progress, nir, nir_lower_tex, &lower_tex_options);
358 NIR_PASS_V(nir, midgard_nir_lod_errata);
361 NIR_PASS(progress, nir, midgard_nir_lower_image_bitsize);
362 NIR_PASS(progress, nir, midgard_nir_lower_helper_writes);
363 NIR_PASS(progress, nir, pan_lower_helper_invocation);
364 NIR_PASS(progress, nir, pan_lower_sample_pos);
366 if (nir->xfb_info != NULL && nir->info.has_transform_feedback_varyings) {
367 NIR_PASS_V(nir, nir_io_add_const_offset_to_base,
369 NIR_PASS_V(nir, nir_io_add_intrinsic_xfb_info);
370 NIR_PASS_V(nir, pan_lower_xfb);
373 NIR_PASS(progress, nir, midgard_nir_lower_algebraic_early);
374 NIR_PASS_V(nir, nir_lower_alu_to_scalar, mdg_should_scalarize, NULL);
379 NIR_PASS(progress, nir, nir_lower_var_copies);
380 NIR_PASS(progress, nir, nir_lower_vars_to_ssa);
382 NIR_PASS(progress, nir, nir_copy_prop);
383 NIR_PASS(progress, nir, nir_opt_remove_phis);
384 NIR_PASS(progress, nir, nir_opt_dce);
385 NIR_PASS(progress, nir, nir_opt_dead_cf);
386 NIR_PASS(progress, nir, nir_opt_cse);
387 NIR_PASS(progress, nir, nir_opt_peephole_select, 64, false, true);
388 NIR_PASS(progress, nir, nir_opt_algebraic);
389 NIR_PASS(progress, nir, nir_opt_constant_folding);
394 nir,
399 NIR_PASS(progress, nir,
410 NIR_PASS(progress, nir, nir_opt_undef);
411 NIR_PASS(progress, nir, nir_lower_undef_to_zero);
413 NIR_PASS(progress, nir, nir_opt_loop_unroll);
415 NIR_PASS(progress, nir, nir_opt_vectorize,
419 NIR_PASS_V(nir, nir_lower_alu_to_scalar, mdg_should_scalarize, NULL);
423 NIR_PASS(progress, nir, nir_fuse_io_16);
426 NIR_PASS(progress, nir, midgard_nir_scale_trig);
431 NIR_PASS(progress, nir, nir_opt_dce);
432 NIR_PASS(progress, nir, nir_opt_algebraic);
433 NIR_PASS(progress, nir, nir_opt_constant_folding);
434 NIR_PASS(progress, nir, nir_copy_prop);
437 NIR_PASS(progress, nir, nir_opt_algebraic_late);
438 NIR_PASS(progress, nir, nir_opt_algebraic_distribute_src_mods);
441 NIR_PASS(progress, nir, nir_lower_bool_to_int32);
444 NIR_PASS(progress, nir, midgard_nir_lower_algebraic_late);
445 NIR_PASS(progress, nir, midgard_nir_cancel_inot);
447 NIR_PASS(progress, nir, nir_copy_prop);
448 NIR_PASS(progress, nir, nir_opt_dce);
456 NIR_PASS_V(nir, nir_opt_sink, move_all);
457 NIR_PASS_V(nir, nir_opt_move, move_all);
460 NIR_PASS(progress, nir, nir_lower_locals_to_regs);
461 NIR_PASS(progress, nir, nir_convert_from_ssa, true);
464 NIR_PASS(progress, nir, nir_move_vec_src_uses_to_dest);
465 NIR_PASS(progress, nir, nir_lower_vec_to_movs, NULL, NULL);
467 NIR_PASS(progress, nir, nir_opt_dce);
534 #define ATOMIC_CASE_IMPL(ctx, instr, nir, op, is_shared) \
535 case nir_intrinsic_##nir: \
539 #define ATOMIC_CASE(ctx, instr, nir, op) \
540 ATOMIC_CASE_IMPL(ctx, instr, shared_atomic_##nir, atomic_##op, true); \
541 ATOMIC_CASE_IMPL(ctx, instr, global_atomic_##nir, atomic_##op, false);
543 #define IMAGE_ATOMIC_CASE(ctx, instr, nir, op) \
544 case nir_intrinsic_image_atomic_##nir: { \
550 #define ALU_CASE(nir, _op) \
551 case nir_op_##nir: \
556 #define ALU_CASE_RTZ(nir, _op) \
557 case nir_op_##nir: \
566 #define ALU_CASE_BCAST(nir, _op, count) \
567 case nir_op_##nir: \
573 #define ALU_CASE_CMP(nir, _op) \
574 case nir_op_##nir: \
1487 util_bitcount64(ctx->nir->info.inputs_read) : 0;
1585 ctx->nir->info.num_ubos;
1751 var = nir_find_variable_with_driver_location(ctx->nir, nir_var_shader_out, nir_intrinsic_base(instr));
1980 nir_find_variable_with_driver_location(ctx->nir, nir_var_shader_out,
3128 midgard_compile_shader_nir(nir_shader *nir,
3142 ctx->nir = nir;
3144 ctx->stage = nir->info.stage;
3167 NIR_PASS_V(nir, nir_lower_vars_to_ssa);
3170 NIR_PASS_V(nir, nir_lower_viewport_transform);
3171 NIR_PASS_V(nir, nir_lower_point_size, 1.0, 0.0);
3174 NIR_PASS_V(nir, nir_lower_var_copies);
3175 NIR_PASS_V(nir, nir_lower_vars_to_ssa);
3176 NIR_PASS_V(nir, nir_split_var_copies);
3177 NIR_PASS_V(nir, nir_lower_var_copies);
3178 NIR_PASS_V(nir, nir_lower_global_vars_to_local);
3179 NIR_PASS_V(nir, nir_lower_var_copies);
3180 NIR_PASS_V(nir, nir_lower_vars_to_ssa);
3182 NIR_PASS_V(nir, pan_lower_framebuffer,
3186 NIR_PASS_V(nir, nir_lower_io, nir_var_shader_in | nir_var_shader_out,
3188 NIR_PASS_V(nir, nir_lower_ssbo);
3189 NIR_PASS_V(nir, pan_nir_lower_zs_store);
3191 NIR_PASS_V(nir, pan_nir_lower_64bit_intrin);
3193 NIR_PASS_V(nir, midgard_nir_lower_global_load);
3197 optimise_nir(nir, ctx->quirks, inputs->is_blend, inputs->is_blit);
3199 bool skip_internal = nir->info.internal;
3203 nir_print_shader(nir, stdout);
3205 info->tls_size = nir->scratch_size;
3207 nir_foreach_function(func, nir) {
3216 if (nir->info.outputs_read && !inputs->is_blend) {
3329 info->ubo_mask = ctx->ubo_mask & ((1 << ctx->nir->info.num_ubos) - 1);
3345 !nir->info.internal) {
3375 ctx->nir->info.label ?: "",