nir: patch up deref-vars when lowering clip-planes
authorErik Faye-Lund <erik.faye-lund@collabora.com>
Wed, 30 Oct 2019 13:53:56 +0000 (14:53 +0100)
committerErik Faye-Lund <erik.faye-lund@collabora.com>
Tue, 12 Nov 2019 08:13:22 +0000 (09:13 +0100)
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>
src/compiler/nir/nir_lower_clip.c

index 81c714971b2cf6e4a91c7d77a86228f06949e5f5..cf8a5d93c76450998e17fee26efc88298ff93d3e 100644 (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)