Mesa (master): i965/vs: Make pre-gen6 math operate in vector mode instead of scalar.

Eric Anholt anholt at kemper.freedesktop.org
Wed Sep 7 01:02:41 UTC 2011


Module: Mesa
Branch: master
Commit: 9f842886077258ddda5d5a32b1f5d9fe2e5818bc
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=9f842886077258ddda5d5a32b1f5d9fe2e5818bc

Author: Eric Anholt <eric at anholt.net>
Date:   Tue Aug 30 15:59:26 2011 -0700

i965/vs: Make pre-gen6 math operate in vector mode instead of scalar.

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 at whitecape.org>

---

 src/mesa/drivers/dri/i965/brw_vec4_emit.cpp |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_vec4_emit.cpp b/src/mesa/drivers/dri/i965/brw_vec4_emit.cpp
index 4b8b276..828a9c1 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_emit.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4_emit.cpp
@@ -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);
 }
 




More information about the mesa-commit mailing list