Re: [Mesa-dev] [PATCH 11/22] nir: simplify get_io_offset() parameters

2018-11-14 Thread Erik Faye-Lund
On Tue, 2018-11-13 at 16:48 +0100, Karol Herbst wrote:
> From: Rob Clark 
> 
> For pointers we'll need to add another caller, plus in addition a
> type_align() fxn ptr.  So  just simplify things and pass the
> lower_io_state to get_io_offset().
> 
> Signed-off-by: Karol Herbst 

Reviewed-by: Erik Faye-Lund 

> ---
>  src/compiler/nir/nir_lower_io.c | 12 ++--
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/src/compiler/nir/nir_lower_io.c
> b/src/compiler/nir/nir_lower_io.c
> index b3595bb19d5..2a6c284de2b 100644
> --- a/src/compiler/nir/nir_lower_io.c
> +++ b/src/compiler/nir/nir_lower_io.c
> @@ -87,11 +87,11 @@ nir_is_per_vertex_io(const nir_variable *var,
> gl_shader_stage stage)
>  }
>  
>  static nir_ssa_def *
> -get_io_offset(nir_builder *b, nir_deref_instr *deref,
> -  nir_ssa_def **vertex_index,
> -  int (*type_size)(const struct glsl_type *),
> -  unsigned *component)
> +get_io_offset(nir_deref_instr *deref, nir_ssa_def **vertex_index,
> +  struct lower_io_state *state, unsigned *component)
>  {
> +   nir_builder *b = >builder;
> +   int (*type_size)(const struct glsl_type *) = state->type_size;
> nir_deref_path path;
> nir_deref_path_init(, deref, NULL);
>  
> @@ -421,8 +421,8 @@ nir_lower_io_block(nir_block *block,
>nir_ssa_def *vertex_index = NULL;
>unsigned component_offset = var->data.location_frac;
>  
> -  offset = get_io_offset(b, deref, per_vertex ? _index :
> NULL,
> - state->type_size, _offset);
> +  offset = get_io_offset(deref, per_vertex ? _index :
> NULL,
> + state, _offset);
>  
>nir_intrinsic_instr *replacement;
>  

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


[Mesa-dev] [PATCH 11/22] nir: simplify get_io_offset() parameters

2018-11-13 Thread Karol Herbst
From: Rob Clark 

For pointers we'll need to add another caller, plus in addition a
type_align() fxn ptr.  So  just simplify things and pass the
lower_io_state to get_io_offset().

Signed-off-by: Karol Herbst 
---
 src/compiler/nir/nir_lower_io.c | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/compiler/nir/nir_lower_io.c b/src/compiler/nir/nir_lower_io.c
index b3595bb19d5..2a6c284de2b 100644
--- a/src/compiler/nir/nir_lower_io.c
+++ b/src/compiler/nir/nir_lower_io.c
@@ -87,11 +87,11 @@ nir_is_per_vertex_io(const nir_variable *var, 
gl_shader_stage stage)
 }
 
 static nir_ssa_def *
-get_io_offset(nir_builder *b, nir_deref_instr *deref,
-  nir_ssa_def **vertex_index,
-  int (*type_size)(const struct glsl_type *),
-  unsigned *component)
+get_io_offset(nir_deref_instr *deref, nir_ssa_def **vertex_index,
+  struct lower_io_state *state, unsigned *component)
 {
+   nir_builder *b = >builder;
+   int (*type_size)(const struct glsl_type *) = state->type_size;
nir_deref_path path;
nir_deref_path_init(, deref, NULL);
 
@@ -421,8 +421,8 @@ nir_lower_io_block(nir_block *block,
   nir_ssa_def *vertex_index = NULL;
   unsigned component_offset = var->data.location_frac;
 
-  offset = get_io_offset(b, deref, per_vertex ? _index : NULL,
- state->type_size, _offset);
+  offset = get_io_offset(deref, per_vertex ? _index : NULL,
+ state, _offset);
 
   nir_intrinsic_instr *replacement;
 
-- 
2.19.1

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