panvk: implement sparseResidencyImage3D
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38986>
This commit is contained in:
Caterina Shablia 2026-01-26 22:29:18 +00:00 committed by Marge Bot
parent a93cf2b991
commit 237e2d7b32
3 changed files with 6 additions and 7 deletions

View file

@ -364,10 +364,6 @@ panvk_bind_queue_submit_sparse_block_memory_bind(
uint64_t resource_va = image->sparse.device_address;
const struct panvk_image_plane *plane = &image->planes[in->plane_index];
/* 3D images are not yet supported. See
* https://gitlab.freedesktop.org/panfrost/mesa/-/issues/242 */
assert(image->vk.image_type == VK_IMAGE_TYPE_2D);
/* Previously, sparse residency was implemented using block U-interleaved
* (https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37483).
* Interleaved 64k offers better map and unmap performance (at most one bind
@ -396,6 +392,8 @@ panvk_bind_queue_submit_sparse_block_memory_bind(
in->extent.depth == 1);
uint32_t tile_size_B = 65536;
assert(image->vk.image_type != VK_IMAGE_TYPE_3D || in->layer == 0);
const struct pan_image_slice_layout *slayout = &plane->plane.layout.slices[in->level];
VkSparseMemoryBind bind = {
.resourceOffset =

View file

@ -1023,7 +1023,8 @@ panvk_get_sparse_block_desc(VkImageType type, VkFormat format)
uint32_t texel_block_size_B = fmt_desc->block.bits / 8;
switch (type) {
case VK_IMAGE_TYPE_2D: {
case VK_IMAGE_TYPE_2D:
case VK_IMAGE_TYPE_3D: {
if (!util_is_power_of_two_nonzero(texel_block_size_B))
break;
@ -1041,7 +1042,7 @@ panvk_get_sparse_block_desc(VkImageType type, VkFormat format)
return (struct panvk_sparse_block_desc){
.extent = extent,
.size_B = STANDARD_SPARSE_BLOCK_SIZE_B,
.standard = true,
.standard = type == VK_IMAGE_TYPE_2D,
};
}

View file

@ -305,7 +305,7 @@ panvk_per_arch(get_physical_device_features)(
.sparseBinding = has_sparse,
.sparseResidencyBuffer = has_sparse,
.sparseResidencyImage2D = has_sparse,
.sparseResidencyImage3D = false, /* https://gitlab.freedesktop.org/panfrost/mesa/-/issues/242 */
.sparseResidencyImage3D = has_sparse,
.sparseResidency2Samples = false,
.sparseResidency4Samples = false,
.sparseResidency8Samples = false,