nir: patch up deref-vars when lowering clip-planes

Otherwise, we fail validation and potentially generate invalid code.
Let's fix up the mode of the accesses to the variable.

Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
This commit is contained in:
Erik Faye-Lund
2019-10-30 14:53:56 +01:00
parent bef7b2f805
commit 9b8964d064

View File

@@ -243,6 +243,7 @@ lower_clip_outputs(nir_builder *b, nir_variable *position,
exec_node_remove(&clipvertex->node);
clipvertex->data.mode = nir_var_shader_temp;
exec_list_push_tail(&b->shader->globals, &clipvertex->node);
nir_fixup_deref_modes(b->shader);
}
} else {
if (clipvertex)