mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-27 14:50:10 +01:00
nir/lower_flatshade: break out location checking
no functional changes Acked-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28463>
This commit is contained in:
parent
56d7dad19c
commit
712bf98dd8
1 changed files with 10 additions and 4 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue