key->ps_prolog.color_attr_index[i] = color[i];
- if (shader->key.part.ps.prolog.flatshade_colors && interp == TGSI_INTERPOLATE_COLOR)
- interp = TGSI_INTERPOLATE_CONSTANT;
+ if (shader->key.part.ps.prolog.flatshade_colors && interp == INTERP_MODE_COLOR)
+ interp = INTERP_MODE_FLAT;
switch (interp) {
- case TGSI_INTERPOLATE_CONSTANT:
+ case INTERP_MODE_FLAT:
key->ps_prolog.color_interp_vgpr_index[i] = -1;
break;
- case TGSI_INTERPOLATE_PERSPECTIVE:
- case TGSI_INTERPOLATE_COLOR:
+ case INTERP_MODE_SMOOTH:
+ case INTERP_MODE_COLOR:
/* Force the interpolation location for colors here. */
if (shader->key.part.ps.prolog.force_persp_sample_interp)
location = TGSI_INTERPOLATE_LOC_SAMPLE;
assert(0);
}
break;
- case TGSI_INTERPOLATE_LINEAR:
+ case INTERP_MODE_NOPERSPECTIVE:
/* Force the interpolation location for colors here. */
if (shader->key.part.ps.prolog.force_linear_sample_interp)
location = TGSI_INTERPOLATE_LOC_SAMPLE;
static void scan_io_usage(struct si_shader_info *info, nir_intrinsic_instr *intr,
bool is_input)
{
- unsigned interp = TGSI_INTERPOLATE_CONSTANT; /* load_input uses flat shading */
+ unsigned interp = INTERP_MODE_FLAT; /* load_input uses flat shading */
if (intr->intrinsic == nir_intrinsic_load_interpolated_input) {
nir_intrinsic_instr *baryc = nir_instr_as_intrinsic(intr->src[0].ssa->parent_instr);
if (baryc) {
if (nir_intrinsic_infos[baryc->intrinsic].index_map[NIR_INTRINSIC_INTERP_MODE] > 0)
- interp = tgsi_get_interp_mode(nir_intrinsic_interp_mode(baryc), false);
+ interp = nir_intrinsic_interp_mode(baryc);
else
unreachable("unknown barycentric intrinsic");
} else {
}
}
- info->color_interpolate[0] = tgsi_get_interp_mode(nir->info.fs.color0_interp, true);
- info->color_interpolate[1] = tgsi_get_interp_mode(nir->info.fs.color1_interp, true);
+ info->color_interpolate[0] = nir->info.fs.color0_interp;
+ info->color_interpolate[1] = nir->info.fs.color1_interp;
+ for (unsigned i = 0; i < 2; i++) {
+ if (info->color_interpolate[i] == INTERP_MODE_NONE)
+ info->color_interpolate[i] = INTERP_MODE_COLOR;
+ }
+
info->color_interpolate_loc[0] = nir->info.fs.color0_sample ? TGSI_INTERPOLATE_LOC_SAMPLE :
nir->info.fs.color0_centroid ? TGSI_INTERPOLATE_LOC_CENTROID :
TGSI_INTERPOLATE_LOC_CENTER;
}
static unsigned si_get_ps_input_cntl(struct si_context *sctx, struct si_shader *vs, unsigned name,
- unsigned index, unsigned interpolate)
+ unsigned index, enum glsl_interp_mode interpolate)
{
struct si_shader_info *vsinfo = &vs->selector->info;
unsigned j, offset, ps_input_cntl = 0;
- if (interpolate == TGSI_INTERPOLATE_CONSTANT ||
- (interpolate == TGSI_INTERPOLATE_COLOR && sctx->flatshade) || name == TGSI_SEMANTIC_PRIMID)
+ if (interpolate == INTERP_MODE_FLAT ||
+ (interpolate == INTERP_MODE_COLOR && sctx->flatshade) || name == TGSI_SEMANTIC_PRIMID)
ps_input_cntl |= S_028644_FLAT_SHADE(1);
if (name == TGSI_SEMANTIC_PCOORD ||