intel/fs: use stack for temporary array

"regs" is an array of 2 ->
  "m" must be <= 2 ->
  "components" array can be allocated on the stack

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11575>
This commit is contained in:
Marcin Ślusarz
2021-05-06 14:24:03 +02:00
committed by Marge Bot
parent 5c66fb7e6e
commit 2cf189cc88

View File

@@ -596,14 +596,14 @@ namespace brw {
const fs_reg tmp = bld.vgrf(type); const fs_reg tmp = bld.vgrf(type);
const brw::fs_builder hbld = bld.exec_all().group(16, 0); const brw::fs_builder hbld = bld.exec_all().group(16, 0);
const unsigned m = bld.dispatch_width() / hbld.dispatch_width(); const unsigned m = bld.dispatch_width() / hbld.dispatch_width();
fs_reg *const components = new fs_reg[m]; fs_reg components[2];
assert(m <= 2);
for (unsigned g = 0; g < m; g++) for (unsigned g = 0; g < m; g++)
components[g] = retype(brw_vec8_grf(regs[g], 0), type); components[g] = retype(brw_vec8_grf(regs[g], 0), type);
hbld.LOAD_PAYLOAD(tmp, components, m, 0); hbld.LOAD_PAYLOAD(tmp, components, m, 0);
delete[] components;
return tmp; return tmp;
} else { } else {