num_rts++;
}
+ bool deleted_output = false;
nir_foreach_variable_safe(var, &nir->outputs) {
if (var->data.location < FRAG_RESULT_DATA0)
continue;
const unsigned rt = var->data.location - FRAG_RESULT_DATA0;
if (rt >= key.nr_color_regions) {
/* Out-of-bounds, throw it away */
+ deleted_output = true;
var->data.mode = nir_var_local;
exec_node_remove(&var->node);
exec_list_push_tail(&impl->locals, &var->node);
var->data.location = rt_to_bindings[rt] + FRAG_RESULT_DATA0;
}
+ if (deleted_output)
+ nir_fixup_deref_modes(nir);
+
if (num_rts == 0) {
/* If we have no render targets, we need a null render target */
rt_bindings[0] = (struct anv_pipeline_binding) {