From: Marek Olšák Date: Fri, 13 Mar 2020 21:54:35 +0000 (-0400) Subject: nir: fix clip/cull_distance_array_size in nir_lower_clip_cull_distance_arrays X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3c03718fd7813b9023c286101d4f972aa3390de9;p=mesa.git nir: fix clip/cull_distance_array_size in nir_lower_clip_cull_distance_arrays This fixes a GPU hang on radeonsi. It only works if optimizations have already been run. Cc: 19.3 20.0 Reviewed-by: Tapani Pälli Tested-by: Marge Bot Part-of: --- diff --git a/src/compiler/nir/nir_lower_clip_cull_distance_arrays.c b/src/compiler/nir/nir_lower_clip_cull_distance_arrays.c index 70578d6f3fd..7587bb26e09 100644 --- a/src/compiler/nir/nir_lower_clip_cull_distance_arrays.c +++ b/src/compiler/nir/nir_lower_clip_cull_distance_arrays.c @@ -72,8 +72,17 @@ combine_clip_cull(nir_shader *nir, cull = var; } - if (!cull && !clip) + if (!cull && !clip) { + /* If this is run after optimizations and the variables have been + * eliminated, we should update the shader info, because no other + * place does that. + */ + if (store_info) { + nir->info.clip_distance_array_size = 0; + nir->info.cull_distance_array_size = 0; + } return false; + } if (!cull && clip) { /* The GLSL IR lowering pass must have converted these to vectors */