intel/compiler: Fix instruction size written calculation
authorSagar Ghuge <sagar.ghuge@intel.com>
Wed, 13 Oct 2021 18:14:43 +0000 (11:14 -0700)
committerSagar Ghuge <sagar.ghuge@intel.com>
Tue, 23 Nov 2021 05:27:30 +0000 (21:27 -0800)
We are always aligning to REG_SIZE but when we have payload sources less
than REG_SIZE, size written is miscalculated.

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11766>

src/intel/compiler/brw_fs_builder.h

index f156cb3..ce340f4 100644 (file)
@@ -771,9 +771,8 @@ namespace brw {
          inst->header_size = header_size;
          inst->size_written = header_size * REG_SIZE;
          for (unsigned i = header_size; i < sources; i++) {
-            inst->size_written +=
-               ALIGN(dispatch_width() * type_sz(src[i].type) * dst.stride,
-                     REG_SIZE);
+            inst->size_written += dispatch_width() * type_sz(src[i].type) *
+                                  dst.stride;
          }
 
          return inst;