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 <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>
This commit is contained in:
parent
73812999d9
commit
3c03718fd7
|
@ -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 */
|
||||
|
|
Loading…
Reference in New Issue