This fixes a GPU hang on radeonsi.
It only works if optimizations have already been run.
Cc: 19.3 20.0 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4194>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4194>
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 */