aco: Use mesa shader stage when loading inputs.
authorTimur Kristóf <timur.kristof@gmail.com>
Tue, 18 Feb 2020 14:55:54 +0000 (15:55 +0100)
committerMarge Bot <eric+marge@anholt.net>
Wed, 11 Mar 2020 08:34:10 +0000 (08:34 +0000)
This makes it more clear which stages should load these inputs.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3964>

src/amd/compiler/aco_instruction_selection.cpp

index a1c3568bcdee463ea1ef13663924cf41a127ee9d..63debb21b12e181ea2ce41cb5b1fcb99ffc65f60 100644 (file)
@@ -3160,7 +3160,7 @@ void visit_load_input(isel_context *ctx, nir_intrinsic_instr *instr)
 {
    Builder bld(ctx->program, ctx->block);
    Temp dst = get_ssa_temp(ctx, &instr->dest.ssa);
-   if (ctx->stage & sw_vs) {
+   if (ctx->shader->info.stage == MESA_SHADER_VERTEX) {
 
       nir_instr *off_instr = instr->src[0].ssa->parent_instr;
       if (off_instr->type != nir_instr_type_load_const) {
@@ -3353,7 +3353,7 @@ void visit_load_input(isel_context *ctx, nir_intrinsic_instr *instr)
          if (num_temp == dst.size())
             ctx->allocated_vec.emplace(dst.id(), elems);
       }
-   } else if (ctx->stage == fragment_fs) {
+   } else if (ctx->shader->info.stage == MESA_SHADER_FRAGMENT) {
       unsigned offset_idx = instr->intrinsic == nir_intrinsic_load_input ? 0 : 1;
       nir_instr *off_instr = instr->src[offset_idx].ssa->parent_instr;
       if (off_instr->type != nir_instr_type_load_const ||