hasvk/android: Use VkFormat for externalFormat
authorChia-I Wu <olvaffe@gmail.com>
Fri, 21 Apr 2023 04:55:18 +0000 (21:55 -0700)
committerMarge Bot <emma+marge@anholt.net>
Thu, 11 May 2023 22:18:02 +0000 (22:18 +0000)
Same as commit 18feb32df0a ("anv/android: Use VkFormat for
externalFormat"), but for hasvk.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22619>

src/intel/vulkan_hasvk/anv_android.c
src/intel/vulkan_hasvk/anv_formats.c

index f8aa155..1648ffb 100644 (file)
@@ -192,9 +192,9 @@ get_ahw_buffer_format_properties2(
    VkAndroidHardwareBufferFormatProperties2ANDROID *p = pProperties;
 
    p->format = vk_format_from_android(desc.format, desc.usage);
+   p->externalFormat = p->format;
 
    const struct anv_format *anv_format = anv_get_format(p->format);
-   p->externalFormat = (uint64_t) (uintptr_t) anv_format;
 
    /* Default to OPTIMAL tiling but set to linear in case
     * of AHARDWAREBUFFER_USAGE_GPU_DATA_BUFFER usage.
index aadede4..8ad85fb 100644 (file)
@@ -1687,7 +1687,7 @@ VkResult anv_CreateSamplerYcbcrConversion(
 
    if (ext_info && ext_info->externalFormat) {
       assert(pCreateInfo->format == VK_FORMAT_UNDEFINED);
-      conversion->format = (struct anv_format *) (uintptr_t) ext_info->externalFormat;
+      conversion->format = anv_get_format(ext_info->externalFormat);
    } else {
       /* The Vulkan 1.1.95 spec says
        *