i965/vs: Make pre-gen6 math operate in vector mode instead of scalar.
authorEric Anholt <eric@anholt.net>
Tue, 30 Aug 2011 22:59:26 +0000 (15:59 -0700)
committerEric Anholt <eric@anholt.net>
Wed, 7 Sep 2011 01:01:23 +0000 (18:01 -0700)
On the old backend, we used scalar mode because Mesa IR math is
result.xyzw = math(op0.xxxx), which matched up well.  However, in GLSL
IR we do things like result.xy = math(op0.xy), so we want vector mode.
For the common case of result.x = math(op0.x), performance will be the
same (no cost for un-executed channels), though result.xyzw =
math(op0.xxxx) would be worse.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/brw_vec4_emit.cpp

index 4b8b276bb395c85c12ace6ef04fd576715f3ef09..828a9c1f9cb0007f3cefe49ee524ed4315c6c475 100644 (file)
@@ -259,7 +259,7 @@ vec4_visitor::generate_math1_gen4(vec4_instruction *inst,
            BRW_MATH_SATURATE_NONE,
            inst->base_mrf,
            src,
-           BRW_MATH_DATA_SCALAR,
+           BRW_MATH_DATA_VECTOR,
            BRW_MATH_PRECISION_FULL);
 }