intel/fs/xe2+: Round up fs_builder::vgrf() size calculation to HW register unit.
authorFrancisco Jerez <currojerez@riseup.net>
Thu, 21 Jul 2022 18:38:03 +0000 (11:38 -0700)
committerJordan Justen <jordan.l.justen@intel.com>
Thu, 21 Sep 2023 00:19:36 +0000 (17:19 -0700)
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25020>

src/intel/compiler/brw_fs_builder.h

index 53265e5..793feb2 100644 (file)
@@ -27,6 +27,7 @@
 
 #include "brw_ir_fs.h"
 #include "brw_shader.h"
+#include "brw_eu.h"
 
 namespace brw {
    /**
@@ -198,12 +199,13 @@ namespace brw {
       dst_reg
       vgrf(enum brw_reg_type type, unsigned n = 1) const
       {
+         const unsigned unit = reg_unit(shader->devinfo);
          assert(dispatch_width() <= 32);
 
          if (n > 0)
             return dst_reg(VGRF, shader->alloc.allocate(
                               DIV_ROUND_UP(n * type_sz(type) * dispatch_width(),
-                                           REG_SIZE)),
+                                           unit * REG_SIZE) * unit),
                            type);
          else
             return retype(null_reg_ud(), type);