Mesa (staging/21.3): vulkan/wsi/wayland: Convert missing vulkan formats to shm formats.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Feb 2 21:21:47 UTC 2022


Module: Mesa
Branch: staging/21.3
Commit: a8baf16d1d9075118960a35245386d57359b4533
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=a8baf16d1d9075118960a35245386d57359b4533

Author: Georg Lehmann <dadschoorse at gmail.com>
Date:   Tue Jan 18 00:40:00 2022 +0100

vulkan/wsi/wayland: Convert  missing vulkan formats to shm formats.

Fixes: 6b36f35734a ("vulkan/wsi/wl: add wl_shm support for lavapipe.")

Signed-off-by: Georg Lehmann <dadschoorse at gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Reviewed-by: Simon Ser <contact at emersion.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14588>
(cherry picked from commit a881b6ac1ff70c73090ee076c4011ad84493ae14)

---

 .pick_status.json                   | 2 +-
 src/vulkan/wsi/wsi_common_wayland.c | 6 ++++++
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/.pick_status.json b/.pick_status.json
index f10a5da6ecc..a97c2160d87 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -1309,7 +1309,7 @@
         "description": "vulkan/wsi/wayland: Convert  missing vulkan formats to shm formats.",
         "nominated": true,
         "nomination_type": 1,
-        "resolution": 0,
+        "resolution": 1,
         "main_sha": null,
         "because_sha": "6b36f35734a9ffa2c6fde475933eb46d7f4fb6f4"
     },
diff --git a/src/vulkan/wsi/wsi_common_wayland.c b/src/vulkan/wsi/wsi_common_wayland.c
index eb17270539f..1a3621277b3 100644
--- a/src/vulkan/wsi/wsi_common_wayland.c
+++ b/src/vulkan/wsi/wsi_common_wayland.c
@@ -439,6 +439,12 @@ wl_shm_format_for_vk_format(VkFormat vk_format, bool alpha)
    case VK_FORMAT_B8G8R8A8_UNORM:
    case VK_FORMAT_B8G8R8A8_SRGB:
       return alpha ? WL_SHM_FORMAT_ARGB8888 : WL_SHM_FORMAT_XRGB8888;
+   case VK_FORMAT_R8G8B8_UNORM:
+   case VK_FORMAT_R8G8B8_SRGB:
+      return WL_SHM_FORMAT_XBGR8888;
+   case VK_FORMAT_B8G8R8_UNORM:
+   case VK_FORMAT_B8G8R8_SRGB:
+      return WL_SHM_FORMAT_XRGB8888;
 
    default:
       assert(!"Unsupported Vulkan format");



More information about the mesa-commit mailing list