mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 02:38:04 +02:00
hk: Make width and height per block in HIC
We were assuming that every formats used for HIC had a block widgh and height of 1x1. This is wrong for compressed formats like BC5, ASTC, ect. Fixes:5bc8284816("hk: add Vulkan driver for Apple GPUs") Signed-off-by: Mary Guillemard <mary@mary.zone> Reviewed-by: Eric Engestrom <eric@igalia.com> (cherry picked from commit887f06a966) Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38167>
This commit is contained in:
parent
040453857b
commit
5e1a88cea0
2 changed files with 15 additions and 1 deletions
|
|
@ -424,7 +424,7 @@
|
|||
"description": "hk: Make width and height per block in HIC",
|
||||
"nominated": true,
|
||||
"nomination_type": 2,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": "5bc828481630147575348b66677edaade9e891e6",
|
||||
"notes": null
|
||||
|
|
|
|||
|
|
@ -1424,6 +1424,13 @@ hk_copy_memory_to_image(struct hk_device *device, struct hk_image *dst_image,
|
|||
uint32_t src_height = info->memoryImageHeight ?: extent.height;
|
||||
|
||||
uint32_t blocksize_B = util_format_get_blocksize(layout->format);
|
||||
|
||||
/* Align width and height to block */
|
||||
src_width =
|
||||
DIV_ROUND_UP(src_width, util_format_get_blockwidth(layout->format));
|
||||
src_height =
|
||||
DIV_ROUND_UP(src_height, util_format_get_blockheight(layout->format));
|
||||
|
||||
uint32_t src_pitch = src_width * blocksize_B;
|
||||
|
||||
unsigned start_layer = (dst_image->vk.image_type == VK_IMAGE_TYPE_3D)
|
||||
|
|
@ -1496,6 +1503,13 @@ hk_copy_image_to_memory(struct hk_device *device, struct hk_image *src_image,
|
|||
#endif
|
||||
|
||||
uint32_t blocksize_B = util_format_get_blocksize(layout->format);
|
||||
|
||||
/* Align width and height to block */
|
||||
dst_width =
|
||||
DIV_ROUND_UP(dst_width, util_format_get_blockwidth(layout->format));
|
||||
dst_height =
|
||||
DIV_ROUND_UP(dst_height, util_format_get_blockheight(layout->format));
|
||||
|
||||
uint32_t dst_pitch = dst_width * blocksize_B;
|
||||
|
||||
unsigned start_layer = (src_image->vk.image_type == VK_IMAGE_TYPE_3D)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue