From 1effbccc5cc35537c9d58e13632684a327ba2510 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Thu, 11 May 2023 10:42:15 -0400 Subject: [PATCH] vulkan/wsi: add feedback loop usage to swapchain caps if supported this is needed by some apps cc: mesa-stable Reviewed-by: Joshua Ashton Part-of: --- src/vulkan/wsi/wsi_common_display.c | 4 ++++ src/vulkan/wsi/wsi_common_headless.c | 5 +++++ src/vulkan/wsi/wsi_common_wayland.c | 4 ++++ src/vulkan/wsi/wsi_common_win32.cpp | 4 ++++ src/vulkan/wsi/wsi_common_x11.c | 4 ++++ 5 files changed, 21 insertions(+) diff --git a/src/vulkan/wsi/wsi_common_display.c b/src/vulkan/wsi/wsi_common_display.c index 840476b..4a6e719 100644 --- a/src/vulkan/wsi/wsi_common_display.c +++ b/src/vulkan/wsi/wsi_common_display.c @@ -932,6 +932,10 @@ wsi_display_surface_get_capabilities(VkIcdSurfaceBase *surface_base, VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT; + VK_FROM_HANDLE(vk_physical_device, pdevice, wsi_device->pdevice); + if (pdevice->supported_extensions.EXT_attachment_feedback_loop_layout) + caps->supportedUsageFlags |= VK_IMAGE_USAGE_ATTACHMENT_FEEDBACK_LOOP_BIT_EXT; + return VK_SUCCESS; } diff --git a/src/vulkan/wsi/wsi_common_headless.c b/src/vulkan/wsi/wsi_common_headless.c index 0d318d8..dbcc5fd 100644 --- a/src/vulkan/wsi/wsi_common_headless.c +++ b/src/vulkan/wsi/wsi_common_headless.c @@ -31,6 +31,7 @@ #include "vk_util.h" #include "vk_enum_to_str.h" #include "vk_instance.h" +#include "vk_physical_device.h" #include "wsi_common_entrypoints.h" #include "wsi_common_private.h" #include "wsi_common_queue.h" @@ -104,6 +105,10 @@ wsi_headless_surface_get_capabilities(VkIcdSurfaceBase *surface, VK_IMAGE_USAGE_STORAGE_BIT | VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT; + VK_FROM_HANDLE(vk_physical_device, pdevice, wsi_device->pdevice); + if (pdevice->supported_extensions.EXT_attachment_feedback_loop_layout) + caps->supportedUsageFlags |= VK_IMAGE_USAGE_ATTACHMENT_FEEDBACK_LOOP_BIT_EXT; + return VK_SUCCESS; } diff --git a/src/vulkan/wsi/wsi_common_wayland.c b/src/vulkan/wsi/wsi_common_wayland.c index f5aa815..c6f70f4 100644 --- a/src/vulkan/wsi/wsi_common_wayland.c +++ b/src/vulkan/wsi/wsi_common_wayland.c @@ -1090,6 +1090,10 @@ wsi_wl_surface_get_capabilities(VkIcdSurfaceBase *surface, VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT; + VK_FROM_HANDLE(vk_physical_device, pdevice, wsi_device->pdevice); + if (pdevice->supported_extensions.EXT_attachment_feedback_loop_layout) + caps->supportedUsageFlags |= VK_IMAGE_USAGE_ATTACHMENT_FEEDBACK_LOOP_BIT_EXT; + return VK_SUCCESS; } diff --git a/src/vulkan/wsi/wsi_common_win32.cpp b/src/vulkan/wsi/wsi_common_win32.cpp index 329e587..ba418ff 100644 --- a/src/vulkan/wsi/wsi_common_win32.cpp +++ b/src/vulkan/wsi/wsi_common_win32.cpp @@ -217,6 +217,10 @@ wsi_win32_surface_get_capabilities(VkIcdSurfaceBase *surf, VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT; + VK_FROM_HANDLE(vk_physical_device, pdevice, wsi_device->pdevice); + if (pdevice->supported_extensions.EXT_attachment_feedback_loop_layout) + caps->supportedUsageFlags |= VK_IMAGE_USAGE_ATTACHMENT_FEEDBACK_LOOP_BIT_EXT; + return VK_SUCCESS; } diff --git a/src/vulkan/wsi/wsi_common_x11.c b/src/vulkan/wsi/wsi_common_x11.c index 3c0dad2..a423559 100644 --- a/src/vulkan/wsi/wsi_common_x11.c +++ b/src/vulkan/wsi/wsi_common_x11.c @@ -729,6 +729,10 @@ x11_surface_get_capabilities(VkIcdSurfaceBase *icd_surface, VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT; + VK_FROM_HANDLE(vk_physical_device, pdevice, wsi_device->pdevice); + if (pdevice->supported_extensions.EXT_attachment_feedback_loop_layout) + caps->supportedUsageFlags |= VK_IMAGE_USAGE_ATTACHMENT_FEEDBACK_LOOP_BIT_EXT; + return VK_SUCCESS; } -- 2.7.4