Lines Matching refs:nir

29 #include "compiler/nir/nir_builder.h"
163 brw_nir_lower_vs_inputs(nir_shader *nir,
168 nir_foreach_shader_in_variable(var, nir)
175 nir_lower_io(nir, nir_var_shader_in, type_size_vec4,
179 nir_opt_constant_folding(nir);
181 nir_io_add_const_offset_to_base(nir, nir_var_shader_in);
183 brw_nir_apply_attribute_workarounds(nir, vs_attrib_wa_flags);
191 BITSET_TEST(nir->info.system_values_read, SYSTEM_VALUE_FIRST_VERTEX) ||
192 BITSET_TEST(nir->info.system_values_read, SYSTEM_VALUE_BASE_INSTANCE) ||
193 BITSET_TEST(nir->info.system_values_read, SYSTEM_VALUE_VERTEX_ID_ZERO_BASE) ||
194 BITSET_TEST(nir->info.system_values_read, SYSTEM_VALUE_INSTANCE_ID);
196 const unsigned num_inputs = util_bitcount64(nir->info.inputs_read);
198 nir_foreach_function(function, nir) {
226 nir_intrinsic_instr_create(nir, nir_intrinsic_load_input);
275 uint64_t inputs_read = nir->info.inputs_read;
298 brw_nir_lower_vue_inputs(nir_shader *nir,
301 nir_foreach_shader_in_variable(var, nir)
305 nir_lower_io(nir, nir_var_shader_in, type_size_vec4,
309 nir_opt_constant_folding(nir);
311 nir_io_add_const_offset_to_base(nir, nir_var_shader_in);
313 nir_foreach_function(function, nir) {
351 brw_nir_lower_tes_inputs(nir_shader *nir, const struct brw_vue_map *vue_map)
353 nir_foreach_shader_in_variable(var, nir)
356 nir_lower_io(nir, nir_var_shader_in, type_size_vec4,
360 nir_opt_constant_folding(nir);
362 nir_io_add_const_offset_to_base(nir, nir_var_shader_in);
364 nir_foreach_function(function, nir) {
370 nir->info.tess._primitive_mode);
416 brw_nir_lower_fs_inputs(nir_shader *nir,
420 nir_foreach_shader_in_variable(var, nir) {
451 nir_lower_io(nir, nir_var_shader_in, type_size_vec4, lower_io_options);
453 nir_lower_interpolation(nir, ~0);
456 nir_lower_single_sampled(nir);
458 nir_shader_instructions_pass(nir, lower_barycentric_at_offset,
464 nir_opt_constant_folding(nir);
466 nir_io_add_const_offset_to_base(nir, nir_var_shader_in);
470 brw_nir_lower_vue_outputs(nir_shader *nir)
472 nir_foreach_shader_out_variable(var, nir) {
476 nir_lower_io(nir, nir_var_shader_out, type_size_vec4,
481 brw_nir_lower_tcs_outputs(nir_shader *nir, const struct brw_vue_map *vue_map,
484 nir_foreach_shader_out_variable(var, nir) {
488 nir_lower_io(nir, nir_var_shader_out, type_size_vec4,
492 nir_opt_constant_folding(nir);
494 nir_io_add_const_offset_to_base(nir, nir_var_shader_out);
496 nir_foreach_function(function, nir) {
508 brw_nir_lower_fs_outputs(nir_shader *nir)
510 nir_foreach_shader_out_variable(var, nir) {
516 nir_lower_io(nir, nir_var_shader_out, type_size_dvec4, 0);
521 NIR_PASS(this_progress, nir, pass, ##__VA_ARGS__); \
528 brw_nir_optimize(nir_shader *nir, const struct brw_compiler *compiler,
533 (nir->options->lower_flrp16 ? 16 : 0) |
534 (nir->options->lower_flrp32 ? 32 : 0) |
535 (nir->options->lower_flrp64 ? 64 : 0);
594 (nir->info.stage == MESA_SHADER_TESS_CTRL ||
595 nir->info.stage == MESA_SHADER_TESS_EVAL);
630 if (nir->options->max_unroll_iterations != 0) {
812 brw_preprocess_nir(const struct brw_compiler *compiler, nir_shader *nir,
818 const bool is_scalar = compiler->scalar_stage[nir->info.stage];
820 nir_validate_ssa_dominance(nir, "before brw_preprocess_nir");
826 if (nir->info.stage == MESA_SHADER_GEOMETRY)
862 brw_nir_optimize(nir, compiler, is_scalar, true);
864 OPT(nir_lower_doubles, softfp64, nir->options->lower_doubles_options);
898 brw_nir_no_indirect_mask(compiler, nir->info.stage);
929 brw_nir_optimize(nir, compiler, is_scalar, false);
1083 brw_vectorize_lower_mem_access(nir_shader *nir,
1123 nir_shader_has_local_variables(const nir_shader *nir)
1125 nir_foreach_function(func, nir) {
1141 brw_postprocess_nir(nir_shader *nir, const struct brw_compiler *compiler,
1167 if (gl_shader_stage_can_set_fragment_shading_rate(nir->info.stage))
1168 brw_nir_lower_shading_rate_output(nir);
1170 brw_nir_optimize(nir, compiler, is_scalar, false);
1172 if (is_scalar && nir_shader_has_local_variables(nir)) {
1177 brw_nir_optimize(nir, compiler, is_scalar, false);
1180 brw_vectorize_lower_mem_access(nir, compiler, is_scalar,
1184 brw_nir_optimize(nir, compiler, is_scalar, false);
1204 (nir->info.stage == MESA_SHADER_TESS_CTRL ||
1205 nir->info.stage == MESA_SHADER_TESS_EVAL);
1244 NIR_PASS_V(nir, nir_convert_to_lcssa, true, true);
1245 NIR_PASS_V(nir, nir_divergence_analysis);
1255 nir->info.stage != MESA_SHADER_KERNEL &&
1256 nir->info.stage != MESA_SHADER_RAYGEN &&
1257 !gl_shader_stage_is_callable(nir->info.stage);
1268 brw_nir_optimize(nir, compiler, is_scalar, false);
1282 nir_foreach_function(function, nir) {
1288 _mesa_shader_stage_to_string(nir->info.stage));
1289 nir_print_shader(nir, stderr);
1292 nir_validate_ssa_dominance(nir, "before nir_convert_from_ssa");
1312 brw_nir_analyze_boolean_resolves(nir);
1314 nir_sweep(nir);
1318 _mesa_shader_stage_to_string(nir->info.stage));
1319 nir_print_shader(nir, stderr);
1324 brw_nir_apply_sampler_key(nir_shader *nir,
1362 return nir_lower_tex(nir, &tex_options);
1416 brw_nir_apply_key(nir_shader *nir,
1427 .subgroup_size = get_subgroup_size(&nir->info, max_subgroup_size),
1438 brw_nir_optimize(nir, compiler, is_scalar, false);
1604 nir_shader *nir = b.shader;
1610 nir->info.inputs_read = key->outputs_written &
1612 nir->info.outputs_written = key->outputs_written;
1613 nir->info.tess.tcs_vertices_out = key->input_vertices;
1614 nir->num_uniforms = 8 * sizeof(uint32_t);
1616 var = nir_variable_create(nir, nir_var_uniform, glsl_vec4_type(), "hdr_0");
1618 var = nir_variable_create(nir, nir_var_uniform, glsl_vec4_type(), "hdr_1");
1631 uint64_t varyings = nir->info.inputs_read;
1645 nir_validate_shader(nir, "in brw_nir_create_passthrough_tcs");
1647 brw_preprocess_nir(compiler, nir, NULL);
1649 return nir;