radeonsi/nir: clean up gather_intrinsic_load_deref_input_info
authorMarek Olšák <marek.olsak@amd.com>
Tue, 23 Jul 2019 22:00:50 +0000 (18:00 -0400)
committerMarek Olšák <marek.olsak@amd.com>
Wed, 31 Jul 2019 02:06:23 +0000 (22:06 -0400)
src/gallium/drivers/radeonsi/si_shader_nir.c

index 23728a72375ae3f81a824c7b584073ef0aaaf439..5c23ea50bee3f5fc581045ab38c3b9a9fedc2113 100644 (file)
@@ -75,17 +75,15 @@ static void gather_intrinsic_load_deref_input_info(const nir_shader *nir,
                }
                break;
        }
-       default: {
-               unsigned semantic_name, semantic_index;
-               tgsi_get_gl_varying_semantic(var->data.location, true,
-                                            &semantic_name, &semantic_index);
-
-               if (semantic_name == TGSI_SEMANTIC_COLOR) {
+       case MESA_SHADER_FRAGMENT:
+               if (var->data.location == VARYING_SLOT_COL0 ||
+                   var->data.location == VARYING_SLOT_COL1) {
+                       unsigned index = var->data.location == VARYING_SLOT_COL1;
                        uint8_t mask = nir_ssa_def_components_read(&instr->dest.ssa);
-                       info->colors_read |= mask << (semantic_index * 4);
+                       info->colors_read |= mask << (index * 4);
                }
                break;
-       }
+       default:;
        }
 }