mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 02:58:05 +02:00
pan/bi: Rework mem_vectorize_cb
Intstead of focusing on numbers of components and bit sizes, focus on the total number of bytes read. Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com> Reviewed-by: Christoph Pillmayer <christoph.pillmayer@arm.com> Reviewed-by: Lorenzo Rossi <lorenzo.rossi@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40576>
This commit is contained in:
parent
a5801b1a23
commit
c2fc7d49e8
1 changed files with 5 additions and 8 deletions
|
|
@ -5576,18 +5576,15 @@ mem_vectorize_cb(unsigned align_mul, unsigned align_offset, unsigned bit_size,
|
|||
if (hole_size > 0)
|
||||
return false;
|
||||
|
||||
/* Must be aligned to the size of the load */
|
||||
unsigned align = nir_combined_align(align_mul, align_offset);
|
||||
if ((bit_size / 8) > align)
|
||||
return false;
|
||||
|
||||
/* We have a hard limit of at most 4 components */
|
||||
if (num_components > 4)
|
||||
return false;
|
||||
|
||||
if (bit_size > 32)
|
||||
return false;
|
||||
const unsigned bytes = num_components * (bit_size / 8);
|
||||
const unsigned max_bytes = 128u / 8u; /* LOAD.i128 */
|
||||
|
||||
return true;
|
||||
const unsigned combined_align = nir_combined_align(align_mul, align_offset);
|
||||
return bytes <= combined_align && bytes <= max_bytes;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue