anv: use the correct format on Android
authorIván Briano <ivan.briano@intel.com>
Thu, 7 May 2020 20:34:04 +0000 (13:34 -0700)
committerMarge Bot <eric+marge@anholt.net>
Wed, 13 May 2020 23:20:50 +0000 (23:20 +0000)
Per https://android.googlesource.com/platform/frameworks/native/+/master/vulkan/libvulkan/swapchain.cpp#745
the format Android requires is R5G6B5, and we have it backwards here.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4898>

src/intel/vulkan/anv_android.c

index b46a990b32e27bc28d54f92f2a397d5d562e8a3b..8e6d0b65ea1ed84c71f27042b4b0b775be6febba 100644 (file)
@@ -616,7 +616,7 @@ setup_gralloc0_usage(VkFormat format, VkImageUsageFlags imageUsage,
     */
    switch (format) {
       case VK_FORMAT_B8G8R8A8_UNORM:
-      case VK_FORMAT_B5G6R5_UNORM_PACK16:
+      case VK_FORMAT_R5G6B5_UNORM_PACK16:
       case VK_FORMAT_R8G8B8A8_UNORM:
       case VK_FORMAT_R8G8B8A8_SRGB:
          *grallocUsage |= GRALLOC_USAGE_HW_FB |