/aosp_15_r20/external/mesa3d/src/intel/compiler/ |
H A 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 …]
|
/aosp_15_r20/external/mesa3d/src/gallium/drivers/radeonsi/ |
H A D | si_shader_nir.c | 78 void si_nir_opts(struct si_screen *sscreen, struct nir_shader *nir, bool first) in si_nir_opts() argument 80 bool use_aco = sscreen->use_aco || nir->info.use_aco_amd; in si_nir_opts() 88 NIR_PASS(progress, nir, nir_lower_vars_to_ssa); in si_nir_opts() 89 NIR_PASS(progress, nir, nir_lower_alu_to_scalar, in si_nir_opts() 90 nir->options->lower_to_scalar_filter, (void *)use_aco); in si_nir_opts() 91 NIR_PASS(progress, nir, nir_lower_phis_to_scalar, false); in si_nir_opts() 94 NIR_PASS(progress, nir, nir_split_array_vars, nir_var_function_temp); in si_nir_opts() 95 NIR_PASS(lower_alu_to_scalar, nir, nir_shrink_vec_array_vars, nir_var_function_temp); in si_nir_opts() 96 NIR_PASS(progress, nir, nir_opt_find_array_copies); in si_nir_opts() 98 NIR_PASS(progress, nir, nir_opt_copy_prop_vars); in si_nir_opts() [all …]
|
H A D | si_shader_info.c | 11 #include "nir.h" 158 static bool are_tessfactors_def_in_all_invocs(const struct nir_shader *nir) in are_tessfactors_def_in_all_invocs() argument 160 assert(nir->info.stage == MESA_SHADER_TESS_CTRL); in are_tessfactors_def_in_all_invocs() 178 nir_foreach_function (function, nir) { in are_tessfactors_def_in_all_invocs() 207 static void scan_io_usage(const nir_shader *nir, struct si_shader_info *info, in scan_io_usage() argument 264 if (nir->info.stage != MESA_SHADER_VERTEX || !is_input) in scan_io_usage() 267 if (nir->info.stage == MESA_SHADER_FRAGMENT && is_input) { in scan_io_usage() 283 if (nir->info.stage == MESA_SHADER_FRAGMENT && !is_input) { in scan_io_usage() 325 if (nir->info.stage != MESA_SHADER_FRAGMENT && in scan_io_usage() 379 if (nir->info.stage == MESA_SHADER_FRAGMENT && in scan_io_usage() [all …]
|
/aosp_15_r20/external/mesa3d/src/microsoft/spirv_to_dxil/ |
H A 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 …]
|
/aosp_15_r20/external/mesa3d/src/nouveau/compiler/ |
H A 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 …]
|
/aosp_15_r20/external/angle/third_party/mesa/ |
H A D | mesa_autogen.gni | 136 "src/compiler/nir/nir.c", 137 "src/compiler/nir/nir_builder.c", 138 "src/compiler/nir/nir_builder_opcodes_h.py", 139 "src/compiler/nir/nir_builtin_builder.c", 140 "src/compiler/nir/nir_clone.c", 141 "src/compiler/nir/nir_constant_expressions.py", 142 "src/compiler/nir/nir_control_flow.c", 143 "src/compiler/nir/nir_convert_ycbcr.c", 144 "src/compiler/nir/nir_deref.c", 145 "src/compiler/nir/nir_divergence_analysis.c", [all …]
|
/aosp_15_r20/external/mesa3d/src/gallium/frontends/rusticl/mesa/compiler/ |
H A D | nir.rs | 45 ($nir:ident, $pass:ident, $func:ident $(,$arg:expr)* $(,)?) => { 53 $nir.metadata_set_validation_flag(); 54 if $nir.should_print() { 57 if $nir.$pass($func $(,$arg)*) { 58 $nir.validate(&format!("after {} in {}:{}", func_str, file!(), line!())); 59 if $nir.should_print() { 60 $nir.print(); 62 $nir.metadata_check_validation_flag(); 72 $nir.validate_clone(); 76 $nir.validate_serialize_deserialize(); [all …]
|
/aosp_15_r20/external/mesa3d/src/mesa/state_tracker/ |
H A D | st_glsl_to_nir.cpp | 45 #include "compiler/nir/nir.h" 46 #include "compiler/nir/nir_builder.h" 67 * may need to fix up varying slots so the glsl->nir path is aligned 68 * with the anything->tgsi->nir path. 98 st_nir_assign_vs_in_locations(struct nir_shader *nir) in st_nir_assign_vs_in_locations() argument 100 if (nir->info.stage != MESA_SHADER_VERTEX || nir->info.io_lowered) in st_nir_assign_vs_in_locations() 103 nir->num_inputs = util_bitcount64(nir->info.inputs_read); in st_nir_assign_vs_in_locations() 107 nir_foreach_shader_in_variable_safe(var, nir) { in st_nir_assign_vs_in_locations() 108 /* NIR already assigns dual-slot inputs to two locations so all we have in st_nir_assign_vs_in_locations() 111 if (nir->info.inputs_read & BITFIELD64_BIT(var->data.location)) { in st_nir_assign_vs_in_locations() [all …]
|
H A D | st_program.c | 38 #include "nir/pipe_nir.h" 45 #include "compiler/nir/nir.h" 46 #include "compiler/nir/nir_serialize.h" 323 /* Note: Any setup of ->ir.nir that has had pipe->create_*_state called on in st_release_variants() 324 * it has resulted in the driver taking ownership of the NIR. Those in st_release_variants() 325 * callers should be NULLing out the nir field in any pipe_shader_state in st_release_variants() 328 * GLSL IR and ARB programs will have set gl_program->nir to the same in st_release_variants() 329 * shader as ir->ir.nir, so it will be freed by _mesa_delete_program(). in st_release_variants() 347 st_finalize_nir_before_variants(struct nir_shader *nir) in st_finalize_nir_before_variants() argument 349 NIR_PASS(_, nir, nir_split_var_copies); in st_finalize_nir_before_variants() [all …]
|
/aosp_15_r20/external/mesa3d/src/asahi/vulkan/ |
H A D | hk_shader.c | 12 #include "nir.h" 118 hk_preprocess_nir_internal(struct vk_physical_device *vk_pdev, nir_shader *nir) in hk_preprocess_nir_internal() argument 121 if (nir->info.stage == MESA_SHADER_FRAGMENT) { in hk_preprocess_nir_internal() 122 NIR_PASS(_, nir, nir_lower_terminate_to_demote); in hk_preprocess_nir_internal() 123 NIR_PASS(_, nir, nir_shader_instructions_pass, lower_halt_to_return, in hk_preprocess_nir_internal() 125 NIR_PASS(_, nir, nir_lower_returns); in hk_preprocess_nir_internal() 130 NIR_PASS(_, nir, nir_lower_global_vars_to_local); in hk_preprocess_nir_internal() 134 NIR_PASS(progress, nir, nir_lower_vars_to_ssa); in hk_preprocess_nir_internal() 135 NIR_PASS(progress, nir, nir_copy_prop); in hk_preprocess_nir_internal() 136 NIR_PASS(progress, nir, nir_opt_dce); in hk_preprocess_nir_internal() [all …]
|
/aosp_15_r20/external/mesa3d/src/microsoft/clc/ |
H A 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 …]
|
/aosp_15_r20/external/mesa3d/src/amd/vulkan/ |
H A 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 …]
|
/aosp_15_r20/external/mesa3d/src/gallium/frontends/lavapipe/ |
H A 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 …]
|
/aosp_15_r20/external/mesa3d/src/gallium/frontends/clover/nir/ |
H A D | invocation.cpp | 36 #include <compiler/nir/nir_builder.h> 37 #include <compiler/nir/nir_serialize.h> 181 clover_lower_nir(nir_shader *nir, std::vector<binary::argument> &args, in clover_lower_nir() argument 185 if (nir->constant_data_size) { in clover_lower_nir() 188 constant_var = nir_variable_create(nir, nir_var_uniform, type, in clover_lower_nir() 199 return nir_shader_lower_instructions(nir, in clover_lower_nir() 243 struct disk_cache *clover::nir::create_clc_disk_cache(void) in create_clc_disk_cache() 250 if (!disk_cache_get_function_identifier((void *)clover::nir::create_clc_disk_cache, &ctx)) in create_clc_disk_cache() 259 void clover::nir::check_for_libclc(const device &dev) in check_for_libclc() 265 nir_shader *clover::nir::load_libclc_nir(const device &dev, std::string &r_log) in load_libclc_nir() [all …]
|
/aosp_15_r20/external/mesa3d/docs/relnotes/ |
H A D | 20.3.0.rst | 34 - GL_NV_copy_depth_to_color for NIR 83 - Amber test NIR validation failed after spirv_to_nir 85 - Follow-up from "nir,spirv: Add generic pointers support" 90 - Follow-up from "st/mesa: Use nir-to-tgsi for builtins if the driver needs TGSI" 124 - nir: Mesa regression on Compute shader 168 - \[regression][bisected\] nir: nir_intrinsic_io_semantics assert failures in piglit 226 - nir/lower_io: don't reduce range if parent length is zero 265 - v3dv/pipeline: adding some nir-based linking 267 - v3dv: debug nir shader also after spirv_to_nir 275 - v3dv/pipeline: revamp nir lowering/optimizations passes [all …]
|
H A D | 19.1.0.rst | 320 - nir, glsl: move pixel_center_integer/origin_upper_left to 322 - nir/xfb: add component_offset at nir_xfb_info 324 - nir/xfb: adding varyings on nir_xfb_info and gather_info 325 - nir/xfb: sort varyings too 327 - nir/xfb: handle arrays and AoA of basic types 328 - nir/linker: use nir_gather_xfb_info 329 - nir/linker: fix ARRAY_SIZE query with xfb varyings 330 - nir/xfb: move varyings info out of nir_xfb_info 497 - nir: Add "viewport vector" system values 511 - nir: Add nir_lower_viewport_transform [all …]
|
H A D | 19.0.0.rst | 101 - [regression][bisected] "nir: Copy propagation between blocks" 182 - [nir] src/compiler/nir/nir_loop_analyze.c uninitialized variable 192 - [regression][bisected] "nir: Switch to using 1-bit Booleans for 257 - nir: remove unused variable 258 - nir/xfb: don't assert when xfb_buffer/stride is present but not 260 - nir/xfb: distinguish array of structs vs array of blocks 378 - nir: Account for atomics in copy propagation. 415 - nir: properly clear the entry sources in copy_prop_vars 416 - nir: properly find the entry to keep in copy_prop_vars 417 - nir: add a way to print the deref chain [all …]
|
/aosp_15_r20/external/mesa3d/src/gallium/frontends/rusticl/core/ |
H A D | kernel.rs | 11 use mesa_rust::compiler::nir::*; 129 fn from_spirv_nir(spirv: &[spirv::SPIRVKernelArg], nir: &mut NirShader) -> Vec<Self> { in from_spirv_nir() 130 let nir_arg_map: HashMap<_, _> = nir in from_spirv_nir() 139 let nir = nir_arg_map.get(&(i as i32)).unwrap(); in from_spirv_nir() localVariable 142 if unsafe { glsl_type_is_sampler(nir.type_) } { in from_spirv_nir() 145 let size = unsafe { glsl_get_cl_size(nir.type_) } as u16; in from_spirv_nir() 146 // nir types of non opaque types are never sized 0 in from_spirv_nir() 157 if unsafe { glsl_type_is_image(nir.type_) } { in from_spirv_nir() 158 let access = nir.data.access(); in from_spirv_nir() 226 fn assign_locations(compiled_args: &mut [Self], nir: &mut NirShader) { in assign_locations() [all …]
|
/aosp_15_r20/external/mesa3d/src/imagination/rogue/ |
H A 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 …]
|
/aosp_15_r20/external/mesa3d/src/gallium/drivers/freedreno/ir3/ |
H A 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 = glsl_to_nir(&local_ctx.Const, in load_glsl() local 111 if (nir->info.stage == MESA_SHADER_FRAGMENT) { in load_glsl() 112 nir->info.fs.pixel_center_integer = in load_glsl() 114 nir->info.fs.origin_upper_left = in load_glsl() [all …]
|
/aosp_15_r20/external/mesa3d/src/compiler/nir/ |
H A 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() 60 gc_mark_live(nir->gctx, instr); in sweep_block() 64 gc_mark_live(nir->gctx, nir_instr_as_tex(instr)->src); in sweep_block() 68 gc_mark_live(nir->gctx, src); in sweep_block() 71 ralloc_steal(nir, (void*)nir_instr_as_intrinsic(instr)->name); in sweep_block() 80 sweep_if(nir_shader *nir, nir_if *iff) in sweep_if() argument 82 ralloc_steal(nir, iff); in sweep_if() [all …]
|
/aosp_15_r20/external/mesa3d/src/compiler/glsl/ |
H A D | gl_nir_linker.c | 24 #include "nir.h" 41 * This file included general link methods, using NIR, instead of IR as 46 gl_nir_opts(nir_shader *nir) in gl_nir_opts() argument 55 NIR_PASS(_, nir, nir_lower_vars_to_ssa); in gl_nir_opts() 62 NIR_PASS(progress, nir, nir_remove_dead_variables, in gl_nir_opts() 67 NIR_PASS(progress, nir, nir_opt_find_array_copies); in gl_nir_opts() 68 NIR_PASS(progress, nir, nir_opt_copy_prop_vars); in gl_nir_opts() 69 NIR_PASS(progress, nir, nir_opt_dead_write_vars); in gl_nir_opts() 71 if (nir->options->lower_to_scalar) { in gl_nir_opts() 72 NIR_PASS(_, nir, nir_lower_alu_to_scalar, in gl_nir_opts() [all …]
|
/aosp_15_r20/external/mesa3d/src/gallium/auxiliary/nir/ |
H A 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 …]
|
/aosp_15_r20/external/mesa3d/src/intel/compiler/elk/ |
H A D | elk_nir.c | 30 #include "compiler/nir/nir_builder.h" 239 elk_nir_lower_vs_inputs(nir_shader *nir, in elk_nir_lower_vs_inputs() argument 244 nir_foreach_shader_in_variable(var, nir) in elk_nir_lower_vs_inputs() 251 nir_lower_io(nir, nir_var_shader_in, elk_type_size_vec4, in elk_nir_lower_vs_inputs() 255 nir_opt_constant_folding(nir); in elk_nir_lower_vs_inputs() 257 nir_io_add_const_offset_to_base(nir, nir_var_shader_in); in elk_nir_lower_vs_inputs() 259 elk_nir_apply_attribute_workarounds(nir, vs_attrib_wa_flags); in elk_nir_lower_vs_inputs() 267 BITSET_TEST(nir->info.system_values_read, SYSTEM_VALUE_FIRST_VERTEX) || in elk_nir_lower_vs_inputs() 268 BITSET_TEST(nir->info.system_values_read, SYSTEM_VALUE_BASE_INSTANCE) || in elk_nir_lower_vs_inputs() 269 BITSET_TEST(nir->info.system_values_read, SYSTEM_VALUE_VERTEX_ID_ZERO_BASE) || in elk_nir_lower_vs_inputs() [all …]
|
/aosp_15_r20/external/mesa3d/src/gallium/drivers/zink/ |
H A D | zink_compiler.c | 34 #include "nir.h" 36 #include "nir/nir_draw_helpers.h" 37 #include "compiler/nir/nir_builder.h" 38 #include "compiler/nir/nir_serialize.h" 39 #include "compiler/nir/nir_builtin_builder.h" 41 #include "nir/tgsi_to_nir.h" 90 create_gfx_pushconst(nir_shader *nir) in create_gfx_pushconst() argument 95 fields[member_idx].name = ralloc_asprintf(nir, #field); … in create_gfx_pushconst() 100 …struct glsl_struct_field *fields = rzalloc_array(nir, struct glsl_struct_field, ZINK_GFX_PUSHCONST… in create_gfx_pushconst() 110 pushconst = nir_variable_create(nir, nir_var_mem_push_const, in create_gfx_pushconst() [all …]
|