From 2cf189cc88e809694c33c63c46465c28faf542a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20=C5=9Alusarz?= Date: Thu, 6 May 2021 14:24:03 +0200 Subject: [PATCH] intel/fs: use stack for temporary array MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit "regs" is an array of 2 -> "m" must be <= 2 -> "components" array can be allocated on the stack Signed-off-by: Marcin Ĺšlusarz Reviewed-by: Lionel Landwerlin Part-of: --- src/intel/compiler/brw_fs.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/intel/compiler/brw_fs.h b/src/intel/compiler/brw_fs.h index 22cd2265499..a81a5f58b9a 100644 --- a/src/intel/compiler/brw_fs.h +++ b/src/intel/compiler/brw_fs.h @@ -596,14 +596,14 @@ namespace brw { const fs_reg tmp = bld.vgrf(type); const brw::fs_builder hbld = bld.exec_all().group(16, 0); 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++) components[g] = retype(brw_vec8_grf(regs[g], 0), type); hbld.LOAD_PAYLOAD(tmp, components, m, 0); - delete[] components; return tmp; } else {