From 683d3972a6f06fcf7e82507c056feb25dc55f70e Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 24 Mar 2021 14:04:52 -0700 Subject: [PATCH] nir: Update clip_distance_array_size in clip lowering. If we've added the array, then we should update the info. This is the value that gallium drivers setting !PIPE_CAP_CLIP_PLANES have to use in place of rasterizer->clip_planes_enabled. Reviewed-by: Jesse Natalie Part-of: --- src/compiler/nir/nir_lower_clip.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/compiler/nir/nir_lower_clip.c b/src/compiler/nir/nir_lower_clip.c index 3d60e099356..3a3e98d0e8c 100644 --- a/src/compiler/nir/nir_lower_clip.c +++ b/src/compiler/nir/nir_lower_clip.c @@ -75,10 +75,11 @@ create_clipdist_vars(nir_shader *shader, nir_variable **io_vars, bool use_clipdist_array) { if (use_clipdist_array) { + shader->info.clip_distance_array_size = util_last_bit(ucp_enables); io_vars[0] = create_clipdist_var(shader, output, VARYING_SLOT_CLIP_DIST0, - util_last_bit(ucp_enables)); + shader->info.clip_distance_array_size); } else { if (ucp_enables & 0x0f) io_vars[0] =