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 <alyssa.rosenzweig@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39180>
This commit is contained in:
Georg Lehmann 2026-01-14 14:26:10 +01:00 committed by Marge Bot
parent 050507ab81
commit 7e93aebbec

View file

@ -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;