diff options
author | Eric Anholt <[email protected]> | 2010-09-26 13:28:51 +0800 |
---|---|---|
committer | Zhenyu Wang <[email protected]> | 2010-09-28 15:58:19 +0800 |
commit | a66e9a4d86d227b65874c43fbf9e299c7a26389f (patch) | |
tree | ac41c2d9ab3a4c67470353e270fc66c8a8380871 /src/mesa/drivers/dri/i965/brw_wm_emit.c | |
parent | 79d56577700a4f4b8628b3b61098763d019f17d4 (diff) |
i965: Add support for attribute interpolation on Sandybridge.
Things are simpler these days thanks to barycentric interpolation
parameters being handed in in the payload.
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_wm_emit.c')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_wm_emit.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_wm_emit.c b/src/mesa/drivers/dri/i965/brw_wm_emit.c index a4754ca8cf6..86ec96368c8 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_emit.c +++ b/src/mesa/drivers/dri/i965/brw_wm_emit.c @@ -254,6 +254,8 @@ void emit_pixel_w(struct brw_wm_compile *c, struct brw_compile *p = &c->func; struct intel_context *intel = &p->brw->intel; + assert(intel->gen < 6); + /* Don't need this if all you are doing is interpolating color, for * instance. */ @@ -288,7 +290,6 @@ void emit_pixel_w(struct brw_wm_compile *c, } } - void emit_linterp(struct brw_compile *p, const struct brw_reg *dst, GLuint mask, @@ -307,7 +308,9 @@ void emit_linterp(struct brw_compile *p, for (i = 0; i < 4; i++) { if (mask & (1<<i)) { - if (can_do_pln(intel, deltas)) { + if (intel->gen >= 6) { + brw_PLN(p, dst[i], interp[i], brw_vec8_grf(2, 0)); + } else if (can_do_pln(intel, deltas)) { brw_PLN(p, dst[i], interp[i], deltas[0]); } else { brw_LINE(p, brw_null_reg(), interp[i], deltas[0]); @@ -330,6 +333,11 @@ void emit_pinterp(struct brw_compile *p, GLuint nr = arg0[0].nr; GLuint i; + if (intel->gen >= 6) { + emit_linterp(p, dst, mask, arg0, interp); + return; + } + interp[0] = brw_vec1_grf(nr, 0); interp[1] = brw_vec1_grf(nr, 4); interp[2] = brw_vec1_grf(nr+1, 0); |