diff options
author | Kenneth Graunke <kenneth@whitecape.org> | 2011-02-19 01:05:11 -0800 |
---|---|---|
committer | Ian Romanick <ian.d.romanick@intel.com> | 2011-02-28 16:40:57 -0800 |
commit | ec4822a316d63a45e3084753359b757d96c3917d (patch) | |
tree | bbbdf7f6f0d521c6bf47a87ce6bedc0fb6faf422 | |
parent | f13e45d45df78c7af5bb98b523c7efed382fb81d (diff) |
i965/fs: Avoid register coalescing away gen6 MATH workarounds.
The code that generates MATH instructions attempts to work around
the hardware ignoring source modifiers (abs and negate) by emitting
moves into temporaries. Unfortunately, this pass coalesced those
registers, restoring the original problem. Avoid doing that.
Fixes several OpenGL ES2 conformance failures on Sandybridge.
NOTE: This is a candidate for the 7.10 branch.
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 2c2686b912de19a430aba9f5ea5fa679eabdc5c6)
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_fs.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp index b7425a00593..eaa9ae6ac36 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp @@ -2980,6 +2980,8 @@ fs_visitor::register_coalesce() inst->dst.type != inst->src[0].type) continue; + bool has_source_modifiers = inst->src[0].abs || inst->src[0].negate; + /* Found a move of a GRF to a GRF. Let's see if we can coalesce * them: check for no writes to either one until the exit of the * program. @@ -3012,6 +3014,14 @@ fs_visitor::register_coalesce() break; } } + + /* The gen6 MATH instruction can't handle source modifiers, so avoid + * coalescing those for now. We should do something more specific. + */ + if (intel->gen == 6 && scan_inst->is_math() && has_source_modifiers) { + interfered = true; + break; + } } if (interfered) { continue; |