mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 05:18:08 +02:00
hk: Allocate the temp tile buffer in copy_image_to_image_cpu
We may require a bigger more than 16KiB to handle the image copy. We now always allocate a buffer to handle it properly fixing the remaining failures on VKCTS 1.4.4.0 for HIC. Fixes:5bc8284816("hk: add Vulkan driver for Apple GPUs") Signed-off-by: Mary Guillemard <mary@mary.zone> (cherry picked from commitd37ba302d0) Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38167>
This commit is contained in:
parent
5e1a88cea0
commit
b3470359bf
2 changed files with 9 additions and 8 deletions
|
|
@ -414,7 +414,7 @@
|
|||
"description": "hk: Allocate the temp tile buffer in copy_image_to_image_cpu",
|
||||
"nominated": true,
|
||||
"nomination_type": 2,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": "5bc828481630147575348b66677edaade9e891e6",
|
||||
"notes": null
|
||||
|
|
|
|||
|
|
@ -1663,11 +1663,6 @@ hk_copy_image_to_image_cpu(struct hk_device *device, struct hk_image *src_image,
|
|||
&device->physical_device->ubwc_config);
|
||||
#endif
|
||||
} else {
|
||||
/* Work tile-by-tile, holding the unswizzled tile in a temporary
|
||||
* buffer.
|
||||
*/
|
||||
char temp_tile[16384];
|
||||
|
||||
unsigned src_level = info->srcSubresource.mipLevel;
|
||||
unsigned dst_level = info->dstSubresource.mipLevel;
|
||||
uint32_t block_width = src_layout->tilesize_el[src_level].width_el;
|
||||
|
|
@ -1681,6 +1676,12 @@ hk_copy_image_to_image_cpu(struct hk_device *device, struct hk_image *src_image,
|
|||
}
|
||||
|
||||
uint32_t temp_pitch = block_width * src_block_B;
|
||||
size_t temp_tile_size = temp_pitch * (src_offset.y + extent.height);
|
||||
|
||||
/* Work tile-by-tile, holding the unswizzled tile in a temporary
|
||||
* buffer.
|
||||
*/
|
||||
char *temp_tile = malloc(temp_tile_size);
|
||||
|
||||
for (unsigned by = src_offset.y / block_height;
|
||||
by * block_height < src_offset.y + extent.height; by++) {
|
||||
|
|
@ -1697,14 +1698,14 @@ hk_copy_image_to_image_cpu(struct hk_device *device, struct hk_image *src_image,
|
|||
MIN2((bx + 1) * block_width, src_offset.x + extent.width) -
|
||||
src_x_start;
|
||||
|
||||
assert(height * temp_pitch <= ARRAY_SIZE(temp_tile));
|
||||
|
||||
ail_detile((void *)src, temp_tile, src_layout, src_level,
|
||||
temp_pitch, src_x_start, src_y_start, width, height);
|
||||
ail_tile(dst, temp_tile, dst_layout, dst_level, temp_pitch,
|
||||
dst_x_start, dst_y_start, width, height);
|
||||
}
|
||||
}
|
||||
|
||||
free(temp_tile);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue