[Mesa-dev] [PATCH 3/3] nir: Define system values for vc4's blending-lowering arguments.

Kenneth Graunke kenneth at whitecape.org
Sat Aug 20 03:00:15 UTC 2016


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 <kenneth at 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)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: This is a digitally signed message part.
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20160819/c47121bf/attachment-0001.sig>


More information about the mesa-dev mailing list