[Mesa-dev] [PATCH 50/95] i965/vec4: Use force_vstride0 to fix DF Z/W writes from X/Y channels

Iago Toral Quiroga itoral at igalia.com
Tue Jul 19 10:40:47 UTC 2016


A source region like <2,2,1>.xyxy:DF selects XXZZ of a dvec4. If we
have code such as:

mov g2.z g4.x

This creates a problem because we end up writing g4.z in g2.z. To fix
this we want to generate a XXXX region and we can do that by exploiting
again the vstride=0 behavior of the hardware in gen7.
---
 src/mesa/drivers/dri/i965/brw_vec4.cpp | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/mesa/drivers/dri/i965/brw_vec4.cpp b/src/mesa/drivers/dri/i965/brw_vec4.cpp
index ea1e530..fd0cafd 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4.cpp
@@ -2211,6 +2211,13 @@ vec4_visitor::expand_64bit_swizzle_to_32bit()
                inst->src[arg].reg_offset += 1;
             }
             swizzle -= 2;
+         } else {
+            if ((inst->dst.writemask & WRITEMASK_ZW) &&
+                (inst->src[arg].swizzle == BRW_SWIZZLE_XXXX ||
+                 inst->src[arg].swizzle == BRW_SWIZZLE_YYYY) &&
+                 inst->src[arg].file == VGRF) {
+               inst->src[arg].force_vstride0 = true;
+            }
          }
          inst->src[arg].swizzle = BRW_SWIZZLE4(swizzle * 2, swizzle * 2 + 1,
                                                swizzle * 2, swizzle * 2 + 1);
-- 
2.7.4



More information about the mesa-dev mailing list