i965/vec4/tes: consider register offsets during attribute setup
authorIago Toral Quiroga <itoral@igalia.com>
Thu, 15 Sep 2016 08:49:40 +0000 (10:49 +0200)
committerSamuel Iglesias Gonsálvez <siglesias@igalia.com>
Tue, 3 Jan 2017 10:26:51 +0000 (11:26 +0100)
Reviewed-by: Matt Turner <mattst88@gmail.com>
src/mesa/drivers/dri/i965/brw_vec4_tes.cpp

index bb81ad3a1559d4789b841b79e888333deebf4e04..ae6d99bed8305159342bef2240facbee3fcc83d2 100644 (file)
@@ -84,8 +84,8 @@ vec4_tes_visitor::setup_payload()
 
          bool is_64bit = type_sz(inst->src[i].type) == 8;
 
-         struct brw_reg grf =
-            brw_vec4_grf(reg + inst->src[i].nr / 2, 4 * (inst->src[i].nr % 2));
+         unsigned slot = inst->src[i].nr + inst->src[i].offset / 16;
+         struct brw_reg grf = brw_vec4_grf(reg + slot / 2, 4 * (slot % 2));
          grf = stride(grf, 0, is_64bit ? 2 : 4, 1);
          grf.swizzle = inst->src[i].swizzle;
          grf.type = inst->src[i].type;