On Saturday, August 6, 2016 12:28:38 AM PDT Eric Anholt wrote:
> In the GLSL-to-NIR conversion of VC4, I had a bit of trouble with what I
> was calling the "state uniforms" that I was putting into the NIR fighting
> with its other lowering passes.  Instead of using magic uniform base
> numbers in the backend, follow the lead of load_user_clip_plane and just
> define system values for them.
> ---
>  src/compiler/nir/nir_intrinsics.h             | 11 +++++-
>  src/gallium/drivers/vc4/vc4_nir_lower_blend.c | 29 ++++++++------
>  src/gallium/drivers/vc4/vc4_nir_lower_io.c    |  8 ++--
>  src/gallium/drivers/vc4/vc4_program.c         | 56 
> +++++++++++++++------------
>  src/gallium/drivers/vc4/vc4_qir.h             |  7 ----
>  5 files changed, 64 insertions(+), 47 deletions(-)
> 
> diff --git a/src/compiler/nir/nir_intrinsics.h 
> b/src/compiler/nir/nir_intrinsics.h
> index 4cb04373e00d..f9dea10a6917 100644
> --- a/src/compiler/nir/nir_intrinsics.h
> +++ b/src/compiler/nir/nir_intrinsics.h
> @@ -309,7 +309,16 @@ SYSTEM_VALUE(work_group_id, 3, 0, xx, xx, xx)
>  SYSTEM_VALUE(user_clip_plane, 4, 1, UCP_ID, xx, xx)
>  SYSTEM_VALUE(num_work_groups, 3, 0, xx, xx, xx)
>  SYSTEM_VALUE(helper_invocation, 1, 0, xx, xx, xx)
> -SYSTEM_VALUE(channel_num, 1, 0, xx, xx, xx)
> +SYSTEM_VALUE(channel_num, 1, 0, BASE, xx, xx)

^^^ This looks like a mistake...you're not doing anything with
channel_num in this series, and making it have a BASE but specify 0
const_index fields can't be right.  Please drop this.

> +SYSTEM_VALUE(alpha_ref_float, 1, 0, xx, xx, xx)
> +
> +/* Blend constant color values.  Float values are clamped. */
> +SYSTEM_VALUE(blend_const_color_r_float, 1, 1, xx, xx, xx)

Please drop the index here too - should be 1, 0, xx, xx, xx.

Otherwise, it all looks pretty reasonable.  With those two things fixed,

Reviewed-by: Kenneth Graunke <kenn...@whitecape.org>

> +SYSTEM_VALUE(blend_const_color_g_float, 1, 0, xx, xx, xx)
> +SYSTEM_VALUE(blend_const_color_b_float, 1, 0, xx, xx, xx)
> +SYSTEM_VALUE(blend_const_color_a_float, 1, 0, xx, xx, xx)
> +SYSTEM_VALUE(blend_const_color_rgba8888_unorm, 1, 0, xx, xx, xx)
> +SYSTEM_VALUE(blend_const_color_aaaa8888_unorm, 1, 0, xx, xx, xx)

Attachment: signature.asc
Description: This is a digitally signed message part.

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

Reply via email to