intel/brw: allocate large table in the heap instead of the stack
When having a large number of virtual register this table can be too large to be allocated on the stack. Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30008>
This commit is contained in:
@@ -34,7 +34,7 @@ brw_fs_opt_split_virtual_grfs(fs_visitor &s)
|
||||
|
||||
/* Count the total number of registers */
|
||||
unsigned reg_count = 0;
|
||||
unsigned vgrf_to_reg[num_vars];
|
||||
unsigned *vgrf_to_reg = new unsigned[num_vars];
|
||||
for (unsigned i = 0; i < num_vars; i++) {
|
||||
vgrf_to_reg[i] = reg_count;
|
||||
reg_count += s.alloc.sizes[i];
|
||||
@@ -203,6 +203,7 @@ cleanup:
|
||||
delete[] vgrf_has_split;
|
||||
delete[] new_virtual_grf;
|
||||
delete[] new_reg_offset;
|
||||
delete[] vgrf_to_reg;
|
||||
|
||||
return progress;
|
||||
}
|
||||
|
Reference in New Issue
Block a user