{
int maxloc = -1;
- nir_foreach_variable(var, &s->inputs)
- maxloc = MAX2(maxloc, var->data.driver_location);
+ nir_foreach_variable(var, &s->outputs)
+ maxloc = MAX2(maxloc, (int)var->data.driver_location);
- return maxloc;
+ return maxloc + 1;
}
static void
sample_mask->data.driver_location =
vc4_nir_next_output_driver_location(c->s);
sample_mask->data.location = FRAG_RESULT_SAMPLE_MASK;
- exec_list_push_tail(&c->s->outputs, &sample_mask->node);
nir_intrinsic_instr *intr =
nir_intrinsic_instr_create(c->s, nir_intrinsic_store_output);
intr->num_components = 1;
- intr->const_index[0] = sample_mask->data.location;
+ intr->const_index[0] = sample_mask->data.driver_location;
intr->src[0] = nir_src_for_ssa(val);
intr->src[1] = nir_src_for_ssa(nir_imm_int(b, 0));
/* Color output is lowered by vc4_nir_lower_blend(). */
if (c->stage == QSTAGE_FRAG &&
(output_var->data.location == FRAG_RESULT_COLOR ||
- output_var->data.location == FRAG_RESULT_DATA0)) {
+ output_var->data.location == FRAG_RESULT_DATA0 ||
+ output_var->data.location == FRAG_RESULT_SAMPLE_MASK)) {
intr->const_index[0] *= 4;
return;
}