[Mesa-dev] [PATCH v2] anv: set maxResourceSize to the respective value for each generation

Jason Ekstrand jason at jlekstrand.net
Wed Feb 28 00:14:17 UTC 2018


On Tue, Feb 27, 2018 at 2:43 AM, Samuel Iglesias Gonsálvez <
siglesias at igalia.com> wrote:

> v2:
> - Add the proper values to gen9+ (Jason)
>
> Signed-off-by: Samuel Iglesias Gonsálvez <siglesias at igalia.com>
> ---
>  src/intel/vulkan/anv_formats.c | 14 +++++++++++++-
>  1 file changed, 13 insertions(+), 1 deletion(-)
>
> diff --git a/src/intel/vulkan/anv_formats.c b/src/intel/vulkan/anv_
> formats.c
> index 9c52ad5acbd..cbc3d357922 100644
> --- a/src/intel/vulkan/anv_formats.c
> +++ b/src/intel/vulkan/anv_formats.c
> @@ -842,6 +842,18 @@ anv_get_image_format_properties(
>         */
>     }
>
> +   /* Pre-gen9 has a 2 GB limitation of the size in bytes,
> +    * gen9 and gen10 have a 256 GB limitation and gen11+
> +    * has a 16 TB limitation.
>

Might be worth saying that this comes from the bspec section entitled
"Surface Layout and Tiling".

Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>


> +    */
> +   uint64_t maxResourceSize = 0;
> +   if (devinfo->gen < 9)
> +      maxResourceSize = (uint64_t) 1 << 31;
> +   else if (devinfo->gen < 11)
> +      maxResourceSize = (uint64_t) 1 << 38;
> +   else
> +      maxResourceSize = (uint64_t) 1 << 44;
> +
>     *pImageFormatProperties = (VkImageFormatProperties) {
>        .maxExtent = maxExtent,
>        .maxMipLevels = maxMipLevels,
> @@ -851,7 +863,7 @@ anv_get_image_format_properties(
>        /* FINISHME: Accurately calculate
>         * VkImageFormatProperties::maxResourceSize.
>         */
> -      .maxResourceSize = UINT32_MAX,
> +      .maxResourceSize = maxResourceSize,
>     };
>
>     if (pYcbcrImageFormatProperties) {
> --
> 2.14.1
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20180227/98ca07cb/attachment.html>


More information about the mesa-dev mailing list