From 1a242932649d0a644b0dfcecb6dc14b9d1885d6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tapani=20P=C3=A4lli?= Date: Tue, 12 Sep 2023 12:45:47 +0300 Subject: [PATCH] iris: avoid issues with undefined clip distance MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: mesa-stable Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9797 Signed-off-by: Tapani Pälli Reviewed-by: Sagar Ghuge Part-of: (cherry picked from commit d6d73aae4f833d1e5d7c1bef68a8db3915ec666b) --- .pick_status.json | 2 +- src/gallium/drivers/iris/iris_program.c | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index ed3f0f9c82e..ce00e924d48 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -220,7 +220,7 @@ "description": "iris: avoid issues with undefined clip distance", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null }, diff --git a/src/gallium/drivers/iris/iris_program.c b/src/gallium/drivers/iris/iris_program.c index 1d581c88bb2..dc92e700098 100644 --- a/src/gallium/drivers/iris/iris_program.c +++ b/src/gallium/drivers/iris/iris_program.c @@ -1378,12 +1378,14 @@ iris_compile_vs(struct iris_screen *screen, if (key->vue.nr_userclip_plane_consts) { nir_function_impl *impl = nir_shader_get_entrypoint(nir); - nir_lower_clip_vs(nir, (1 << key->vue.nr_userclip_plane_consts) - 1, - true, false, NULL); - nir_lower_io_to_temporaries(nir, impl, true, false); - nir_lower_global_vars_to_local(nir); - nir_lower_vars_to_ssa(nir); - nir_shader_gather_info(nir, impl); + /* Check if variables were found. */ + if (nir_lower_clip_vs(nir, (1 << key->vue.nr_userclip_plane_consts) - 1, + true, false, NULL)) { + nir_lower_io_to_temporaries(nir, impl, true, false); + nir_lower_global_vars_to_local(nir); + nir_lower_vars_to_ssa(nir); + nir_shader_gather_info(nir, impl); + } } prog_data->use_alt_mode = nir->info.use_legacy_math_rules;