From e4faebcc3e34c2f4efeea2ef0114d5d01e08a3ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tapani=20P=C3=A4lli?= Date: Tue, 12 Sep 2023 13:35:31 +0300 Subject: [PATCH] crocus: avoid issues with undefined clip distance MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: mesa-stable Signed-off-by: Tapani Pälli Reviewed-by: Sagar Ghuge Part-of: (cherry picked from commit c773794943e950cb64b06c86d331298093ed61d3) --- .pick_status.json | 2 +- src/gallium/drivers/crocus/crocus_program.c | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 4019e8afb47..ba62f6cdd2c 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -1274,7 +1274,7 @@ "description": "crocus: avoid issues with undefined clip distance", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null diff --git a/src/gallium/drivers/crocus/crocus_program.c b/src/gallium/drivers/crocus/crocus_program.c index 9db6cbdb085..44e22f3d600 100644 --- a/src/gallium/drivers/crocus/crocus_program.c +++ b/src/gallium/drivers/crocus/crocus_program.c @@ -1175,12 +1175,14 @@ crocus_compile_vs(struct crocus_context *ice, if (key->nr_userclip_plane_consts) { nir_function_impl *impl = nir_shader_get_entrypoint(nir); - nir_lower_clip_vs(nir, (1 << key->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->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); + } } if (key->clamp_pointsize)