diff options
author | Brian Paul <brianp@vmware.com> | 2009-06-12 16:21:20 -0600 |
---|---|---|
committer | Brian Paul <brianp@vmware.com> | 2009-06-12 16:21:20 -0600 |
commit | 18af7c384cf663533f210d95d074c244d4214f29 (patch) | |
tree | 19bebbe3ff280eebfd68f7fadeb3aa77b3841a68 /src/mesa/drivers/dri/i965/brw_wm_fp.c | |
parent | 05f0d90962147ad61050bbcde42775a3422e68a5 (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_wm_fp.c')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_wm_fp.c | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_wm_fp.c b/src/mesa/drivers/dri/i965/brw_wm_fp.c index 1798d842c7..5b302cc309 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_fp.c +++ b/src/mesa/drivers/dri/i965/brw_wm_fp.c @@ -354,13 +354,25 @@ static void emit_interp( struct brw_wm_compile *c, src_undef()); } else { - emit_op(c, - WM_LINTERP, - dst, - 0, - interp, - deltas, - src_undef()); + if (c->key.linear_color) { + emit_op(c, + WM_LINTERP, + dst, + 0, + interp, + deltas, + src_undef()); + } + else { + /* perspective-corrected color interpolation */ + emit_op(c, + WM_PINTERP, + dst, + 0, + interp, + deltas, + get_pixel_w(c)); + } } break; case FRAG_ATTRIB_FOGC: |