summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/i965/brw_sf_emit.c
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2009-06-12 16:21:20 -0600
committerBrian Paul <brianp@vmware.com>2009-06-12 16:21:20 -0600
commit18af7c384cf663533f210d95d074c244d4214f29 (patch)
tree19bebbe3ff280eebfd68f7fadeb3aa77b3841a68 /src/mesa/drivers/dri/i965/brw_sf_emit.c
parent05f0d90962147ad61050bbcde42775a3422e68a5 (diff)
i965: interpolate colors with perspective correction by default
...rather than with linear interpolation. Modern hardware should use perspective-corrected interpolation for colors (as for texcoords). glHint(GL_PERSPECTIVE_CORRECTION_HINT, mode) can be used to get linear interpolation if mode = GL_FASTEST.
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_sf_emit.c')
-rw-r--r--src/mesa/drivers/dri/i965/brw_sf_emit.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_sf_emit.c b/src/mesa/drivers/dri/i965/brw_sf_emit.c
index 862835f157..2f63610425 100644
--- a/src/mesa/drivers/dri/i965/brw_sf_emit.c
+++ b/src/mesa/drivers/dri/i965/brw_sf_emit.c
@@ -295,9 +295,6 @@ static void invert_det( struct brw_sf_compile *c)
}
-#define NON_PERPECTIVE_ATTRS (FRAG_BIT_WPOS | \
- FRAG_BIT_COL0 | \
- FRAG_BIT_COL1)
static GLboolean calculate_masks( struct brw_sf_compile *c,
GLuint reg,
@@ -306,9 +303,16 @@ static GLboolean calculate_masks( struct brw_sf_compile *c,
GLushort *pc_linear)
{
GLboolean is_last_attr = (reg == c->nr_setup_regs - 1);
- GLuint persp_mask = c->key.attrs & ~NON_PERPECTIVE_ATTRS;
+ GLuint persp_mask;
GLuint linear_mask;
+ if (c->key.do_flat_shading || c->key.linear_color)
+ persp_mask = c->key.attrs & ~(FRAG_BIT_WPOS |
+ FRAG_BIT_COL0 |
+ FRAG_BIT_COL1);
+ else
+ persp_mask = c->key.attrs & ~(FRAG_BIT_WPOS);
+
if (c->key.do_flat_shading)
linear_mask = c->key.attrs & ~(FRAG_BIT_COL0|FRAG_BIT_COL1);
else