From e8378fee0c20ecd26451c079c725420077606cb9 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 26 Jul 2016 17:31:44 -0700 Subject: nir: Define system values for vc4's blending-lowering arguments. 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. v2: Fix unintended change to channel_num, drop unspecified const_index value on blend_const_color_r_float. Reviewed-by: Kenneth Graunke --- src/compiler/nir/nir_intrinsics.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/compiler/nir') diff --git a/src/compiler/nir/nir_intrinsics.h b/src/compiler/nir/nir_intrinsics.h index 4cb04373e0..b27a148c95 100644 --- a/src/compiler/nir/nir_intrinsics.h +++ b/src/compiler/nir/nir_intrinsics.h @@ -310,6 +310,15 @@ 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(alpha_ref_float, 1, 0, xx, xx, xx) + +/* Blend constant color values. Float values are clamped. */ +SYSTEM_VALUE(blend_const_color_r_float, 1, 0, xx, xx, xx) +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) /** * Barycentric coordinate intrinsics. -- cgit v1.2.3