| /third_party/mesa3d/src/gallium/drivers/radeonsi/ |
| D | si_shader_nir.c | 58 void si_nir_opts(struct si_screen *sscreen, struct nir_shader *nir, bool has_array_temps) in si_nir_opts() argument 60 bool use_aco = sscreen->use_aco || nir->info.use_aco_amd; in si_nir_opts() 68 NIR_PASS(progress, nir, nir_lower_vars_to_ssa); in si_nir_opts() 69 NIR_PASS(progress, nir, nir_lower_alu_to_scalar, in si_nir_opts() 70 nir->options->lower_to_scalar_filter, (void *)use_aco); in si_nir_opts() 71 NIR_PASS(progress, nir, nir_lower_phis_to_scalar, false); in si_nir_opts() 74 NIR_PASS(progress, nir, nir_split_array_vars, nir_var_function_temp); in si_nir_opts() 75 NIR_PASS(lower_alu_to_scalar, nir, nir_shrink_vec_array_vars, nir_var_function_temp); in si_nir_opts() 76 NIR_PASS(progress, nir, nir_opt_find_array_copies); in si_nir_opts() 78 NIR_PASS(progress, nir, nir_opt_copy_prop_vars); in si_nir_opts() [all …]
|
| D | si_shader_info.c | 11 #include "nir.h" 61 static void scan_io_usage(const nir_shader *nir, struct si_shader_info *info, in scan_io_usage() argument 99 if (nir->info.stage != MESA_SHADER_VERTEX || !is_input) in scan_io_usage() 102 if (nir->info.stage == MESA_SHADER_FRAGMENT && is_input) { in scan_io_usage() 115 if (nir->info.stage == MESA_SHADER_FRAGMENT && !is_input) { in scan_io_usage() 147 if (nir->info.stage != MESA_SHADER_FRAGMENT && in scan_io_usage() 200 if (nir->info.stage == MESA_SHADER_VERTEX || in scan_io_usage() 201 nir->info.stage == MESA_SHADER_TESS_CTRL || in scan_io_usage() 202 nir->info.stage == MESA_SHADER_TESS_EVAL || in scan_io_usage() 203 nir->info.stage == MESA_SHADER_GEOMETRY) { in scan_io_usage() [all …]
|
| /third_party/mesa3d/src/imagination/pco/ |
| D | pco_nir.c | 10 * \brief NIR-specific functions. 13 #include "nir/nir_builder.h" 19 /** Base/common SPIR-V to NIR options. */ 24 /** Base/common NIR options. */ 34 * \brief Sets up device/core-specific SPIR-V to NIR options. 37 * \param[out] spirv_options SPIR-V to NIR options. 49 * \brief Sets up device/core-specific NIR options. 52 * \param[out] nir_options NIR options. 64 * \brief Runs pre-processing passes on a NIR shader. 67 * \param[in,out] nir NIR shader. [all …]
|
| /third_party/mesa3d/src/intel/compiler/elk/ |
| D | elk_spirv.c | 10 #include "compiler/nir/nir_builder.h" 17 optimize(nir_shader *nir) in optimize() argument 23 NIR_PASS(progress, nir, nir_split_var_copies); in optimize() 24 NIR_PASS(progress, nir, nir_split_struct_vars, nir_var_function_temp); in optimize() 25 NIR_PASS(progress, nir, nir_lower_var_copies); in optimize() 26 NIR_PASS(progress, nir, nir_lower_vars_to_ssa); in optimize() 28 NIR_PASS(progress, nir, nir_copy_prop); in optimize() 29 NIR_PASS(progress, nir, nir_opt_remove_phis); in optimize() 30 NIR_PASS(progress, nir, nir_lower_phis_to_scalar, true); in optimize() 31 NIR_PASS(progress, nir, nir_opt_dce); in optimize() [all …]
|
| /third_party/mesa3d/src/intel/compiler/ |
| D | brw_spirv.c | 10 #include "compiler/nir/nir_builder.h" 17 optimize(nir_shader *nir) in optimize() argument 23 NIR_PASS(progress, nir, nir_split_var_copies); in optimize() 24 NIR_PASS(progress, nir, nir_split_struct_vars, nir_var_function_temp); in optimize() 25 NIR_PASS(progress, nir, nir_lower_var_copies); in optimize() 26 NIR_PASS(progress, nir, nir_lower_vars_to_ssa); in optimize() 28 NIR_PASS(progress, nir, nir_copy_prop); in optimize() 29 NIR_PASS(progress, nir, nir_opt_remove_phis); in optimize() 30 NIR_PASS(progress, nir, nir_lower_phis_to_scalar, true); in optimize() 31 NIR_PASS(progress, nir, nir_opt_dce); in optimize() [all …]
|
| D | brw_kernel.c | 31 #include "compiler/nir/nir_builder.h" 46 nir_shader *nir = nir_load_libclc_shader(64, disk_cache, in load_clc_shader() local 49 if (nir == NULL) in load_clc_shader() 53 p_atomic_cmpxchg(&compiler->clc_shader, NULL, nir); in load_clc_shader() 56 ralloc_steal(compiler, nir); in load_clc_shader() 57 return nir; in load_clc_shader() 60 ralloc_free(nir); in load_clc_shader() 126 implement_intel_builtins(nir_shader *nir) in implement_intel_builtins() argument 130 nir_foreach_function(func, nir) { in implement_intel_builtins() 157 nir_shader_preserve_all_metadata(nir); in implement_intel_builtins() [all …]
|
| D | brw_compile_vs.cpp | 69 struct nir_shader *nir = params->base.nir; in brw_compile_vs() local 73 brw_should_print_shader(nir, params->base.debug_flag ? in brw_compile_vs() 78 prog_data->base.base.ray_queries = nir->info.ray_queries; in brw_compile_vs() 81 brw_nir_apply_key(nir, compiler, &key->base, dispatch_width); in brw_compile_vs() 83 prog_data->inputs_read = nir->info.inputs_read; in brw_compile_vs() 84 prog_data->double_inputs_read = nir->info.vs.double_inputs; in brw_compile_vs() 86 brw_nir_lower_vs_inputs(nir); in brw_compile_vs() 87 brw_nir_lower_vue_outputs(nir); in brw_compile_vs() 88 brw_postprocess_nir(nir, compiler, debug_enabled, in brw_compile_vs() 92 ((1 << nir->info.clip_distance_array_size) - 1); in brw_compile_vs() [all …]
|
| D | brw_compile_tes.cpp | 67 nir_shader *nir = params->base.nir; in brw_compile_tes() local 73 const bool debug_enabled = brw_should_print_shader(nir, DEBUG_TES); in brw_compile_tes() 76 prog_data->base.base.ray_queries = nir->info.ray_queries; in brw_compile_tes() 78 nir->info.inputs_read = key->inputs_read; in brw_compile_tes() 79 nir->info.patch_inputs_read = key->patch_inputs_read; in brw_compile_tes() 81 brw_nir_apply_key(nir, compiler, &key->base, dispatch_width); in brw_compile_tes() 82 brw_nir_lower_tes_inputs(nir, input_vue_map); in brw_compile_tes() 83 brw_nir_lower_vue_outputs(nir); in brw_compile_tes() 84 brw_postprocess_nir(nir, compiler, debug_enabled, in brw_compile_tes() 88 nir->info.outputs_written, in brw_compile_tes() [all …]
|
| D | brw_nir_lower_cs_intrinsics.c | 25 #include "compiler/nir/nir_builder.h" 28 nir_shader *nir; member 50 nir_shader *nir = state->nir; in compute_local_index_id() local 53 if (!nir->info.workgroup_size_variable) { in compute_local_index_id() 55 const uint16_t *ws = nir->info.workgroup_size; in compute_local_index_id() 64 assert(nir->info.derivative_group != DERIVATIVE_GROUP_QUADS); in compute_local_index_id() 70 nir_def *size_x = nir_imm_int(b, nir->info.workgroup_size[0]); in compute_local_index_id() 71 nir_def *size_y = nir_imm_int(b, nir->info.workgroup_size[1]); in compute_local_index_id() 88 if (nir->info.stage == MESA_SHADER_MESH || nir->info.stage == MESA_SHADER_TASK) { in compute_local_index_id() 106 if (nir->info.workgroup_size_variable) { in compute_local_index_id() [all …]
|
| /third_party/mesa3d/src/compiler/nir/ |
| D | nir_sweep.c | 24 #include "nir.h" 43 static void sweep_cf_node(nir_shader *nir, nir_cf_node *cf_node); 46 sweep_block(nir_shader *nir, nir_block *block) in sweep_block() argument 48 ralloc_steal(nir, block); in sweep_block() 51 gc_mark_live(nir->gctx, instr); in sweep_block() 55 gc_mark_live(nir->gctx, nir_instr_as_tex(instr)->src); in sweep_block() 59 gc_mark_live(nir->gctx, src); in sweep_block() 62 ralloc_steal(nir, (void*)nir_instr_as_intrinsic(instr)->name); in sweep_block() 71 sweep_if(nir_shader *nir, nir_if *iff) in sweep_if() argument 73 ralloc_steal(nir, iff); in sweep_if() [all …]
|
| /third_party/mesa3d/src/imagination/rogue/ |
| D | rogue_nir.c | 25 #include "nir/nir.h" 34 * \brief Contains SPIR-V and NIR-specific functions. 38 * \brief SPIR-V to NIR compilation options. 57 * \brief Applies optimizations and passes required to lower the NIR shader into 65 nir_shader *nir, in rogue_nir_passes() argument 71 bool nir_debug_print_shader_prev = nir_debug_print_shader[nir->info.stage]; in rogue_nir_passes() 72 nir_debug_print_shader[nir->info.stage] = ROGUE_DEBUG(NIR_PASSES); in rogue_nir_passes() 75 nir_validate_shader(nir, "after spirv_to_nir"); in rogue_nir_passes() 77 NIR_PASS_V(nir, nir_lower_vars_to_ssa); in rogue_nir_passes() 80 NIR_PASS_V(nir, nir_split_var_copies); in rogue_nir_passes() [all …]
|
| /third_party/mesa3d/src/gallium/frontends/rusticl/mesa/compiler/ |
| D | nir.rs | 46 ($nir:ident, $pass:ident, $func:ident $(,$arg:expr)* $(,)?) => { 54 $nir.metadata_set_validation_flag(); 55 if $nir.should_print() { 58 if $nir.$pass($func $(,$arg)*) { 59 $nir.validate(&format!("after {} in {}:{}", func_str, file!(), line!())); 60 if $nir.should_print() { 61 $nir.print(); 63 $nir.metadata_check_validation_flag(); 73 $nir.validate_clone(); 77 $nir.validate_serialize_deserialize(); [all …]
|
| /third_party/mesa3d/src/asahi/clc/ |
| D | asahi_clc.c | 12 #include "nir.h" 45 optimize(nir_shader *nir) in optimize() argument 51 NIR_PASS(progress, nir, nir_split_var_copies); in optimize() 52 NIR_PASS(progress, nir, nir_split_struct_vars, nir_var_function_temp); in optimize() 53 NIR_PASS(progress, nir, nir_lower_var_copies); in optimize() 54 NIR_PASS(progress, nir, nir_lower_vars_to_ssa); in optimize() 56 NIR_PASS(progress, nir, nir_copy_prop); in optimize() 57 NIR_PASS(progress, nir, nir_opt_remove_phis); in optimize() 58 NIR_PASS(progress, nir, nir_lower_phis_to_scalar, true); in optimize() 59 NIR_PASS(progress, nir, nir_opt_dce); in optimize() [all …]
|
| /third_party/mesa3d/src/amd/vulkan/nir/ |
| D | radv_nir_lower_io.c | 10 #include "nir.h" 24 radv_nir_lower_io_to_scalar_early(nir_shader *nir, nir_variable_mode mask) in radv_nir_lower_io_to_scalar_early() argument 28 NIR_PASS(progress, nir, nir_lower_io_to_scalar_early, mask); in radv_nir_lower_io_to_scalar_early() 31 NIR_PASS(_, nir, nir_copy_prop); in radv_nir_lower_io_to_scalar_early() 32 NIR_PASS(_, nir, nir_opt_shrink_vectors, true); in radv_nir_lower_io_to_scalar_early() 36 NIR_PASS(_, nir, nir_opt_constant_folding); in radv_nir_lower_io_to_scalar_early() 39 NIR_PASS(_, nir, nir_opt_cse); in radv_nir_lower_io_to_scalar_early() 48 if (nir->info.stage == MESA_SHADER_TESS_CTRL) in radv_nir_lower_io_to_scalar_early() 49 NIR_PASS(_, nir, nir_opt_copy_prop_vars); in radv_nir_lower_io_to_scalar_early() 51 NIR_PASS(_, nir, nir_opt_dce); in radv_nir_lower_io_to_scalar_early() [all …]
|
| /third_party/mesa3d/src/nouveau/compiler/ |
| D | nak_nir.c | 13 #define OPT(nir, pass, ...) ({ \ argument 15 NIR_PASS(this_progress, nir, pass, ##__VA_ARGS__); \ 21 #define OPT_V(nir, pass, ...) NIR_PASS_V(nir, pass, ##__VA_ARGS__) argument 24 nak_nir_workgroup_has_one_subgroup(const nir_shader *nir) in nak_nir_workgroup_has_one_subgroup() argument 26 switch (nir->info.stage) { in nak_nir_workgroup_has_one_subgroup() 43 if (nir->info.workgroup_size_variable) in nak_nir_workgroup_has_one_subgroup() 46 uint16_t wg_sz = nir->info.workgroup_size[0] * in nak_nir_workgroup_has_one_subgroup() 47 nir->info.workgroup_size[1] * in nak_nir_workgroup_has_one_subgroup() 48 nir->info.workgroup_size[2]; in nak_nir_workgroup_has_one_subgroup() 92 optimize_nir(nir_shader *nir, const struct nak_compiler *nak, bool allow_copies) in optimize_nir() argument [all …]
|
| /third_party/mesa3d/src/gallium/drivers/freedreno/ir3/ |
| D | ir3_cmdline.c | 19 #include "nir/tgsi_to_nir.h" 63 sort_varyings(nir_shader *nir, nir_variable_mode mode) in sort_varyings() argument 67 nir_foreach_variable_with_modes_safe (var, nir, mode) { in sort_varyings() 71 exec_list_append(&nir->variables, &new_list); in sort_varyings() 75 fixup_varying_slots(nir_shader *nir, nir_variable_mode mode) in fixup_varying_slots() argument 77 nir_foreach_variable_with_modes (var, nir, mode) { in fixup_varying_slots() 106 nir_shader *nir = prog->_LinkedShaders[stage]->Program->nir; in load_glsl() local 108 /* required NIR passes: */ in load_glsl() 110 nir->info.stage == MESA_SHADER_VERTEX || in load_glsl() 111 nir->info.stage == MESA_SHADER_GEOMETRY) { in load_glsl() [all …]
|
| /third_party/mesa3d/src/microsoft/spirv_to_dxil/ |
| D | dxil_spirv_nir.c | 113 dxil_spirv_nir_prep(nir_shader *nir) in dxil_spirv_nir_prep() argument 119 NIR_PASS_V(nir, nir_lower_variable_initializers, nir_var_function_temp); in dxil_spirv_nir_prep() 120 NIR_PASS_V(nir, nir_lower_returns); in dxil_spirv_nir_prep() 121 NIR_PASS_V(nir, nir_inline_functions); in dxil_spirv_nir_prep() 122 NIR_PASS_V(nir, nir_copy_prop); in dxil_spirv_nir_prep() 123 NIR_PASS_V(nir, nir_opt_deref); in dxil_spirv_nir_prep() 126 nir_remove_non_entrypoints(nir); in dxil_spirv_nir_prep() 133 NIR_PASS_V(nir, nir_lower_variable_initializers, ~0); in dxil_spirv_nir_prep() 138 NIR_PASS_V(nir, nir_split_var_copies); in dxil_spirv_nir_prep() 139 NIR_PASS_V(nir, nir_split_per_member_structs); in dxil_spirv_nir_prep() [all …]
|
| /third_party/mesa3d/src/microsoft/clc/ |
| D | clc_compiler.c | 24 #include "nir.h" 276 clc_lower_images(nir_shader *nir, struct clc_image_lower_context *context) in clc_lower_images() argument 278 nir_foreach_function(func, nir) { in clc_lower_images() 299 nir_foreach_variable_with_modes_safe(var, nir, nir_var_image) { in clc_lower_images() 306 clc_lower_64bit_semantics(nir_shader *nir) in clc_lower_64bit_semantics() argument 308 nir_foreach_function_impl(impl, nir) { in clc_lower_64bit_semantics() 345 clc_lower_nonnormalized_samplers(nir_shader *nir, in clc_lower_nonnormalized_samplers() argument 348 nir_foreach_function(func, nir) { in clc_lower_nonnormalized_samplers() 414 add_kernel_inputs_var(struct clc_dxil_object *dxil, nir_shader *nir, in add_kernel_inputs_var() argument 422 nir_foreach_variable_with_modes(var, nir, nir_var_uniform) in add_kernel_inputs_var() [all …]
|
| /third_party/mesa3d/src/asahi/vulkan/ |
| D | hk_shader.c | 14 #include "nir.h" 123 hk_preprocess_nir_internal(struct vk_physical_device *vk_pdev, nir_shader *nir) in hk_preprocess_nir_internal() argument 126 if (nir->info.stage == MESA_SHADER_FRAGMENT) { in hk_preprocess_nir_internal() 127 NIR_PASS(_, nir, nir_lower_terminate_to_demote); in hk_preprocess_nir_internal() 128 NIR_PASS(_, nir, nir_shader_instructions_pass, lower_halt_to_return, in hk_preprocess_nir_internal() 130 NIR_PASS(_, nir, nir_lower_returns); in hk_preprocess_nir_internal() 135 NIR_PASS(_, nir, nir_lower_global_vars_to_local); in hk_preprocess_nir_internal() 139 NIR_PASS(progress, nir, nir_lower_vars_to_ssa); in hk_preprocess_nir_internal() 140 NIR_PASS(progress, nir, nir_copy_prop); in hk_preprocess_nir_internal() 141 NIR_PASS(progress, nir, nir_opt_dce); in hk_preprocess_nir_internal() [all …]
|
| /third_party/mesa3d/src/intel/vulkan/ |
| D | anv_internal_kernels.c | 29 #include "compiler/nir/nir.h" 30 #include "compiler/nir/nir_builder.h" 63 link_libanv(nir_shader *nir, const nir_shader *libanv) in link_libanv() argument 65 nir_link_shader_functions(nir, libanv); in link_libanv() 66 NIR_PASS_V(nir, nir_inline_functions); in link_libanv() 67 NIR_PASS_V(nir, nir_remove_non_entrypoints); in link_libanv() 68 NIR_PASS_V(nir, nir_lower_vars_to_explicit_types, nir_var_function_temp, in link_libanv() 70 NIR_PASS_V(nir, nir_opt_deref); in link_libanv() 71 NIR_PASS_V(nir, nir_lower_vars_to_ssa); in link_libanv() 72 NIR_PASS_V(nir, nir_lower_explicit_io, in link_libanv() [all …]
|
| /third_party/mesa3d/src/amd/common/ |
| D | meson.build | 94 'nir/ac_nir.c', 95 'nir/ac_nir.h', 96 'nir/ac_nir_helpers.h', 97 'nir/ac_nir_opt_outputs.c', 98 'nir/ac_nir_cull.c', 99 'nir/ac_nir_create_gs_copy_shader.c', 100 'nir/ac_nir_lower_esgs_io_to_mem.c', 101 'nir/ac_nir_lower_global_access.c', 102 'nir/ac_nir_lower_image_opcodes_cdna.c', 103 'nir/ac_nir_lower_intrinsics_to_args.c', [all …]
|
| /third_party/mesa3d/src/mesa/state_tracker/ |
| D | st_glsl_to_nir.cpp | 45 #include "compiler/nir/nir.h" 46 #include "compiler/nir/nir_builder.h" 118 nir_shader *nir) in st_nir_assign_uniform_locations() argument 123 nir_foreach_variable_with_modes(uniform, nir, nir_var_uniform | in st_nir_assign_uniform_locations() 207 * info on varyings, etc after NIR link time opts have been applied. 213 nir_shader *nir = prog->nir; in st_glsl_to_nir_post_opts() local 223 nir_foreach_uniform_variable(var, nir) { in st_glsl_to_nir_post_opts() 259 NIR_PASS(_, nir, st_nir_lower_builtin); in st_glsl_to_nir_post_opts() 262 NIR_PASS(_, nir, gl_nir_lower_atomics, shader_program, true); in st_glsl_to_nir_post_opts() 264 NIR_PASS(_, nir, nir_opt_intrinsics); in st_glsl_to_nir_post_opts() [all …]
|
| /third_party/mesa3d/src/amd/vulkan/ |
| D | radv_shader_info.c | 7 #include "nir/nir.h" 8 #include "nir/nir_xfb_info.h" 9 #include "nir/radv_nir.h" 24 radv_use_vs_prolog(const nir_shader *nir, in radv_use_vs_prolog() argument 27 return gfx_state->vs.has_prolog && nir->info.inputs_read; in radv_use_vs_prolog() 31 radv_use_per_attribute_vb_descs(const nir_shader *nir, in radv_use_per_attribute_vb_descs() argument 35 return stage_key->vertex_robustness1 || radv_use_vs_prolog(nir, gfx_state); in radv_use_per_attribute_vb_descs() 39 gather_load_vs_input_info(const nir_shader *nir, const nir_intrinsic_instr *intrin, struct radv_sha… in gather_load_vs_input_info() argument 57 if (radv_use_per_attribute_vb_descs(nir, gfx_state, stage_key)) in gather_load_vs_input_info() 67 gather_load_fs_input_info(const nir_shader *nir, const nir_intrinsic_instr *intrin, struct radv_sha… in gather_load_fs_input_info() argument [all …]
|
| /third_party/mesa3d/src/gallium/frontends/lavapipe/ |
| D | lvp_pipeline.c | 32 #include "nir/nir_builder.h" 33 #include "nir/nir_serialize.h" 37 #include "nir/nir_xfb_info.h" 50 gl_shader_stage stage = shader->pipeline_nir->nir->info.stage; in shader_destroy() 162 remove_barriers(nir_shader *nir, bool is_compute) in remove_barriers() argument 164 return nir_shader_intrinsics_pass(nir, remove_barriers_impl, in remove_barriers() 184 lower_demote(nir_shader *nir) in lower_demote() argument 186 return nir_shader_intrinsics_pass(nir, lower_demote_impl, in lower_demote() 224 optimize(nir_shader *nir) in optimize() argument 230 NIR_PASS(progress, nir, nir_lower_flrp, 32|64, true); in optimize() [all …]
|
| /third_party/mesa3d/src/gallium/auxiliary/nir/ |
| D | nir_to_tgsi_info.c | 33 #include "nir.h" 129 static void gather_intrinsic_load_deref_info(const nir_shader *nir, in gather_intrinsic_load_deref_info() argument 138 if (nir->info.stage == MESA_SHADER_FRAGMENT) in gather_intrinsic_load_deref_info() 142 switch (nir->info.stage) { in gather_intrinsic_load_deref_info() 160 static void scan_instruction(const struct nir_shader *nir, in scan_instruction() argument 241 gather_intrinsic_load_deref_info(nir, intr, deref, need_texcoord, var, info); in scan_instruction() 250 void nir_tgsi_scan_shader(const struct nir_shader *nir, in nir_tgsi_scan_shader() argument 256 info->processor = pipe_shader_type_from_mesa(nir->info.stage); in nir_tgsi_scan_shader() 260 pipe_shader_type_from_mesa(nir->info.next_stage); in nir_tgsi_scan_shader() 262 if (nir->info.stage == MESA_SHADER_VERTEX) { in nir_tgsi_scan_shader() [all …]
|