• Home
  • Raw
  • Download

Lines Matching full:nir

31 #include "nir/nir_builder.h"
36 #include "nir/nir_xfb_info.h"
128 set_image_access(struct lvp_pipeline *pipeline, nir_shader *nir, in set_image_access() argument
139 value += get_set_layout(pipeline->layout, s)->stage[nir->info.stage].image_count; in set_image_access()
141 value += binding->stage[nir->info.stage].image_index; in set_image_access()
146 pipeline->access[nir->info.stage].images_read |= mask; in set_image_access()
148 pipeline->access[nir->info.stage].images_written |= mask; in set_image_access()
152 set_buffer_access(struct lvp_pipeline *pipeline, nir_shader *nir, in set_buffer_access() argument
161 var = nir_get_binding_variable(nir, b); in set_buffer_access()
173 value += get_set_layout(pipeline->layout, s)->stage[nir->info.stage].shader_buffer_count; in set_buffer_access()
175 value += binding->stage[nir->info.stage].shader_buffer_index; in set_buffer_access()
179 pipeline->access[nir->info.stage].buffers_written |= mask; in set_buffer_access()
183 scan_intrinsic(struct lvp_pipeline *pipeline, nir_shader *nir, nir_intrinsic_instr *instr) in scan_intrinsic() argument
190 set_image_access(pipeline, nir, instr, true, false); in scan_intrinsic()
193 set_image_access(pipeline, nir, instr, false, true); in scan_intrinsic()
206 set_image_access(pipeline, nir, instr, true, true); in scan_intrinsic()
223 set_buffer_access(pipeline, nir, instr); in scan_intrinsic()
230 scan_pipeline_info(struct lvp_pipeline *pipeline, nir_shader *nir) in scan_pipeline_info() argument
232 nir_foreach_function(function, nir) { in scan_pipeline_info()
237 scan_intrinsic(pipeline, nir, nir_instr_as_intrinsic(instr)); in scan_pipeline_info()
262 remove_scoped_barriers(nir_shader *nir, bool is_compute) in remove_scoped_barriers() argument
264 …return nir_shader_instructions_pass(nir, remove_scoped_barriers_impl, nir_metadata_dominance, (voi… in remove_scoped_barriers()
285 lower_demote(nir_shader *nir) in lower_demote() argument
287 return nir_shader_instructions_pass(nir, lower_demote_impl, nir_metadata_dominance, NULL); in lower_demote()
324 optimize(nir_shader *nir) in optimize() argument
330 NIR_PASS(progress, nir, nir_lower_flrp, 32|64, true); in optimize()
331 NIR_PASS(progress, nir, nir_split_array_vars, nir_var_function_temp); in optimize()
332 NIR_PASS(progress, nir, nir_shrink_vec_array_vars, nir_var_function_temp); in optimize()
333 NIR_PASS(progress, nir, nir_opt_deref); in optimize()
334 NIR_PASS(progress, nir, nir_lower_vars_to_ssa); in optimize()
336 NIR_PASS(progress, nir, nir_opt_copy_prop_vars); in optimize()
338 NIR_PASS(progress, nir, nir_copy_prop); in optimize()
339 NIR_PASS(progress, nir, nir_opt_dce); in optimize()
340 NIR_PASS(progress, nir, nir_opt_peephole_select, 8, true, true); in optimize()
342 NIR_PASS(progress, nir, nir_opt_algebraic); in optimize()
343 NIR_PASS(progress, nir, nir_opt_constant_folding); in optimize()
345 NIR_PASS(progress, nir, nir_opt_remove_phis); in optimize()
347 NIR_PASS(trivial_continues, nir, nir_opt_trivial_continues); in optimize()
354 NIR_PASS(progress, nir, nir_copy_prop); in optimize()
355 NIR_PASS(progress, nir, nir_opt_dce); in optimize()
356 NIR_PASS(progress, nir, nir_opt_remove_phis); in optimize()
358 …NIR_PASS(progress, nir, nir_opt_if, nir_opt_if_aggressive_last_continue | nir_opt_if_optimize_phi_… in optimize()
359 NIR_PASS(progress, nir, nir_opt_dead_cf); in optimize()
360 NIR_PASS(progress, nir, nir_opt_conditional_discard); in optimize()
361 NIR_PASS(progress, nir, nir_opt_remove_phis); in optimize()
362 NIR_PASS(progress, nir, nir_opt_cse); in optimize()
363 NIR_PASS(progress, nir, nir_opt_undef); in optimize()
365 NIR_PASS(progress, nir, nir_opt_deref); in optimize()
366 NIR_PASS(progress, nir, nir_lower_alu_to_scalar, NULL, NULL); in optimize()
367 NIR_PASS(progress, nir, nir_opt_loop_unroll); in optimize()
368 NIR_PASS(progress, nir, lvp_nir_fixup_indirect_tex); in optimize()
373 lvp_shader_optimize(nir_shader *nir) in lvp_shader_optimize() argument
375 optimize(nir); in lvp_shader_optimize()
376 NIR_PASS_V(nir, nir_lower_var_copies); in lvp_shader_optimize()
377 NIR_PASS_V(nir, nir_remove_dead_variables, nir_var_function_temp, NULL); in lvp_shader_optimize()
378 NIR_PASS_V(nir, nir_opt_dce); in lvp_shader_optimize()
379 nir_sweep(nir); in lvp_shader_optimize()
390 nir_shader *nir; in lvp_shader_compile_to_ir() local
440 NULL, &nir); in lvp_shader_compile_to_ir()
444 if (nir->info.stage != MESA_SHADER_TESS_CTRL) in lvp_shader_compile_to_ir()
445 NIR_PASS_V(nir, remove_scoped_barriers, nir->info.stage == MESA_SHADER_COMPUTE); in lvp_shader_compile_to_ir()
451 NIR_PASS_V(nir, nir_lower_sysvals_to_varyings, &sysvals_to_varyings); in lvp_shader_compile_to_ir()
457 NIR_PASS_V(nir, nir_lower_subgroups, &subgroup_opts); in lvp_shader_compile_to_ir()
460 lvp_lower_input_attachments(nir, false); in lvp_shader_compile_to_ir()
461 NIR_PASS_V(nir, nir_lower_is_helper_invocation); in lvp_shader_compile_to_ir()
462 NIR_PASS_V(nir, lower_demote); in lvp_shader_compile_to_ir()
463 NIR_PASS_V(nir, nir_lower_system_values); in lvp_shader_compile_to_ir()
464 NIR_PASS_V(nir, nir_lower_compute_system_values, NULL); in lvp_shader_compile_to_ir()
466 NIR_PASS_V(nir, nir_remove_dead_variables, in lvp_shader_compile_to_ir()
469 scan_pipeline_info(pipeline, nir); in lvp_shader_compile_to_ir()
471 optimize(nir); in lvp_shader_compile_to_ir()
472 lvp_lower_pipeline_layout(pipeline->device, pipeline->layout, nir); in lvp_shader_compile_to_ir()
474 NIR_PASS_V(nir, nir_lower_io_to_temporaries, nir_shader_get_entrypoint(nir), true, true); in lvp_shader_compile_to_ir()
475 NIR_PASS_V(nir, nir_split_var_copies); in lvp_shader_compile_to_ir()
476 NIR_PASS_V(nir, nir_lower_global_vars_to_local); in lvp_shader_compile_to_ir()
478 NIR_PASS_V(nir, nir_lower_explicit_io, nir_var_mem_push_const, in lvp_shader_compile_to_ir()
481 NIR_PASS_V(nir, nir_lower_explicit_io, in lvp_shader_compile_to_ir()
485 NIR_PASS_V(nir, nir_lower_explicit_io, in lvp_shader_compile_to_ir()
489 if (nir->info.stage == MESA_SHADER_COMPUTE) { in lvp_shader_compile_to_ir()
490 NIR_PASS_V(nir, nir_lower_vars_to_explicit_types, nir_var_mem_shared, shared_var_info); in lvp_shader_compile_to_ir()
491 NIR_PASS_V(nir, nir_lower_explicit_io, nir_var_mem_shared, nir_address_format_32bit_offset); in lvp_shader_compile_to_ir()
494 NIR_PASS_V(nir, nir_remove_dead_variables, nir_var_shader_temp, NULL); in lvp_shader_compile_to_ir()
496 if (nir->info.stage == MESA_SHADER_VERTEX || in lvp_shader_compile_to_ir()
497 nir->info.stage == MESA_SHADER_GEOMETRY) { in lvp_shader_compile_to_ir()
498 NIR_PASS_V(nir, nir_lower_io_arrays_to_elements_no_indirects, false); in lvp_shader_compile_to_ir()
499 } else if (nir->info.stage == MESA_SHADER_FRAGMENT) { in lvp_shader_compile_to_ir()
500 NIR_PASS_V(nir, nir_lower_io_arrays_to_elements_no_indirects, true); in lvp_shader_compile_to_ir()
509 NIR_PASS_V(nir, nir_fold_16bit_tex_image, &fold_16bit_options); in lvp_shader_compile_to_ir()
511 lvp_shader_optimize(nir); in lvp_shader_compile_to_ir()
513 nir_shader_gather_info(nir, nir_shader_get_entrypoint(nir)); in lvp_shader_compile_to_ir()
515 if (nir->info.stage != MESA_SHADER_VERTEX) in lvp_shader_compile_to_ir()
516 nir_assign_io_var_locations(nir, nir_var_shader_in, &nir->num_inputs, nir->info.stage); in lvp_shader_compile_to_ir()
518 nir->num_inputs = util_last_bit64(nir->info.inputs_read); in lvp_shader_compile_to_ir()
519 nir_foreach_shader_in_variable(var, nir) { in lvp_shader_compile_to_ir()
523 nir_assign_io_var_locations(nir, nir_var_shader_out, &nir->num_outputs, in lvp_shader_compile_to_ir()
524 nir->info.stage); in lvp_shader_compile_to_ir()
526 nir_function_impl *impl = nir_shader_get_entrypoint(nir); in lvp_shader_compile_to_ir()
528 pipeline->inlines[stage].must_inline = lvp_find_inlinable_uniforms(pipeline, nir); in lvp_shader_compile_to_ir()
529 pipeline->pipeline_nir[stage] = nir; in lvp_shader_compile_to_ir()
614 lvp_pipeline_compile_stage(struct lvp_pipeline *pipeline, nir_shader *nir) in lvp_pipeline_compile_stage() argument
617 if (nir->info.stage == MESA_SHADER_COMPUTE) { in lvp_pipeline_compile_stage()
619 shstate.prog = nir; in lvp_pipeline_compile_stage()
621 shstate.req_local_mem = nir->info.shared_size; in lvp_pipeline_compile_stage()
626 shstate.ir.nir = nir; in lvp_pipeline_compile_stage()
627 if (nir->info.stage == pipeline->last_vertex) in lvp_pipeline_compile_stage()
630 switch (nir->info.stage) { in lvp_pipeline_compile_stage()
650 lvp_pipeline_compile(struct lvp_pipeline *pipeline, nir_shader *nir) in lvp_pipeline_compile() argument
653 device->physical_device->pscreen->finalize_nir(device->physical_device->pscreen, nir); in lvp_pipeline_compile()
654 return lvp_pipeline_compile_stage(pipeline, nir); in lvp_pipeline_compile()
903 shstate.ir.nir = nir_shader_clone(NULL, pipeline->pipeline_nir[MESA_SHADER_FRAGMENT]); in lvp_graphics_pipeline_init()