Lines Matching defs:nir
42 #include "compiler/nir/nir.h"
43 #include "compiler/nir/nir_builder.h"
44 #include "compiler/nir/nir_serialize.h"
49 #include "nir/tgsi_to_nir.h"
157 uint32_t mask = ish->nir->info.textures_used[0];
219 crocus_lower_swizzles(struct nir_shader *nir,
225 uint32_t mask = nir->info.textures_used[0];
238 nir_lower_tex(nir, &tex_options);
280 crocus_lower_storage_image_derefs(nir_shader *nir)
282 nir_function_impl *impl = nir_shader_get_entrypoint(nir);
334 crocus_fix_edge_flags(nir_shader *nir)
336 if (nir->info.stage != MESA_SHADER_VERTEX) {
337 nir_shader_preserve_all_metadata(nir);
341 nir_variable *var = nir_find_variable_with_location(nir, nir_var_shader_out,
344 nir_shader_preserve_all_metadata(nir);
349 nir->info.outputs_written &= ~VARYING_BIT_EDGE;
350 nir->info.inputs_read &= ~VERT_BIT_EDGEFLAG;
351 nir_fixup_deref_modes(nir);
353 nir_foreach_function(f, nir) {
443 nir_shader *nir,
464 nir_function_impl *impl = nir_shader_get_entrypoint(nir);
585 assert(nir->info.workgroup_size_variable);
607 nir_intrinsic_instr_create(nir, nir_intrinsic_load_ubo);
622 nir_validate_shader(nir, "before remapping");
628 unsigned num_cbufs = nir->info.num_ubos;
629 if (num_cbufs || nir->num_uniforms)
663 nir_opt_constant_folding(nir);
670 nir_validate_shader(nir, "after remap");
677 nir->num_uniforms = 0;
804 struct nir_shader *nir,
811 const struct shader_info *info = &nir->info;
871 nir_function_impl *impl = nir_shader_get_entrypoint(nir);
1161 crocus_lower_default_edgeflags(struct nir_shader *nir)
1163 nir_function_impl *impl = nir_shader_get_entrypoint(nir);
1169 nir_variable *var = nir_variable_create(nir, nir_var_shader_out,
1196 nir_shader *nir = nir_shader_clone(mem_ctx, ish->nir);
1199 nir_function_impl *impl = nir_shader_get_entrypoint(nir);
1200 nir_lower_clip_vs(nir, (1 << key->nr_userclip_plane_consts) - 1, true,
1202 nir_lower_io_to_temporaries(nir, impl, true, false);
1203 nir_lower_global_vars_to_local(nir);
1204 nir_lower_vars_to_ssa(nir);
1205 nir_shader_gather_info(nir, impl);
1209 nir_lower_point_size(nir, 1.0, 255.0);
1211 prog_data->use_alt_mode = nir->info.use_legacy_math_rules;
1213 crocus_setup_uniforms(compiler, mem_ctx, nir, prog_data, &system_values,
1216 crocus_lower_swizzles(nir, &key->base.tex);
1219 !(nir->info.inputs_read & BITFIELD64_BIT(VERT_ATTRIB_EDGEFLAG)))
1220 crocus_lower_default_edgeflags(nir);
1223 crocus_setup_binding_table(devinfo, nir, &bt, /* num_render_targets */ 0,
1227 brw_nir_analyze_ubo_ranges(compiler, nir, NULL, prog_data->ubo_ranges);
1230 crocus_vs_outputs_written(ice, key, nir->info.outputs_written);
1233 nir->info.separate_shader, /* pos slots */ 1);
1244 .nir = nir,
1259 crocus_debug_recompile(ice, &nir->info, &key->base);
1301 ish->nir->info.uses_texture_gather, &key.base.tex);
1302 screen->vtbl.populate_vs_key(ice, &ish->nir->info, last_vue_stage(ice), &key);
1361 const nir_shader *nir = ish->nir;
1362 return &nir->info;
1418 nir_shader *nir;
1423 nir = nir_shader_clone(mem_ctx, ish->nir);
1425 crocus_setup_uniforms(compiler, mem_ctx, nir, prog_data, &system_values,
1428 crocus_lower_swizzles(nir, &key->base.tex);
1429 crocus_setup_binding_table(devinfo, nir, &bt, /* num_render_targets */ 0,
1432 brw_nir_analyze_ubo_ranges(compiler, nir, NULL, prog_data->ubo_ranges);
1434 nir = brw_nir_create_passthrough_tcs(mem_ctx, compiler, options, key);
1474 .nir = nir,
1489 crocus_debug_recompile(ice, &nir->info, &key->base);
1538 tcs->nir->info.uses_texture_gather, &key.base.tex);
1582 nir_shader *nir = nir_shader_clone(mem_ctx, ish->nir);
1585 nir_function_impl *impl = nir_shader_get_entrypoint(nir);
1586 nir_lower_clip_vs(nir, (1 << key->nr_userclip_plane_consts) - 1, true,
1588 nir_lower_io_to_temporaries(nir, impl, true, false);
1589 nir_lower_global_vars_to_local(nir);
1590 nir_lower_vars_to_ssa(nir);
1591 nir_shader_gather_info(nir, impl);
1595 nir_lower_point_size(nir, 1.0, 255.0);
1597 crocus_setup_uniforms(compiler, mem_ctx, nir, prog_data, &system_values,
1599 crocus_lower_swizzles(nir, &key->base.tex);
1601 crocus_setup_binding_table(devinfo, nir, &bt, /* num_render_targets */ 0,
1605 brw_nir_analyze_ubo_ranges(compiler, nir, NULL, prog_data->ubo_ranges);
1615 .nir = nir,
1630 crocus_debug_recompile(ice, &nir->info, &key->base);
1672 ish->nir->info.uses_texture_gather, &key.base.tex);
1674 screen->vtbl.populate_tes_key(ice, &ish->nir->info, last_vue_stage(ice), &key);
1695 const struct shader_info *tes_info = &ish->nir->info;
1722 nir_shader *nir = nir_shader_clone(mem_ctx, ish->nir);
1725 nir_function_impl *impl = nir_shader_get_entrypoint(nir);
1726 nir_lower_clip_gs(nir, (1 << key->nr_userclip_plane_consts) - 1, false,
1728 nir_lower_io_to_temporaries(nir, impl, true, false);
1729 nir_lower_global_vars_to_local(nir);
1730 nir_lower_vars_to_ssa(nir);
1731 nir_shader_gather_info(nir, impl);
1735 nir_lower_point_size(nir, 1.0, 255.0);
1737 crocus_setup_uniforms(compiler, mem_ctx, nir, prog_data, &system_values,
1739 crocus_lower_swizzles(nir, &key->base.tex);
1741 crocus_setup_binding_table(devinfo, nir, &bt, /* num_render_targets */ 0,
1745 brw_nir_analyze_ubo_ranges(compiler, nir, NULL, prog_data->ubo_ranges);
1748 &vue_prog_data->vue_map, nir->info.outputs_written,
1749 nir->info.separate_shader, /* pos slots */ 1);
1757 .nir = nir,
1771 crocus_debug_recompile(ice, &nir->info, &key->base);
1817 ish->nir->info.uses_texture_gather, &key.base.tex);
1818 screen->vtbl.populate_gs_key(ice, &ish->nir->info, last_vue_stage(ice), &key);
1859 nir_shader *nir = nir_shader_clone(mem_ctx, ish->nir);
1861 prog_data->use_alt_mode = nir->info.use_legacy_math_rules;
1863 crocus_setup_uniforms(compiler, mem_ctx, nir, prog_data, &system_values,
1871 brw_nir_lower_fs_outputs(nir);
1874 crocus_lower_swizzles(nir, &key->base.tex);
1878 crocus_setup_binding_table(devinfo, nir, &bt,
1884 brw_nir_analyze_ubo_ranges(compiler, nir, NULL, prog_data->ubo_ranges);
1890 .nir = nir,
1908 crocus_debug_recompile(ice, &nir->info, &key->base);
1945 ish->nir->info.uses_texture_gather, &key.base.tex);
1946 screen->vtbl.populate_fs_key(ice, &ish->nir->info, &key);
2556 nir_shader *nir = nir_shader_clone(mem_ctx, ish->nir);
2558 NIR_PASS_V(nir, brw_nir_lower_cs_intrinsics);
2560 crocus_setup_uniforms(compiler, mem_ctx, nir, prog_data, &system_values,
2562 crocus_lower_swizzles(nir, &key->base.tex);
2564 crocus_setup_binding_table(devinfo, nir, &bt, /* num_render_targets */ 0,
2568 .nir = nir,
2583 crocus_debug_recompile(ice, &nir->info, &key->base);
2615 ish->nir->info.uses_texture_gather, &key.base.tex);
2698 nir_shader *nir,
2709 NIR_PASS(ish->needs_edge_flag, nir, crocus_fix_edge_flags);
2713 brw_preprocess_nir(screen->compiler, nir, NULL);
2715 NIR_PASS_V(nir, brw_nir_lower_storage_image, devinfo);
2716 NIR_PASS_V(nir, crocus_lower_storage_image_derefs);
2718 nir_sweep(nir);
2721 ish->nir = nir;
2724 update_so_info(&ish->stream_output, nir->info.outputs_written);
2735 nir_serialize(&blob, nir, true);
2747 struct nir_shader *nir;
2750 nir = tgsi_to_nir(state->tokens, ctx->screen, false);
2752 nir = state->ir.nir;
2754 return crocus_create_uncompiled_shader(ctx, nir, &state->stream_output);
2767 if (ish->nir->info.clip_distance_array_size == 0 ||
2791 struct shader_info *info = &ish->nir->info;
2821 struct shader_info *info = &ish->nir->info;
2825 if (ish->nir->info.clip_distance_array_size == 0)
2853 if (ish->nir->info.clip_distance_array_size == 0)
2873 struct shader_info *info = &ish->nir->info;
2882 if (screen->devinfo.ver < 6 || util_bitcount64(ish->nir->info.inputs_read &
2964 ralloc_free(ish->nir);
3019 const struct shader_info *new_info = ish ? &ish->nir->info : NULL;
3050 new_ish->nir->info.vs.window_space_position) {
3052 new_ish->nir->info.vs.window_space_position;
3112 (old_ish->nir->info.outputs_written & color_bits) !=
3113 (new_ish->nir->info.outputs_written & color_bits)) {