From aee66f4c8f88d9de57f61ad236a1a4e14ebad3c6 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Wed, 10 Jan 2024 09:57:35 -0400 Subject: [PATCH] mesa/st: don't use NIR_PASS_V Signed-off-by: Alyssa Rosenzweig Reviewed-by: Konstantin Seurer Part-of: --- src/mesa/main/ff_fragment_shader.c | 2 +- src/mesa/main/ffvertex_prog.c | 2 +- src/mesa/main/glspirv.c | 20 +++---- src/mesa/program/prog_to_nir.c | 4 +- src/mesa/state_tracker/st_glsl_to_nir.cpp | 64 ++++++++++----------- src/mesa/state_tracker/st_nir_builtins.c | 16 +++--- src/mesa/state_tracker/st_program.c | 70 +++++++++++------------ 7 files changed, 89 insertions(+), 89 deletions(-) diff --git a/src/mesa/main/ff_fragment_shader.c b/src/mesa/main/ff_fragment_shader.c index 2f17758ac97..e34a3ee5bcc 100644 --- a/src/mesa/main/ff_fragment_shader.c +++ b/src/mesa/main/ff_fragment_shader.c @@ -963,7 +963,7 @@ create_new_program(struct state_key *key, nir_validate_shader(b.shader, "after generating ff-vertex shader"); if (key->fog_mode) - NIR_PASS_V(b.shader, st_nir_lower_fog, key->fog_mode, p.state_params); + NIR_PASS(_, b.shader, st_nir_lower_fog, key->fog_mode, p.state_params); _mesa_add_separate_state_parameters(program, p.state_params); _mesa_free_parameter_list(p.state_params); diff --git a/src/mesa/main/ffvertex_prog.c b/src/mesa/main/ffvertex_prog.c index 76f58b8cdb5..bcd3fb8dc30 100644 --- a/src/mesa/main/ffvertex_prog.c +++ b/src/mesa/main/ffvertex_prog.c @@ -1343,7 +1343,7 @@ create_new_program( const struct state_key *key, nir_validate_shader(b.shader, "after generating ff-vertex shader"); /* Emit the MVP position transformation */ - NIR_PASS_V(b.shader, st_nir_lower_position_invariant, mvp_with_dp4, p.state_params); + NIR_PASS(_, b.shader, st_nir_lower_position_invariant, mvp_with_dp4, p.state_params); _mesa_add_separate_state_parameters(program, p.state_params); _mesa_free_parameter_list(p.state_params); diff --git a/src/mesa/main/glspirv.c b/src/mesa/main/glspirv.c index 73e4abc20d7..58095da844f 100644 --- a/src/mesa/main/glspirv.c +++ b/src/mesa/main/glspirv.c @@ -303,17 +303,17 @@ _mesa_spirv_to_nir(struct gl_context *ctx, .point_coord = !ctx->Const.GLSLPointCoordIsSysVal, .front_face = !ctx->Const.GLSLFrontFacingIsSysVal, }; - NIR_PASS_V(nir, nir_lower_sysvals_to_varyings, &sysvals_to_varyings); + NIR_PASS(_, nir, nir_lower_sysvals_to_varyings, &sysvals_to_varyings); /* We have to lower away local constant initializers right before we * inline functions. That way they get properly initialized at the top * of the function and not at the top of its caller. */ - NIR_PASS_V(nir, nir_lower_variable_initializers, nir_var_function_temp); - NIR_PASS_V(nir, nir_lower_returns); - NIR_PASS_V(nir, nir_inline_functions); - NIR_PASS_V(nir, nir_copy_prop); - NIR_PASS_V(nir, nir_opt_deref); + NIR_PASS(_, nir, nir_lower_variable_initializers, nir_var_function_temp); + NIR_PASS(_, nir, nir_lower_returns); + NIR_PASS(_, nir, nir_inline_functions); + NIR_PASS(_, nir, nir_copy_prop); + NIR_PASS(_, nir, nir_opt_deref); /* Pick off the single entrypoint that we want */ nir_remove_non_entrypoints(nir); @@ -323,18 +323,18 @@ _mesa_spirv_to_nir(struct gl_context *ctx, * nir_remove_dead_variables and split_per_member_structs below see the * corresponding stores. */ - NIR_PASS_V(nir, nir_lower_variable_initializers, ~0); + NIR_PASS(_, nir, nir_lower_variable_initializers, ~0); /* Split member structs. We do this before lower_io_to_temporaries so that * it doesn't lower system values to temporaries by accident. */ - NIR_PASS_V(nir, nir_split_var_copies); - NIR_PASS_V(nir, nir_split_per_member_structs); + NIR_PASS(_, nir, nir_split_var_copies); + NIR_PASS(_, nir, nir_split_per_member_structs); if (nir->info.stage == MESA_SHADER_VERTEX) nir_remap_dual_slot_attributes(nir, &linked_shader->Program->DualSlotInputs); - NIR_PASS_V(nir, nir_lower_frexp); + NIR_PASS(_, nir, nir_lower_frexp); return nir; } diff --git a/src/mesa/program/prog_to_nir.c b/src/mesa/program/prog_to_nir.c index 5a270eb44f3..0a018d17440 100644 --- a/src/mesa/program/prog_to_nir.c +++ b/src/mesa/program/prog_to_nir.c @@ -901,14 +901,14 @@ prog_to_nir(const struct gl_context *ctx, const struct gl_program *prog, /* ARB_vp: */ if (prog->arb.IsPositionInvariant) { - NIR_PASS_V(s, st_nir_lower_position_invariant, + NIR_PASS(_, s, st_nir_lower_position_invariant, ctx->Const.ShaderCompilerOptions[MESA_SHADER_VERTEX].OptimizeForAOS, prog->Parameters); } /* Add OPTION ARB_fog_exp code */ if (prog->arb.Fog) - NIR_PASS_V(s, st_nir_lower_fog, prog->arb.Fog, prog->Parameters); + NIR_PASS(_, s, st_nir_lower_fog, prog->arb.Fog, prog->Parameters); fail: if (c->error) { diff --git a/src/mesa/state_tracker/st_glsl_to_nir.cpp b/src/mesa/state_tracker/st_glsl_to_nir.cpp index 57c35eb1870..eef8cad5a6f 100644 --- a/src/mesa/state_tracker/st_glsl_to_nir.cpp +++ b/src/mesa/state_tracker/st_glsl_to_nir.cpp @@ -123,7 +123,7 @@ st_nir_assign_vs_in_locations(struct nir_shader *nir) /* Re-lower global vars, to deal with any dead VS inputs. */ if (removed_inputs) - NIR_PASS_V(nir, nir_lower_global_vars_to_local); + NIR_PASS(_, nir, nir_lower_global_vars_to_local); } static int @@ -320,13 +320,13 @@ st_glsl_to_nir_post_opts(struct st_context *st, struct gl_program *prog, */ if (!shader_program->data->spirv && !st->ctx->Const.PackedDriverUniformStorage) - NIR_PASS_V(nir, st_nir_lower_builtin); + NIR_PASS(_, nir, st_nir_lower_builtin); if (!screen->get_param(screen, PIPE_CAP_NIR_ATOMICS_AS_DEREF)) - NIR_PASS_V(nir, gl_nir_lower_atomics, shader_program, true); + NIR_PASS(_, nir, gl_nir_lower_atomics, shader_program, true); - NIR_PASS_V(nir, nir_opt_intrinsics); - NIR_PASS_V(nir, nir_opt_fragdepth); + NIR_PASS(_, nir, nir_opt_intrinsics); + NIR_PASS(_, nir, nir_opt_fragdepth); /* Lower 64-bit ops. */ if (nir->options->lower_int64_options || @@ -357,7 +357,7 @@ st_glsl_to_nir_post_opts(struct st_context *st, struct gl_program *prog, NIR_PASS(lowered_64bit_ops, nir, nir_lower_int64); if (revectorize && !nir->options->vectorize_vec2_16bit) - NIR_PASS_V(nir, nir_opt_vectorize, nullptr, nullptr); + NIR_PASS(_, nir, nir_opt_vectorize, nullptr, nullptr); if (revectorize || lowered_64bit_ops) gl_nir_opts(nir); @@ -377,7 +377,7 @@ st_glsl_to_nir_post_opts(struct st_context *st, struct gl_program *prog, } align_offset_state = STATE_ATOMIC_COUNTER_OFFSET; } - NIR_PASS_V(nir, nir_lower_atomics_to_ssbo, align_offset_state); + NIR_PASS(_, nir, nir_lower_atomics_to_ssbo, align_offset_state); } st_set_prog_affected_state_flags(prog); @@ -404,18 +404,18 @@ static void st_nir_vectorize_io(nir_shader *producer, nir_shader *consumer) { if (consumer) - NIR_PASS_V(consumer, nir_lower_io_to_vector, nir_var_shader_in); + NIR_PASS(_, consumer, nir_lower_io_to_vector, nir_var_shader_in); if (!producer) return; - NIR_PASS_V(producer, nir_lower_io_to_vector, nir_var_shader_out); + NIR_PASS(_, producer, nir_lower_io_to_vector, nir_var_shader_out); if (producer->info.stage == MESA_SHADER_TESS_CTRL && producer->options->vectorize_tess_levels) - NIR_PASS_V(producer, nir_vectorize_tess_levels); + NIR_PASS(_, producer, nir_vectorize_tess_levels); - NIR_PASS_V(producer, nir_opt_combine_stores, nir_var_shader_out); + NIR_PASS(_, producer, nir_opt_combine_stores, nir_var_shader_out); if ((producer)->info.stage != MESA_SHADER_TESS_CTRL) { /* Calling lower_io_to_vector creates output variable writes with @@ -424,19 +424,19 @@ st_nir_vectorize_io(nir_shader *producer, nir_shader *consumer) * them. This, in turn, creates temporary variables and extra * copy_deref intrinsics that we need to clean up. */ - NIR_PASS_V(producer, nir_lower_io_to_temporaries, + NIR_PASS(_, producer, nir_lower_io_to_temporaries, nir_shader_get_entrypoint(producer), true, false); - NIR_PASS_V(producer, nir_lower_global_vars_to_local); - NIR_PASS_V(producer, nir_split_var_copies); - NIR_PASS_V(producer, nir_lower_var_copies); + NIR_PASS(_, producer, nir_lower_global_vars_to_local); + NIR_PASS(_, producer, nir_split_var_copies); + NIR_PASS(_, producer, nir_lower_var_copies); } /* Undef scalar store_deref intrinsics are not ignored by nir_lower_io, * so they must be removed before that. These passes remove them. */ - NIR_PASS_V(producer, nir_lower_vars_to_ssa); - NIR_PASS_V(producer, nir_opt_undef); - NIR_PASS_V(producer, nir_opt_dce); + NIR_PASS(_, producer, nir_lower_vars_to_ssa); + NIR_PASS(_, producer, nir_opt_undef); + NIR_PASS(_, producer, nir_opt_dce); } extern "C" { @@ -608,7 +608,7 @@ st_link_glsl_to_nir(struct gl_context *ctx, /* This needs to run after the initial pass of nir_lower_vars_to_ssa, so * that the buffer indices are constants in nir where they where * constants in GLSL. */ - NIR_PASS_V(nir, gl_nir_lower_buffers, shader_program); + NIR_PASS(_, nir, gl_nir_lower_buffers, shader_program); /* Remap the locations to slots so those requiring two slots will occupy * two locations. For instance, if we have in the IR code a dvec3 attr0 in @@ -618,11 +618,11 @@ st_link_glsl_to_nir(struct gl_context *ctx, if (nir->info.stage == MESA_SHADER_VERTEX && !shader_program->data->spirv) nir_remap_dual_slot_attributes(nir, &shader->Program->DualSlotInputs); - NIR_PASS_V(nir, st_nir_lower_wpos_ytransform, shader->Program, + NIR_PASS(_, nir, st_nir_lower_wpos_ytransform, shader->Program, st->screen); - NIR_PASS_V(nir, nir_lower_system_values); - NIR_PASS_V(nir, nir_lower_compute_system_values, NULL); + NIR_PASS(_, nir, nir_lower_system_values); + NIR_PASS(_, nir, nir_lower_compute_system_values, NULL); if (i >= 1) { struct gl_program *prev_shader = linked_shader[i - 1]->Program; @@ -786,9 +786,9 @@ st_nir_lower_samplers(struct pipe_screen *screen, nir_shader *nir, struct gl_program *prog) { if (screen->get_param(screen, PIPE_CAP_NIR_SAMPLERS_AS_DEREF)) - NIR_PASS_V(nir, gl_nir_lower_samplers_as_deref, shader_program); + NIR_PASS(_, nir, gl_nir_lower_samplers_as_deref, shader_program); else - NIR_PASS_V(nir, gl_nir_lower_samplers, shader_program); + NIR_PASS(_, nir, gl_nir_lower_samplers, shader_program); if (prog) { BITSET_COPY(prog->info.textures_used, nir->info.textures_used); @@ -816,17 +816,17 @@ void st_nir_lower_uniforms(struct st_context *st, nir_shader *nir) { if (st->ctx->Const.PackedDriverUniformStorage) { - NIR_PASS_V(nir, nir_lower_io, nir_var_uniform, + NIR_PASS(_, nir, nir_lower_io, nir_var_uniform, st_packed_uniforms_type_size, (nir_lower_io_options)0); } else { - NIR_PASS_V(nir, nir_lower_io, nir_var_uniform, + NIR_PASS(_, nir, nir_lower_io, nir_var_uniform, st_unpacked_uniforms_type_size, (nir_lower_io_options)0); } if (nir->options->lower_uniforms_to_ubo) - NIR_PASS_V(nir, nir_lower_uniforms_to_ubo, + NIR_PASS(_, nir, nir_lower_uniforms_to_ubo, st->ctx->Const.PackedDriverUniformStorage, !st->ctx->Const.NativeIntegers); } @@ -844,8 +844,8 @@ st_finalize_nir(struct st_context *st, struct gl_program *prog, MESA_TRACE_FUNC(); - NIR_PASS_V(nir, nir_split_var_copies); - NIR_PASS_V(nir, nir_lower_var_copies); + NIR_PASS(_, nir, nir_split_var_copies); + NIR_PASS(_, nir, nir_lower_var_copies); const bool lower_tg4_offsets = !st->screen->get_param(screen, PIPE_CAP_TEXTURE_GATHER_OFFSETS); @@ -855,7 +855,7 @@ st_finalize_nir(struct st_context *st, struct gl_program *prog, opts.lower_rect = !!st->lower_rect_tex; opts.lower_tg4_offsets = lower_tg4_offsets; - NIR_PASS_V(nir, nir_lower_tex, &opts); + NIR_PASS(_, nir, nir_lower_tex, &opts); } st_nir_assign_varying_locations(st, nir); @@ -866,7 +866,7 @@ st_finalize_nir(struct st_context *st, struct gl_program *prog, */ if (nir->options->lower_io_variables) { nir_lower_io_passes(nir, false); - NIR_PASS_V(nir, nir_remove_dead_variables, + NIR_PASS(_, nir, nir_remove_dead_variables, nir_var_shader_in | nir_var_shader_out, NULL); } @@ -885,7 +885,7 @@ st_finalize_nir(struct st_context *st, struct gl_program *prog, st_nir_lower_samplers(screen, nir, shader_program, prog); if (!screen->get_param(screen, PIPE_CAP_NIR_IMAGES_AS_DEREF)) - NIR_PASS_V(nir, gl_nir_lower_images, false); + NIR_PASS(_, nir, gl_nir_lower_images, false); char *msg = NULL; if (finalize_by_driver && screen->finalize_nir) diff --git a/src/mesa/state_tracker/st_nir_builtins.c b/src/mesa/state_tracker/st_nir_builtins.c index c625a5fc6db..776ceda04c1 100644 --- a/src/mesa/state_tracker/st_nir_builtins.c +++ b/src/mesa/state_tracker/st_nir_builtins.c @@ -39,23 +39,23 @@ st_nir_finish_builtin_nir(struct st_context *st, nir_shader *nir) if (stage == MESA_SHADER_FRAGMENT) nir->info.fs.untyped_color_outputs = true; - NIR_PASS_V(nir, nir_lower_global_vars_to_local); - NIR_PASS_V(nir, nir_split_var_copies); - NIR_PASS_V(nir, nir_lower_var_copies); - NIR_PASS_V(nir, nir_lower_system_values); - NIR_PASS_V(nir, nir_lower_compute_system_values, NULL); + NIR_PASS(_, nir, nir_lower_global_vars_to_local); + NIR_PASS(_, nir, nir_split_var_copies); + NIR_PASS(_, nir, nir_lower_var_copies); + NIR_PASS(_, nir, nir_lower_system_values); + NIR_PASS(_, nir, nir_lower_compute_system_values, NULL); if (nir->options->lower_to_scalar) { nir_variable_mode mask = (stage > MESA_SHADER_VERTEX ? nir_var_shader_in : 0) | (stage < MESA_SHADER_FRAGMENT ? nir_var_shader_out : 0); - NIR_PASS_V(nir, nir_lower_io_to_scalar_early, mask); + NIR_PASS(_, nir, nir_lower_io_to_scalar_early, mask); } if (st->lower_rect_tex) { const struct nir_lower_tex_options opts = { .lower_rect = true, }; - NIR_PASS_V(nir, nir_lower_tex, &opts); + NIR_PASS(_, nir, nir_lower_tex, &opts); } nir_shader_gather_info(nir, nir_shader_get_entrypoint(nir)); @@ -66,7 +66,7 @@ st_nir_finish_builtin_nir(struct st_context *st, nir_shader *nir) st_nir_lower_samplers(screen, nir, NULL, NULL); st_nir_lower_uniforms(st, nir); if (!screen->get_param(screen, PIPE_CAP_NIR_IMAGES_AS_DEREF)) - NIR_PASS_V(nir, gl_nir_lower_images, false); + NIR_PASS(_, nir, gl_nir_lower_images, false); if (screen->finalize_nir) { char *msg = screen->finalize_nir(screen, nir); diff --git a/src/mesa/state_tracker/st_program.c b/src/mesa/state_tracker/st_program.c index ab3ed71acb2..1f36e51572f 100644 --- a/src/mesa/state_tracker/st_program.c +++ b/src/mesa/state_tracker/st_program.c @@ -346,15 +346,15 @@ st_release_program(struct st_context *st, struct gl_program **p) void st_finalize_nir_before_variants(struct nir_shader *nir) { - NIR_PASS_V(nir, nir_split_var_copies); - NIR_PASS_V(nir, nir_lower_var_copies); + NIR_PASS(_, nir, nir_split_var_copies); + NIR_PASS(_, nir, nir_lower_var_copies); if (nir->options->lower_all_io_to_temps || nir->options->lower_all_io_to_elements || nir->info.stage == MESA_SHADER_VERTEX || nir->info.stage == MESA_SHADER_GEOMETRY) { - NIR_PASS_V(nir, nir_lower_io_arrays_to_elements_no_indirects, false); + NIR_PASS(_, nir, nir_lower_io_arrays_to_elements_no_indirects, false); } else if (nir->info.stage == MESA_SHADER_FRAGMENT) { - NIR_PASS_V(nir, nir_lower_io_arrays_to_elements_no_indirects, true); + NIR_PASS(_, nir, nir_lower_io_arrays_to_elements_no_indirects, true); } /* st_nir_assign_vs_in_locations requires correct shader info. */ @@ -369,23 +369,23 @@ st_prog_to_nir_postprocess(struct st_context *st, nir_shader *nir, { struct pipe_screen *screen = st->screen; - NIR_PASS_V(nir, nir_lower_reg_intrinsics_to_ssa); + NIR_PASS(_, nir, nir_lower_reg_intrinsics_to_ssa); nir_validate_shader(nir, "after st/ptn lower_reg_intrinsics_to_ssa"); /* Lower outputs to temporaries to avoid reading from output variables (which * is permitted by the language but generally not implemented in HW). */ - NIR_PASS_V(nir, nir_lower_io_to_temporaries, + NIR_PASS(_, nir, nir_lower_io_to_temporaries, nir_shader_get_entrypoint(nir), true, false); - NIR_PASS_V(nir, nir_lower_global_vars_to_local); + NIR_PASS(_, nir, nir_lower_global_vars_to_local); - NIR_PASS_V(nir, st_nir_lower_wpos_ytransform, prog, screen); - NIR_PASS_V(nir, nir_lower_system_values); - NIR_PASS_V(nir, nir_lower_compute_system_values, NULL); + NIR_PASS(_, nir, st_nir_lower_wpos_ytransform, prog, screen); + NIR_PASS(_, nir, nir_lower_system_values); + NIR_PASS(_, nir, nir_lower_compute_system_values, NULL); /* Optimise NIR */ - NIR_PASS_V(nir, nir_opt_constant_folding); + NIR_PASS(_, nir, nir_opt_constant_folding); gl_nir_opts(nir); st_finalize_nir_before_variants(nir); @@ -602,7 +602,7 @@ lower_ucp(struct st_context *st, struct gl_program_parameter_list *params) { if (nir->info.outputs_written & VARYING_BIT_CLIP_DIST0) - NIR_PASS_V(nir, nir_lower_clip_disable, ucp_enables); + NIR_PASS(_, nir, nir_lower_clip_disable, ucp_enables); else { struct pipe_screen *screen = st->screen; bool can_compact = screen->get_param(screen, @@ -623,16 +623,16 @@ lower_ucp(struct st_context *st, if (nir->info.stage == MESA_SHADER_VERTEX || nir->info.stage == MESA_SHADER_TESS_EVAL) { - NIR_PASS_V(nir, nir_lower_clip_vs, ucp_enables, + NIR_PASS(_, nir, nir_lower_clip_vs, ucp_enables, true, can_compact, clipplane_state); } else if (nir->info.stage == MESA_SHADER_GEOMETRY) { - NIR_PASS_V(nir, nir_lower_clip_gs, ucp_enables, + NIR_PASS(_, nir, nir_lower_clip_gs, ucp_enables, can_compact, clipplane_state); } - NIR_PASS_V(nir, nir_lower_io_to_temporaries, + NIR_PASS(_, nir, nir_lower_io_to_temporaries, nir_shader_get_entrypoint(nir), true, false); - NIR_PASS_V(nir, nir_lower_global_vars_to_local); + NIR_PASS(_, nir, nir_lower_global_vars_to_local); } } @@ -661,18 +661,18 @@ st_create_common_variant(struct st_context *st, const nir_shader_compiler_options *options = ((nir_shader *)state.ir.nir)->options; if (key->clamp_color) { - NIR_PASS_V(state.ir.nir, nir_lower_clamp_color_outputs); + NIR_PASS(_, state.ir.nir, nir_lower_clamp_color_outputs); finalize = true; } if (key->passthrough_edgeflags) { - NIR_PASS_V(state.ir.nir, nir_lower_passthrough_edgeflags); + NIR_PASS(_, state.ir.nir, nir_lower_passthrough_edgeflags); finalize = true; } if (key->export_point_size) { /* if flag is set, shader must export psiz */ _mesa_add_state_reference(params, point_size_state); - NIR_PASS_V(state.ir.nir, nir_lower_point_size_mov, + NIR_PASS(_, state.ir.nir, nir_lower_point_size_mov, point_size_state); finalize = true; @@ -690,7 +690,7 @@ st_create_common_variant(struct st_context *st, tex_opts.saturate_s = key->gl_clamp[0]; tex_opts.saturate_t = key->gl_clamp[1]; tex_opts.saturate_r = key->gl_clamp[2]; - NIR_PASS_V(state.ir.nir, nir_lower_tex, &tex_opts); + NIR_PASS(_, state.ir.nir, nir_lower_tex, &tex_opts); } if (finalize || !st->allow_st_finalize_nir_twice) { @@ -713,7 +713,7 @@ st_create_common_variant(struct st_context *st, } if (key->is_draw_shader) { - NIR_PASS_V(state.ir.nir, gl_nir_lower_images, false); + NIR_PASS(_, state.ir.nir, gl_nir_lower_images, false); v->base.driver_shader = draw_create_vertex_shader(st->draw, &state); } else @@ -883,38 +883,38 @@ st_create_fp_variant(struct st_context *st, if (fp->ati_fs) { if (key->fog) { - NIR_PASS_V(state.ir.nir, st_nir_lower_fog, key->fog, fp->Parameters); - NIR_PASS_V(state.ir.nir, nir_lower_io_to_temporaries, + NIR_PASS(_, state.ir.nir, st_nir_lower_fog, key->fog, fp->Parameters); + NIR_PASS(_, state.ir.nir, nir_lower_io_to_temporaries, nir_shader_get_entrypoint(state.ir.nir), true, false); nir_lower_global_vars_to_local(state.ir.nir); } - NIR_PASS_V(state.ir.nir, st_nir_lower_atifs_samplers, key->texture_index); + NIR_PASS(_, state.ir.nir, st_nir_lower_atifs_samplers, key->texture_index); finalize = true; } if (key->clamp_color) { - NIR_PASS_V(state.ir.nir, nir_lower_clamp_color_outputs); + NIR_PASS(_, state.ir.nir, nir_lower_clamp_color_outputs); finalize = true; } if (key->lower_flatshade) { - NIR_PASS_V(state.ir.nir, nir_lower_flatshade); + NIR_PASS(_, state.ir.nir, nir_lower_flatshade); finalize = true; } if (key->lower_alpha_func != COMPARE_FUNC_ALWAYS) { _mesa_add_state_reference(params, alpha_ref_state); - NIR_PASS_V(state.ir.nir, nir_lower_alpha_test, key->lower_alpha_func, + NIR_PASS(_, state.ir.nir, nir_lower_alpha_test, key->lower_alpha_func, false, alpha_ref_state); finalize = true; } if (key->lower_two_sided_color) { bool face_sysval = st->ctx->Const.GLSLFrontFacingIsSysVal; - NIR_PASS_V(state.ir.nir, nir_lower_two_sided_color, face_sysval); + NIR_PASS(_, state.ir.nir, nir_lower_two_sided_color, face_sysval); finalize = true; } @@ -939,7 +939,7 @@ st_create_fp_variant(struct st_context *st, tex_opts.saturate_s = key->gl_clamp[0]; tex_opts.saturate_t = key->gl_clamp[1]; tex_opts.saturate_r = key->gl_clamp[2]; - NIR_PASS_V(state.ir.nir, nir_lower_tex, &tex_opts); + NIR_PASS(_, state.ir.nir, nir_lower_tex, &tex_opts); finalize = true; } @@ -953,7 +953,7 @@ st_create_fp_variant(struct st_context *st, options.sampler = variant->bitmap_sampler; options.swizzle_xxxx = st->bitmap.tex_format == PIPE_FORMAT_R8_UNORM; - NIR_PASS_V(state.ir.nir, nir_lower_bitmap, &options); + NIR_PASS(_, state.ir.nir, nir_lower_bitmap, &options); finalize = true; } @@ -987,7 +987,7 @@ st_create_fp_variant(struct st_context *st, memcpy(options.texcoord_state_tokens, texcoord_state, sizeof(options.texcoord_state_tokens)); - NIR_PASS_V(state.ir.nir, nir_lower_drawpixels, &options); + NIR_PASS(_, state.ir.nir, nir_lower_drawpixels, &options); finalize = true; } @@ -1021,7 +1021,7 @@ st_create_fp_variant(struct st_context *st, options.bt709_external = key->external.bt709; options.bt2020_external = key->external.bt2020; options.yuv_full_range_external = key->external.yuv_full_range; - NIR_PASS_V(state.ir.nir, nir_lower_tex, &options); + NIR_PASS(_, state.ir.nir, nir_lower_tex, &options); finalize = true; need_lower_tex_src_plane = true; } @@ -1034,7 +1034,7 @@ st_create_fp_variant(struct st_context *st, /* This pass needs to happen *after* nir_lower_sampler */ if (unlikely(need_lower_tex_src_plane)) { - NIR_PASS_V(state.ir.nir, st_nir_lower_tex_src_plane, + NIR_PASS(_, state.ir.nir, st_nir_lower_tex_src_plane, ~fp->SamplersUsed, key->external.lower_nv12 | key->external.lower_nv21 | key->external.lower_xy_uxvx | key->external.lower_xy_vxux | @@ -1050,7 +1050,7 @@ st_create_fp_variant(struct st_context *st, * breaks with mesa. Replace the shadow sampler with a normal one here */ if (!fp->shader_program && ~key->depth_textures & fp->ShadowSamplers) { - NIR_PASS_V(state.ir.nir, nir_remove_tex_shadow, + NIR_PASS(_, state.ir.nir, nir_remove_tex_shadow, ~key->depth_textures & fp->ShadowSamplers); finalize = true; } @@ -1371,7 +1371,7 @@ st_program_string_notify( struct gl_context *ctx, if (st->lower_point_size && gl_nir_can_add_pointsize_to_program(&st->ctx->Const, prog)) { prog->skip_pointsize_xfb = true; - NIR_PASS_V(prog->nir, gl_nir_add_point_size); + NIR_PASS(_, prog->nir, gl_nir_add_point_size); } }