Giovanni Mascellani (@giomasce) commented about libs/vkd3d-shader/tpf.c:
{
{ HLSL_MODIFIER_CENTROID | HLSL_MODIFIER_NOPERSPECTIVE, VKD3DSIM_LINEAR_NOPERSPECTIVE_CENTROID },
{ HLSL_MODIFIER_NOPERSPECTIVE, VKD3DSIM_LINEAR_NOPERSPECTIVE },
{ HLSL_MODIFIER_CENTROID, VKD3DSIM_LINEAR_CENTROID },
};
unsigned int i;
for (i = 0; i < ARRAY_SIZE(modes); ++i)
{
if ((var->storage_modifiers & modes[i].modifiers) == modes[i].modifiers)
{
mode = modes[i].mode;
break;
}
}
}
This looks longer and less readable than what you'd get by simply chaining the three cases with `else if`. I can live with it, though.