Re: [Mesa-dev] [PATCH] nir: drop assert for new arrays code.

2016-05-19 Thread Jason Ekstrand
On Thu, May 19, 2016 at 8:48 PM, Dave Airlie  wrote:

> From: Dave Airlie 
>
> This code handles 0 length fine,


Um... No it doesn't.  A length of 0 means unsized which means we really
need to to a get_array_length call and loop.  Am I messing something?


> and with the new glsl layer
> code to handle unsized array better, we can hit this path with
> ./bin/arb_separate_shader_object-GetProgramPipelineiv
>
> removing the assert works fine.
>
> Signed-off-by: Dave Airlie 
> ---
>  src/compiler/nir/nir_lower_var_copies.c | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/src/compiler/nir/nir_lower_var_copies.c
> b/src/compiler/nir/nir_lower_var_copies.c
> index b7e9989..f774f53 100644
> --- a/src/compiler/nir/nir_lower_var_copies.c
> +++ b/src/compiler/nir/nir_lower_var_copies.c
> @@ -93,7 +93,6 @@ emit_copy_load_store(nir_intrinsic_instr *copy_instr,
>unsigned length = glsl_get_length(src_arr_parent->type);
>/* The wildcards should represent the same number of elements */
>assert(length == glsl_get_length(dest_arr_parent->type));
> -  assert(length > 0);
>
>/* Walk over all of the elements that this wildcard refers to and
> * call emit_copy_load_store on each one of them */
> --
> 2.5.5
>
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH] nir: drop assert for new arrays code.

2016-05-19 Thread Dave Airlie
From: Dave Airlie 

This code handles 0 length fine, and with the new glsl layer
code to handle unsized array better, we can hit this path with
./bin/arb_separate_shader_object-GetProgramPipelineiv

removing the assert works fine.

Signed-off-by: Dave Airlie 
---
 src/compiler/nir/nir_lower_var_copies.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/src/compiler/nir/nir_lower_var_copies.c 
b/src/compiler/nir/nir_lower_var_copies.c
index b7e9989..f774f53 100644
--- a/src/compiler/nir/nir_lower_var_copies.c
+++ b/src/compiler/nir/nir_lower_var_copies.c
@@ -93,7 +93,6 @@ emit_copy_load_store(nir_intrinsic_instr *copy_instr,
   unsigned length = glsl_get_length(src_arr_parent->type);
   /* The wildcards should represent the same number of elements */
   assert(length == glsl_get_length(dest_arr_parent->type));
-  assert(length > 0);
 
   /* Walk over all of the elements that this wildcard refers to and
* call emit_copy_load_store on each one of them */
-- 
2.5.5

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev