0061-vulkan-wsi-default-to-force_bgra8_unorm_first-true.patch 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. From 1669fb1a9b11036ac939635090a3e7bba849f339 Mon Sep 17 00:00:00 2001
  2. From: brendan King <Brendan.King@imgtec.com>
  3. Date: Mon, 2 Aug 2021 16:29:36 +0100
  4. Subject: [PATCH] vulkan/wsi: default to force_bgra8_unorm_first true
  5. If VULKAN_WSI_BGRA8_SNORM_FIRST is not defined, default to
  6. force_bgra8_unorm_first true.
  7. This brings Mesa WSI into line with IMG WSI with regards to the
  8. VK_FORMAT_B8G8R8A8_UNORM and VK_FORMAT_B8G8R8A8_SRGB formats.
  9. With this change, the IMG Vulkan unit test, vkbonjour, will default
  10. to VK_FORMAT_B8G8R8A8_UNORM rather than VK_FORMAT_B8G8R8A8_SRGB.
  11. ---
  12. src/vulkan/wsi/wsi_common.c | 4 ++++
  13. 1 file changed, 4 insertions(+)
  14. diff --git a/src/vulkan/wsi/wsi_common.c b/src/vulkan/wsi/wsi_common.c
  15. index 66d6683..1ffca6f 100644
  16. --- a/src/vulkan/wsi/wsi_common.c
  17. +++ b/src/vulkan/wsi/wsi_common.c
  18. @@ -158,6 +158,10 @@ wsi_device_init(struct wsi_device *wsi,
  19. driQueryOptionb(dri_options, "vk_wsi_force_bgra8_unorm_first");
  20. }
  21. }
  22. +#if !defined(VULKAN_WSI_BGRA8_SNORM_FIRST)
  23. + else
  24. + wsi->force_bgra8_unorm_first = true;
  25. +#endif
  26. return VK_SUCCESS;
  27. #if defined(VK_USE_PLATFORM_XCB_KHR) || \