From 7e93aebbec4900a6c1b96e8474cc859d12a3ca30 Mon Sep 17 00:00:00 2001 From: Georg Lehmann Date: Wed, 14 Jan 2026 14:26:10 +0100 Subject: [PATCH] nir/constant_expressions: don't avoid unused source variable warnings The only use case for this was fddx/fddy and they are no longer alu for good reasons. For current and future alu, unused sources don't make sense. And if you really want it, you can still explicitly cast the variable to void. Reviewed-by: Alyssa Rosenzweig Part-of: --- src/compiler/nir/nir_constant_expressions.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/compiler/nir/nir_constant_expressions.py b/src/compiler/nir/nir_constant_expressions.py index de83bce5da8..007a0030f49 100644 --- a/src/compiler/nir/nir_constant_expressions.py +++ b/src/compiler/nir/nir_constant_expressions.py @@ -448,10 +448,7 @@ struct ${type}${width}_vec { % for j in range(op.num_inputs): % if op.input_sizes[j] == 0: <% continue %> - % elif "src" + str(j) not in op.const_expr: - ## Avoid unused variable warnings - <% continue %> - %endif + % endif const struct ${input_types[j]}_vec src${j} = { % for k in range(op.input_sizes[j]): @@ -481,9 +478,6 @@ struct ${type}${width}_vec { % for j in range(op.num_inputs): % if op.input_sizes[j] != 0: <% continue %> - % elif "src" + str(j) not in op.const_expr: - ## Avoid unused variable warnings - <% continue %> % elif input_types[j] == "int1": /* 1-bit integers use a 0/-1 convention */ const int1_t src${j} = -(int1_t)_src[${j}][_i].b;