diff options
author | Ian Romanick <[email protected]> | 2009-08-22 01:35:12 -0700 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2009-08-22 01:35:12 -0700 |
commit | c87ef0870a84af44dac6cf9bd49679822a1c4c24 (patch) | |
tree | 43fbc46ab82427659a13246cf59539574e761718 | |
parent | 54fb71b863c6a4d4cda61c69d842f7ee91d062f9 (diff) |
i965: Implement frag prog DPH like DP4
DPH can output to any component, not just to X. This allows fpalu.c
to run without hitting the assertion in emit_dph.
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_wm_emit.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_wm_emit.c b/src/mesa/drivers/dri/i965/brw_wm_emit.c index b3cf524c63e..5f29ca1cd49 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_emit.c +++ b/src/mesa/drivers/dri/i965/brw_wm_emit.c @@ -588,17 +588,19 @@ static void emit_dph( struct brw_compile *p, const struct brw_reg *arg0, const struct brw_reg *arg1 ) { + const int dst_chan = _mesa_ffs(mask & WRITEMASK_XYZW) - 1; + if (!(mask & WRITEMASK_XYZW)) return; /* Do not emit dead code */ - assert((mask & WRITEMASK_XYZW) == WRITEMASK_X); + assert(is_power_of_two(mask & WRITEMASK_XYZW)); brw_MUL(p, brw_null_reg(), arg0[0], arg1[0]); brw_MAC(p, brw_null_reg(), arg0[1], arg1[1]); - brw_MAC(p, dst[0], arg0[2], arg1[2]); + brw_MAC(p, dst[dst_chan], arg0[2], arg1[2]); brw_set_saturate(p, (mask & SATURATE) ? 1 : 0); - brw_ADD(p, dst[0], dst[0], arg1[3]); + brw_ADD(p, dst[dst_chan], dst[dst_chan], arg1[3]); brw_set_saturate(p, 0); } |