Mesa (master): i965/vec4: Use can_do_writemask in can_reswizzle

Jason Ekstrand jekstrand at kemper.freedesktop.org
Fri Apr 15 21:48:19 UTC 2016


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

Author: Jason Ekstrand <jason.ekstrand at intel.com>
Date:   Tue Apr  5 14:10:04 2016 -0700

i965/vec4: Use can_do_writemask in can_reswizzle

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>

---

 src/mesa/drivers/dri/i965/brw_vec4.cpp | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_vec4.cpp b/src/mesa/drivers/dri/i965/brw_vec4.cpp
index 4d0efa8..87b5ff9 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4.cpp
@@ -965,10 +965,12 @@ vec4_instruction::can_reswizzle(const struct brw_device_info *devinfo,
                                 int swizzle_mask)
 {
    /* Gen6 MATH instructions can not execute in align16 mode, so swizzles
-    * or writemasking are not allowed.
+    * are not allowed.
     */
-   if (devinfo->gen == 6 && is_math() &&
-       (swizzle != BRW_SWIZZLE_XYZW || dst_writemask != WRITEMASK_XYZW))
+   if (devinfo->gen == 6 && is_math() && swizzle != BRW_SWIZZLE_XYZW)
+      return false;
+
+   if (!can_do_writemask(devinfo) && dst_writemask != WRITEMASK_XYZW)
       return false;
 
    /* If this instruction sets anything not referenced by swizzle, then we'd




More information about the mesa-commit mailing list