mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-31 16:20:13 +01:00
zink: lower unaligned memory accesses
Fixes `vload_half` in OpenCL
Fixes: 0288cb0a0c ("zink: lower vec8/16")
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27754>
This commit is contained in:
parent
944ef1771e
commit
2b9c0e3768
1 changed files with 14 additions and 5 deletions
|
|
@ -5321,11 +5321,20 @@ mem_access_size_align_cb(nir_intrinsic_op intrin, uint8_t bytes,
|
|||
|
||||
assert(util_is_power_of_two_nonzero(align));
|
||||
|
||||
return (nir_mem_access_size_align){
|
||||
.num_components = MIN2(bytes / (bit_size / 8), 4),
|
||||
.bit_size = bit_size,
|
||||
.align = bit_size / 8,
|
||||
};
|
||||
/* simply drop the bit_size for unaligned load/stores */
|
||||
if (align < (bit_size / 8)) {
|
||||
return (nir_mem_access_size_align){
|
||||
.num_components = MIN2(bytes / align, 4),
|
||||
.bit_size = align * 8,
|
||||
.align = align,
|
||||
};
|
||||
} else {
|
||||
return (nir_mem_access_size_align){
|
||||
.num_components = MIN2(bytes / (bit_size / 8), 4),
|
||||
.bit_size = bit_size,
|
||||
.align = bit_size / 8,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
static nir_mem_access_size_align
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue