}
-
+/**
+ * Evaluate a constant-valued coefficient at the position of the
+ * current quad.
+ */
static void
-constant_interpolation(
+eval_constant_coef(
struct tgsi_exec_machine *mach,
unsigned attrib,
unsigned chan )
}
}
+/**
+ * Evaluate a linear-valued coefficient at the position of the
+ * current quad.
+ */
static void
-linear_interpolation(
+eval_linear_coef(
struct tgsi_exec_machine *mach,
unsigned attrib,
unsigned chan )
mach->Inputs[attrib].xyzw[chan].f[3] = a0 + dadx + dady;
}
+/**
+ * Evaluate a perspective-valued coefficient at the position of the
+ * current quad.
+ */
static void
-perspective_interpolation(
+eval_perspective_coef(
struct tgsi_exec_machine *mach,
unsigned attrib,
unsigned chan )
}
-typedef void (* interpolation_func)(
+typedef void (* eval_coef_func)(
struct tgsi_exec_machine *mach,
unsigned attrib,
unsigned chan );
if( mach->Processor == TGSI_PROCESSOR_FRAGMENT ) {
if( decl->Declaration.File == TGSI_FILE_INPUT ) {
unsigned first, last, mask;
- interpolation_func interp;
+ eval_coef_func eval;
assert( decl->Declaration.Declare == TGSI_DECLARE_RANGE );
switch( decl->Interpolation.Interpolate ) {
case TGSI_INTERPOLATE_CONSTANT:
- interp = constant_interpolation;
+ eval = eval_constant_coef;
break;
case TGSI_INTERPOLATE_LINEAR:
- interp = linear_interpolation;
+ eval = eval_linear_coef;
break;
case TGSI_INTERPOLATE_PERSPECTIVE:
- interp = perspective_interpolation;
+ eval = eval_perspective_coef;
break;
default:
for( i = first; i <= last; i++ ) {
for( j = 0; j < NUM_CHANNELS; j++ ) {
- interp( mach, i, j );
+ eval( mach, i, j );
}
}
}
for( j = 0; j < NUM_CHANNELS; j++ ) {
if( mask & (1 << j) ) {
for( i = first; i <= last; i++ ) {
- interp( mach, i, j );
+ eval( mach, i, j );
}
}
}