nir: Add nir_foreach_shader_in/out_variable helpers

Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5966>
This commit is contained in:
Jason Ekstrand
2020-07-18 18:24:25 -05:00
committed by Marge Bot
parent 9bf8572222
commit 2956d53400
58 changed files with 125 additions and 116 deletions

View File

@@ -1367,7 +1367,7 @@ handle_vs_input_decl(struct radv_shader_context *ctx,
static void
handle_vs_inputs(struct radv_shader_context *ctx,
struct nir_shader *nir) {
nir_foreach_variable(variable, &nir->inputs)
nir_foreach_shader_in_variable(variable, nir)
handle_vs_input_decl(ctx, variable);
}
@@ -1377,7 +1377,7 @@ prepare_interp_optimize(struct radv_shader_context *ctx,
{
bool uses_center = false;
bool uses_centroid = false;
nir_foreach_variable(variable, &nir->inputs) {
nir_foreach_shader_in_variable(variable, nir) {
if (glsl_get_base_type(glsl_without_array(variable->type)) != GLSL_TYPE_FLOAT ||
variable->data.sample)
continue;
@@ -4090,7 +4090,7 @@ LLVMModuleRef ac_translate_nir_to_llvm(struct ac_llvm_compiler *ac_llvm,
ac_emit_barrier(&ctx.ac, ctx.stage);
}
nir_foreach_variable(variable, &shaders[i]->outputs)
nir_foreach_shader_out_variable(variable, shaders[i])
scan_shader_output_decl(&ctx, variable, shaders[i], shaders[i]->info.stage);
ac_setup_rings(&ctx);
@@ -4409,7 +4409,7 @@ radv_compile_gs_copy_shader(struct ac_llvm_compiler *ac_llvm,
ac_setup_rings(&ctx);
nir_foreach_variable(variable, &geom_shader->outputs) {
nir_foreach_shader_out_variable(variable, geom_shader) {
scan_shader_output_decl(&ctx, variable, geom_shader, MESA_SHADER_VERTEX);
ac_handle_shader_output_decl(&ctx.ac, &ctx.abi, geom_shader,
variable, MESA_SHADER_VERTEX);