mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 09:18:04 +02: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> (cherry picked from commit2b9c0e3768)
This commit is contained in:
parent
3794d15e61
commit
2166ee5c2e
2 changed files with 15 additions and 6 deletions
|
|
@ -1154,7 +1154,7 @@
|
|||
"description": "zink: lower unaligned memory accesses",
|
||||
"nominated": true,
|
||||
"nomination_type": 1,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": "0288cb0a0c471fbef07d1dfc1cae843c5396d8e1",
|
||||
"notes": null
|
||||
|
|
|
|||
|
|
@ -5302,11 +5302,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