From: Dave Airlie <[email protected]>

This replaces the patch to remove the assert I sent previously.

When we lower to temporaries unused arrays were getting copied
unnessecarily.

Signed-off-by: Dave Airlie <[email protected]>
---
 src/compiler/nir/nir_lower_io_to_temporaries.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/compiler/nir/nir_lower_io_to_temporaries.c 
b/src/compiler/nir/nir_lower_io_to_temporaries.c
index 3153a49..05fca6e 100644
--- a/src/compiler/nir/nir_lower_io_to_temporaries.c
+++ b/src/compiler/nir/nir_lower_io_to_temporaries.c
@@ -49,6 +49,8 @@ emit_copies(nir_cursor cursor, nir_shader *shader, struct 
exec_list *new_vars,
       nir_variable *newv = exec_node_data(nir_variable, new_node, node);
       nir_variable *temp = exec_node_data(nir_variable, old_node, node);
 
+      if (glsl_type_is_array(temp->type) && glsl_get_length(temp->type) == 0)
+         continue;
       nir_intrinsic_instr *copy =
          nir_intrinsic_instr_create(shader, nir_intrinsic_copy_var);
       copy->variables[0] = nir_deref_var_create(copy, newv);
-- 
2.5.5

_______________________________________________
mesa-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to