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.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user