[Mesa-dev] [PATCH 1/5] nir: Avoid empty {} struct initializer.

Ian Romanick idr at freedesktop.org
Wed Apr 13 18:21:53 UTC 2016


On 04/13/2016 10:19 AM, Emil Velikov wrote:
> From: Jose Fonseca <jfonseca at vmware.com>
> 
> Not supported by MSVC and consistent throught NIR.
                                       ^^^^^^^^ through?

> [Emil Velikov: rebase]
> Signed-off-by: Emil Velikov <emil.velikov at collabora.com>
> ---
>  src/compiler/nir/nir_intrinsics.h | 20 ++++++++++----------
>  1 file changed, 10 insertions(+), 10 deletions(-)
> 
> diff --git a/src/compiler/nir/nir_intrinsics.h b/src/compiler/nir/nir_intrinsics.h
> index 3ba1563..dc7d42c 100644
> --- a/src/compiler/nir/nir_intrinsics.h
> +++ b/src/compiler/nir/nir_intrinsics.h
> @@ -42,9 +42,9 @@
>  #define ARR(...) { __VA_ARGS__ }
>  
>  
> -INTRINSIC(load_var, 0, ARR(), true, 0, 1, 0, xx, xx, xx, NIR_INTRINSIC_CAN_ELIMINATE)
> +INTRINSIC(load_var, 0, ARR(0), true, 0, 1, 0, xx, xx, xx, NIR_INTRINSIC_CAN_ELIMINATE)
>  INTRINSIC(store_var, 1, ARR(0), false, 0, 1, 1, WRMASK, xx, xx, 0)
> -INTRINSIC(copy_var, 0, ARR(), false, 0, 2, 0, xx, xx, xx, 0)
> +INTRINSIC(copy_var, 0, ARR(0), false, 0, 2, 0, xx, xx, xx, 0)
>  
>  /*
>   * Interpolation of input.  The interp_var_at* intrinsics are similar to the
> @@ -72,7 +72,7 @@ INTRINSIC(get_buffer_size, 1, ARR(1), true, 1, 0, 0, xx, xx, xx,
>   * a barrier is an intrinsic with no inputs/outputs but which can't be moved
>   * around/optimized in general
>   */
> -#define BARRIER(name) INTRINSIC(name, 0, ARR(), false, 0, 0, 0, xx, xx, xx, 0)
> +#define BARRIER(name) INTRINSIC(name, 0, ARR(0), false, 0, 0, 0, xx, xx, xx, 0)
>  
>  BARRIER(barrier)
>  BARRIER(discard)
> @@ -89,7 +89,7 @@ BARRIER(memory_barrier)
>   * The latter can be used as code motion barrier, which is currently not
>   * feasible with NIR.
>   */
> -INTRINSIC(shader_clock, 0, ARR(), true, 1, 0, 0, xx, xx, xx, NIR_INTRINSIC_CAN_ELIMINATE)
> +INTRINSIC(shader_clock, 0, ARR(0), true, 1, 0, 0, xx, xx, xx, NIR_INTRINSIC_CAN_ELIMINATE)
>  
>  /*
>   * Memory barrier with semantics analogous to the compute shader
> @@ -113,8 +113,8 @@ INTRINSIC(discard_if, 1, ARR(1), false, 0, 0, 0, xx, xx, xx, 0)
>   *
>   * end_primitive implements GLSL's EndPrimitive() built-in.
>   */
> -INTRINSIC(emit_vertex,   0, ARR(), false, 0, 0, 1, STREAM_ID, xx, xx, 0)
> -INTRINSIC(end_primitive, 0, ARR(), false, 0, 0, 1, STREAM_ID, xx, xx, 0)
> +INTRINSIC(emit_vertex,   0, ARR(0), false, 0, 0, 1, STREAM_ID, xx, xx, 0)
> +INTRINSIC(end_primitive, 0, ARR(0), false, 0, 0, 1, STREAM_ID, xx, xx, 0)
>  
>  /**
>   * Geometry Shader intrinsics with a vertex count.
> @@ -137,7 +137,7 @@ INTRINSIC(set_vertex_count, 1, ARR(1), false, 0, 0, 0, xx, xx, xx, 0)
>   */
>  
>  #define ATOMIC(name, flags) \
> -   INTRINSIC(atomic_counter_##name##_var, 0, ARR(), true, 1, 1, 0, xx, xx, xx, flags) \
> +   INTRINSIC(atomic_counter_##name##_var, 0, ARR(0), true, 1, 1, 0, xx, xx, xx, flags) \
>     INTRINSIC(atomic_counter_##name, 1, ARR(1), true, 1, 0, 1, BASE, xx, xx, flags)
>  
>  ATOMIC(inc, 0)
> @@ -170,9 +170,9 @@ INTRINSIC(image_atomic_or, 3, ARR(4, 1, 1), true, 1, 1, 0, xx, xx, xx, 0)
>  INTRINSIC(image_atomic_xor, 3, ARR(4, 1, 1), true, 1, 1, 0, xx, xx, xx, 0)
>  INTRINSIC(image_atomic_exchange, 3, ARR(4, 1, 1), true, 1, 1, 0, xx, xx, xx, 0)
>  INTRINSIC(image_atomic_comp_swap, 4, ARR(4, 1, 1, 1), true, 1, 1, 0, xx, xx, xx, 0)
> -INTRINSIC(image_size, 0, ARR(), true, 4, 1, 0, xx, xx, xx,
> +INTRINSIC(image_size, 0, ARR(0), true, 4, 1, 0, xx, xx, xx,
>            NIR_INTRINSIC_CAN_ELIMINATE | NIR_INTRINSIC_CAN_REORDER)
> -INTRINSIC(image_samples, 0, ARR(), true, 1, 1, 0, xx, xx, xx,
> +INTRINSIC(image_samples, 0, ARR(0), true, 1, 1, 0, xx, xx, xx,
>            NIR_INTRINSIC_CAN_ELIMINATE | NIR_INTRINSIC_CAN_REORDER)
>  
>  /*
> @@ -258,7 +258,7 @@ INTRINSIC(shared_atomic_exchange, 2, ARR(1, 1), true, 1, 0, 0, xx, xx, xx, 0)
>  INTRINSIC(shared_atomic_comp_swap, 3, ARR(1, 1, 1), true, 1, 0, 0, xx, xx, xx, 0)
>  
>  #define SYSTEM_VALUE(name, components, num_indices, idx0, idx1, idx2) \
> -   INTRINSIC(load_##name, 0, ARR(), true, components, 0, num_indices, \
> +   INTRINSIC(load_##name, 0, ARR(0), true, components, 0, num_indices, \
>     idx0, idx1, idx2, \
>     NIR_INTRINSIC_CAN_ELIMINATE | NIR_INTRINSIC_CAN_REORDER)
>  
> 



More information about the mesa-dev mailing list