From 712bf98dd84fd7ff928314d0668304d16f741a09 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Mon, 18 Mar 2024 12:54:20 -0400 Subject: [PATCH] nir/lower_flatshade: break out location checking MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit no functional changes Acked-by: Marek Olšák Part-of: --- src/compiler/nir/nir_lower_flatshade.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/compiler/nir/nir_lower_flatshade.c b/src/compiler/nir/nir_lower_flatshade.c index 0e583bdb8d6..9e40e8ee27b 100644 --- a/src/compiler/nir/nir_lower_flatshade.c +++ b/src/compiler/nir/nir_lower_flatshade.c @@ -24,14 +24,20 @@ #include "nir.h" #include "nir_builder.h" +static bool +check_location(int location) +{ + return location == VARYING_SLOT_COL0 || + location == VARYING_SLOT_COL1 || + location == VARYING_SLOT_BFC0 || + location == VARYING_SLOT_BFC1; +} + static bool lower_input(nir_shader *shader, nir_variable *var) { if (var->data.interpolation == INTERP_MODE_NONE && - (var->data.location == VARYING_SLOT_COL0 || - var->data.location == VARYING_SLOT_COL1 || - var->data.location == VARYING_SLOT_BFC0 || - var->data.location == VARYING_SLOT_BFC1)) + check_location(var->data.location)) var->data.interpolation = INTERP_MODE_FLAT; return true; }