From 327e37aad53b2b0c3d2c7dd716ea51a927bb9c98 Mon Sep 17 00:00:00 2001 From: Timothy Arceri Date: Tue, 30 Jul 2024 10:12:51 +1000 Subject: [PATCH] nir: set disallow_undef_to_nan for legacy ARB asm programs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Marek Olšák Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/11389 Fixes: 861d274453c0 ("nir: replace undef only used by ALU opcodes with 0 or NaN") Part-of: (cherry picked from commit 298633e3655656d201a0eee7433cb9b6e7687702) --- .pick_status.json | 2 +- src/compiler/nir/nir_opt_undef.c | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.pick_status.json b/.pick_status.json index a7b55ca91d0..30cfe61e5bc 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -6584,7 +6584,7 @@ "description": "nir: set disallow_undef_to_nan for legacy ARB asm programs", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "861d274453c016e04da0997ee75d1c4ab26e95f0", "notes": null diff --git a/src/compiler/nir/nir_opt_undef.c b/src/compiler/nir/nir_opt_undef.c index 880e67fc926..f71830f38f5 100644 --- a/src/compiler/nir/nir_opt_undef.c +++ b/src/compiler/nir/nir_opt_undef.c @@ -319,6 +319,9 @@ nir_opt_undef(nir_shader *shader) } } + if (shader->info.use_legacy_math_rules) + options.disallow_undef_to_nan = true; + return nir_shader_instructions_pass(shader, nir_opt_undef_instr, nir_metadata_block_index |