i965/fs: fix regs_written in LOAD_PAYLOAD for doubles
authorConnor Abbott <connor.w.abbott@intel.com>
Tue, 11 Aug 2015 21:23:57 +0000 (14:23 -0700)
committerSamuel Iglesias Gonsálvez <siglesias@igalia.com>
Tue, 10 May 2016 09:25:07 +0000 (11:25 +0200)
v2: Account for the stride of the dst (Iago)

Signed-off-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
src/mesa/drivers/dri/i965/brw_fs_builder.h

index 9a3cc3a50c2f26b129fa79356421dc1f8b80af4f..268ecc6f4acb37e7b8f64a68a6637305d94242dd 100644 (file)
@@ -557,8 +557,12 @@ namespace brw {
       {
          instruction *inst = emit(SHADER_OPCODE_LOAD_PAYLOAD, dst, src, sources);
          inst->header_size = header_size;
-         inst->regs_written = header_size +
-                              (sources - header_size) * (dispatch_width() / 8);
+         inst->regs_written = header_size;
+         for (unsigned i = header_size; i < sources; i++) {
+            inst->regs_written +=
+               DIV_ROUND_UP(dispatch_width() * type_sz(src[i].type) *
+                            dst.stride, REG_SIZE);
+         }
 
          return inst;
       }