panvk: document reason for maxResourceSize-limit

There's no reason to calculate this more closely; the Vulkan spec
explicitly allows for it to be conservative. And there's no other Vulkan
driver in Mesa that currently does anything else.

But, we have another reason to limit to this specific value (which also
happens to be the minimum value allowed by the spec); we'll overflow the
32-bits of slice_stride for resources where the product of width, height
and texel-size is over UINT32_MAX. But with this limit in place, we
avoid this.

This limit will go away in v11, beacuse there's an additional five bits
of slice_stride there. But let's leave that for later.

Anyway, let's document why this is the correct limit, insted of having
the FINISHME-comment.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: John Anthony <john.anthony@arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32265>
This commit is contained in:
Erik Faye-Lund 2024-11-20 21:06:32 +01:00 committed by Marge Bot
parent b81eb99b42
commit 58498ab806

View file

@ -1313,8 +1313,11 @@ get_image_format_properties(struct panvk_physical_device *physical_device,
.maxArrayLayers = maxArraySize,
.sampleCounts = sampleCounts,
/* FINISHME: Accurately calculate
* VkImageFormatProperties::maxResourceSize.
/* We need to limit images to 32-bit range, because the maximum
* slice-stride is 32-bit wide, meaning that if we allocate an image
* with the maximum widht and height, we end up overflowing it.
*
* We get around this by simply limiting the maximum resource size.
*/
.maxResourceSize = UINT32_MAX,
};