diff options
author | Marek Olšák <[email protected]> | 2020-03-13 17:54:35 -0400 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2020-03-19 01:47:28 -0400 |
commit | 3c03718fd7813b9023c286101d4f972aa3390de9 (patch) | |
tree | 284ee1e9fcd9b16b03eb0eb8615199606eec5957 /src/compiler | |
parent | 73812999d92ed9812993f22a8807895d670fa4b8 (diff) |
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 <[email protected]>
Reviewed-by: Tapani Pälli <[email protected]>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4194>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4194>
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/nir/nir_lower_clip_cull_distance_arrays.c | 11 |
1 files changed, 10 insertions, 1 deletions
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 */ |