summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/llvmpipe/lp_setup_tri.c
diff options
context:
space:
mode:
authorJosé Fonseca <jfonseca@vmware.com>2010-06-01 16:28:45 +0100
committerJosé Fonseca <jfonseca@vmware.com>2010-06-01 16:39:03 +0100
commit149cb7682e37ce719d693f120e68dde60ba73bdf (patch)
tree05c5bdefb18624cf2f3f2f0f9035e7147426bce5 /src/gallium/drivers/llvmpipe/lp_setup_tri.c
parentabe4f3d1aa68aec70d329447abc890b3eaaba9cb (diff)
llvmpipe: Don't waste time interpolating unused input channels.
Diffstat (limited to 'src/gallium/drivers/llvmpipe/lp_setup_tri.c')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_setup_tri.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_setup_tri.c b/src/gallium/drivers/llvmpipe/lp_setup_tri.c
index 0fc4dd665e..b560061542 100644
--- a/src/gallium/drivers/llvmpipe/lp_setup_tri.c
+++ b/src/gallium/drivers/llvmpipe/lp_setup_tri.c
@@ -208,22 +208,26 @@ static void setup_tri_coefficients( struct lp_setup_context *setup,
case LP_INTERP_CONSTANT:
if (setup->flatshade_first) {
for (i = 0; i < NUM_CHANNELS; i++)
- constant_coef(setup, tri, slot+1, v1[vert_attr][i], i);
+ if (setup->fs.input[slot].usage_mask & (1 << i))
+ constant_coef(setup, tri, slot+1, v1[vert_attr][i], i);
}
else {
for (i = 0; i < NUM_CHANNELS; i++)
- constant_coef(setup, tri, slot+1, v3[vert_attr][i], i);
+ if (setup->fs.input[slot].usage_mask & (1 << i))
+ constant_coef(setup, tri, slot+1, v3[vert_attr][i], i);
}
break;
case LP_INTERP_LINEAR:
for (i = 0; i < NUM_CHANNELS; i++)
- linear_coef(setup, tri, oneoverarea, slot+1, v1, v2, v3, vert_attr, i);
+ if (setup->fs.input[slot].usage_mask & (1 << i))
+ linear_coef(setup, tri, oneoverarea, slot+1, v1, v2, v3, vert_attr, i);
break;
case LP_INTERP_PERSPECTIVE:
for (i = 0; i < NUM_CHANNELS; i++)
- perspective_coef(setup, tri, oneoverarea, slot+1, v1, v2, v3, vert_attr, i);
+ if (setup->fs.input[slot].usage_mask & (1 << i))
+ perspective_coef(setup, tri, oneoverarea, slot+1, v1, v2, v3, vert_attr, i);
break;
case LP_INTERP_POSITION: