compiler: tidy up double_inputs_read uses
[mesa.git] / src / compiler / glsl / glsl_to_nir.cpp
index c4ef4f5ce14959f33141a824d55b63ad0bad3767..29e32cde53cb5d79356c1f2fcfbcfd64b586add3 100644 (file)
@@ -133,13 +133,13 @@ static void
 nir_remap_attributes(nir_shader *shader)
 {
    nir_foreach_variable(var, &shader->inputs) {
-      var->data.location += _mesa_bitcount_64(shader->info.double_inputs_read &
+      var->data.location += _mesa_bitcount_64(shader->info.vs.double_inputs &
                                               BITFIELD64_MASK(var->data.location));
    }
 
    /* Once the remap is done, reset double_inputs_read, so later it will have
     * which location/slots are doubles */
-   shader->info.double_inputs_read = 0;
+   shader->info.vs.double_inputs = 0;
 }
 
 nir_shader *
@@ -363,10 +363,11 @@ nir_visitor::visit(ir_variable *ir)
       }
 
       /* Mark all the locations that require two slots */
-      if (glsl_type_is_dual_slot(glsl_without_array(var->type))) {
+      if (shader->info.stage == MESA_SHADER_VERTEX &&
+          glsl_type_is_dual_slot(glsl_without_array(var->type))) {
          for (uint i = 0; i < glsl_count_attribute_slots(var->type, true); i++) {
             uint64_t bitfield = BITFIELD64_BIT(var->data.location + i);
-            shader->info.double_inputs_read |= bitfield;
+            shader->info.vs.double_inputs |= bitfield;
          }
       }
       break;