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"
263 iris_lower_storage_image_derefs(nir_shader *nir)
265 nir_function_impl *impl = nir_shader_get_entrypoint(nir);
364 iris_fix_edge_flags(nir_shader *nir)
366 if (nir->info.stage != MESA_SHADER_VERTEX) {
367 nir_shader_preserve_all_metadata(nir);
371 nir_variable *var = nir_find_variable_with_location(nir, nir_var_shader_out,
374 nir_shader_preserve_all_metadata(nir);
379 nir->info.outputs_written &= ~VARYING_BIT_EDGE;
380 nir->info.inputs_read &= ~VERT_BIT_EDGEFLAG;
381 nir_fixup_deref_modes(nir);
383 nir_foreach_function(f, nir) {
473 nir_shader *nir,
498 nir_function_impl *impl = nir_shader_get_entrypoint(nir);
623 assert(nir->info.workgroup_size_variable);
674 nir_validate_shader(nir, "before remapping");
680 unsigned num_cbufs = nir->info.num_ubos;
681 if (num_cbufs || nir->num_uniforms)
715 nir_opt_constant_folding(nir);
722 nir_validate_shader(nir, "after remap");
729 nir->num_uniforms = 0;
886 struct nir_shader *nir,
892 const struct shader_info *info = &nir->info;
939 nir_function_impl *impl = nir_shader_get_entrypoint(nir);
1126 const struct shader_info *info = &ish->nir->info;
1323 nir_shader *nir = nir_shader_clone(mem_ctx, ish->nir);
1327 nir_function_impl *impl = nir_shader_get_entrypoint(nir);
1328 nir_lower_clip_vs(nir, (1 << key->vue.nr_userclip_plane_consts) - 1,
1330 nir_lower_io_to_temporaries(nir, impl, true, false);
1331 nir_lower_global_vars_to_local(nir);
1332 nir_lower_vars_to_ssa(nir);
1333 nir_shader_gather_info(nir, impl);
1336 prog_data->use_alt_mode = nir->info.use_legacy_math_rules;
1338 iris_setup_uniforms(compiler, mem_ctx, nir, prog_data, 0, &system_values,
1342 iris_setup_binding_table(devinfo, nir, &bt, /* num_render_targets */ 0,
1345 brw_nir_analyze_ubo_ranges(compiler, nir, NULL, prog_data->ubo_ranges);
1348 &vue_prog_data->vue_map, nir->info.outputs_written,
1349 nir->info.separate_shader, /* pos_slots */ 1);
1354 .nir = nir,
1405 screen->vtbl.populate_vs_key(ice, &ish->nir->info, last_vue_stage(ice), &key);
1446 const nir_shader *nir = ish->nir;
1447 return &nir->info;
1505 nir_shader *nir;
1513 nir = nir_shader_clone(mem_ctx, ish->nir);
1515 iris_setup_uniforms(compiler, mem_ctx, nir, prog_data, 0, &system_values,
1517 iris_setup_binding_table(devinfo, nir, &bt, /* num_render_targets */ 0,
1519 brw_nir_analyze_ubo_ranges(compiler, nir, NULL, prog_data->ubo_ranges);
1521 nir =
1559 .nir = nir,
1692 nir_shader *nir = nir_shader_clone(mem_ctx, ish->nir);
1696 nir_function_impl *impl = nir_shader_get_entrypoint(nir);
1697 nir_lower_clip_vs(nir, (1 << key->vue.nr_userclip_plane_consts) - 1,
1699 nir_lower_io_to_temporaries(nir, impl, true, false);
1700 nir_lower_global_vars_to_local(nir);
1701 nir_lower_vars_to_ssa(nir);
1702 nir_shader_gather_info(nir, impl);
1705 iris_setup_uniforms(compiler, mem_ctx, nir, prog_data, 0, &system_values,
1709 iris_setup_binding_table(devinfo, nir, &bt, /* num_render_targets */ 0,
1712 brw_nir_analyze_ubo_ranges(compiler, nir, NULL, prog_data->ubo_ranges);
1721 .nir = nir,
1774 screen->vtbl.populate_tes_key(ice, &ish->nir->info, last_vue_stage(ice), &key);
1803 const struct shader_info *tes_info = &ish->nir->info;
1831 nir_shader *nir = nir_shader_clone(mem_ctx, ish->nir);
1835 nir_function_impl *impl = nir_shader_get_entrypoint(nir);
1836 nir_lower_clip_gs(nir, (1 << key->vue.nr_userclip_plane_consts) - 1,
1838 nir_lower_io_to_temporaries(nir, impl, true, false);
1839 nir_lower_global_vars_to_local(nir);
1840 nir_lower_vars_to_ssa(nir);
1841 nir_shader_gather_info(nir, impl);
1844 iris_setup_uniforms(compiler, mem_ctx, nir, prog_data, 0, &system_values,
1848 iris_setup_binding_table(devinfo, nir, &bt, /* num_render_targets */ 0,
1851 brw_nir_analyze_ubo_ranges(compiler, nir, NULL, prog_data->ubo_ranges);
1854 &vue_prog_data->vue_map, nir->info.outputs_written,
1855 nir->info.separate_shader, /* pos_slots */ 1);
1860 .nir = nir,
1914 screen->vtbl.populate_gs_key(ice, &ish->nir->info, last_vue_stage(ice), &key);
1965 nir_shader *nir = nir_shader_clone(mem_ctx, ish->nir);
1968 prog_data->use_alt_mode = nir->info.use_legacy_math_rules;
1970 iris_setup_uniforms(compiler, mem_ctx, nir, prog_data, 0, &system_values,
1978 brw_nir_lower_fs_outputs(nir);
1987 iris_setup_binding_table(devinfo, nir, &bt,
1991 brw_nir_analyze_ubo_ranges(compiler, nir, NULL, prog_data->ubo_ranges);
1996 .nir = nir,
2046 screen->vtbl.populate_fs_key(ice, &ish->nir->info, &key);
2257 nir_shader *nir = nir_shader_clone(mem_ctx, ish->nir);
2260 NIR_PASS_V(nir, brw_nir_lower_cs_intrinsics);
2262 iris_setup_uniforms(compiler, mem_ctx, nir, prog_data,
2267 iris_setup_binding_table(devinfo, nir, &bt, /* num_render_targets */ 0,
2273 .nir = nir,
2447 nir_shader *nir,
2460 ish->uses_atomic_load_store = iris_uses_image_atomic(nir);
2463 ish->nir = nir;
2466 update_so_info(&ish->stream_output, nir->info.outputs_written);
2477 nir_serialize(&blob, nir, true);
2495 nir_shader *nir;
2498 nir = (void *)state->prog;
2505 nir = nir_deserialize(NULL, options, &reader);
2517 assert(nir->info.stage == MESA_SHADER_COMPUTE ||
2518 nir->info.stage == MESA_SHADER_KERNEL);
2519 nir->info.stage = MESA_SHADER_COMPUTE;
2522 iris_create_uncompiled_shader(screen, nir, NULL);
2559 switch (ish->nir->info.stage) {
2587 struct nir_shader *nir;
2590 nir = tgsi_to_nir(state->tokens, ctx->screen, false);
2592 nir = state->ir.nir;
2594 const struct shader_info *const info = &nir->info;
2596 iris_create_uncompiled_shader(screen, nir, &state->stream_output);
2749 ralloc_free(ish->nir);
2764 const gl_shader_stage stage = ish->nir->info.stage;
2790 const struct shader_info *new_info = ish ? &ish->nir->info : NULL;
2818 const struct shader_info *info = &ish->nir->info;
2904 (old_ish->nir->info.outputs_written & color_bits) !=
2905 (new_ish->nir->info.outputs_written & color_bits))
2924 struct nir_shader *nir = (struct nir_shader *) nirptr;
2927 NIR_PASS_V(nir, iris_fix_edge_flags);
2929 brw_preprocess_nir(screen->compiler, nir, NULL);
2931 NIR_PASS_V(nir, brw_nir_lower_storage_image, devinfo);
2932 NIR_PASS_V(nir, iris_lower_storage_image_derefs);
2934 nir_sweep(nir);