mirror of
https://gitlab.freedesktop.org/mesa/vulkan-wsi-layer.git
synced 2026-05-05 16:58:06 +02:00
Document the VK_PRESENT_MODE_FIFO_LATEST_READY_EXT support for Headless and Wayland
1. Remove the guards. 2. Update the README.md file Signed-off-by: Nir Ekhauz <nir.ekhauz@arm.com> Change-Id: Iccf31b407c5cef4ebf2577f48cc378c6438ccf68
This commit is contained in:
parent
1ef16210ea
commit
0545f795de
9 changed files with 16 additions and 53 deletions
|
|
@ -28,7 +28,8 @@ implements the following extensions:
|
|||
* VK_KHR_present_id
|
||||
* VK_KHR_present_wait
|
||||
* VK_EXT_swapchain_maintenance1
|
||||
|
||||
* VK_EXT_present_mode_fifo_latest_ready (For Headless and Wayland only)
|
||||
|
||||
## Building
|
||||
|
||||
### Dependencies
|
||||
|
|
|
|||
|
|
@ -364,7 +364,6 @@ VKAPI_ATTR VkResult create_device(VkPhysicalDevice physicalDevice, const VkDevic
|
|||
device_data.set_present_id_feature_enabled(present_id_features->presentId);
|
||||
}
|
||||
|
||||
#if VULKAN_WSI_LAYER_EXPERIMENTAL
|
||||
const auto present_mode_fifo_latest_ready_features =
|
||||
util::find_extension<VkPhysicalDevicePresentModeFifoLatestReadyFeaturesEXT>(
|
||||
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_MODE_FIFO_LATEST_READY_FEATURES_EXT, pCreateInfo->pNext);
|
||||
|
|
@ -373,7 +372,6 @@ VKAPI_ATTR VkResult create_device(VkPhysicalDevice physicalDevice, const VkDevic
|
|||
device_data.set_present_mode_fifo_latest_ready_enabled(
|
||||
present_mode_fifo_latest_ready_features->presentModeFifoLatestReady);
|
||||
}
|
||||
#endif
|
||||
|
||||
auto *physical_device_swapchain_maintenance1_features =
|
||||
util::find_extension<VkPhysicalDeviceSwapchainMaintenance1FeaturesEXT>(
|
||||
|
|
@ -542,6 +540,7 @@ wsi_layer_vkGetPhysicalDeviceFeatures2KHR(VkPhysicalDevice physical_device,
|
|||
present_timing_features->presentAtAbsoluteTime = VK_TRUE;
|
||||
present_timing_features->presentAtRelativeTime = VK_TRUE;
|
||||
}
|
||||
#endif
|
||||
|
||||
auto *present_mode_fifo_latest_ready_features =
|
||||
util::find_extension<VkPhysicalDevicePresentModeFifoLatestReadyFeaturesEXT>(
|
||||
|
|
@ -550,7 +549,6 @@ wsi_layer_vkGetPhysicalDeviceFeatures2KHR(VkPhysicalDevice physical_device,
|
|||
{
|
||||
present_mode_fifo_latest_ready_features->presentModeFifoLatestReady = VK_TRUE;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#define GET_PROC_ADDR(func) \
|
||||
|
|
|
|||
|
|
@ -450,9 +450,9 @@ device_private_data::device_private_data(instance_private_data &inst_data, VkPhy
|
|||
, present_id_enabled { false }
|
||||
, swapchain_maintenance1_enabled{ false }
|
||||
#if VULKAN_WSI_LAYER_EXPERIMENTAL
|
||||
, present_timing_enabled { true }
|
||||
, present_mode_fifo_latest_ready_enabled { false }
|
||||
, present_timing_enabled { true }
|
||||
#endif
|
||||
, present_mode_fifo_latest_ready_enabled { false }
|
||||
/* clang-format on */
|
||||
{
|
||||
}
|
||||
|
|
@ -644,11 +644,9 @@ bool device_private_data::is_present_wait_enabled()
|
|||
return present_wait_enabled;
|
||||
}
|
||||
|
||||
#if VULKAN_WSI_LAYER_EXPERIMENTAL
|
||||
void device_private_data::set_present_mode_fifo_latest_ready_enabled(bool enable)
|
||||
{
|
||||
present_mode_fifo_latest_ready_enabled = enable;
|
||||
}
|
||||
#endif
|
||||
|
||||
} /* namespace layer */
|
||||
|
|
|
|||
|
|
@ -918,14 +918,12 @@ public:
|
|||
*/
|
||||
bool is_present_id_enabled();
|
||||
|
||||
#if VULKAN_WSI_LAYER_EXPERIMENTAL
|
||||
/**
|
||||
* @brief Selectively enable/disable the fifo_latest_ready for this device
|
||||
*
|
||||
* @param enable Value to set fifo_latest_ready_enabled member variable.
|
||||
*/
|
||||
void set_present_mode_fifo_latest_ready_enabled(bool enable);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Selectively enable/disable the swapchain maintenance1 features for this device.
|
||||
|
|
@ -1023,13 +1021,13 @@ private:
|
|||
* @brief Stores whether the device has enabled support for the present timing features.
|
||||
*/
|
||||
bool present_timing_enabled{ false };
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Stores whether the device supports the fifo latest ready present mode.
|
||||
*
|
||||
*/
|
||||
bool present_mode_fifo_latest_ready_enabled{ false };
|
||||
#endif
|
||||
};
|
||||
|
||||
} /* namespace layer */
|
||||
|
|
|
|||
|
|
@ -56,25 +56,17 @@ void surface_properties::populate_present_mode_compatibilities()
|
|||
present_mode_compatibility{
|
||||
VK_PRESENT_MODE_SHARED_DEMAND_REFRESH_KHR, 1, { VK_PRESENT_MODE_SHARED_DEMAND_REFRESH_KHR } },
|
||||
present_mode_compatibility{
|
||||
VK_PRESENT_MODE_SHARED_CONTINUOUS_REFRESH_KHR, 1, { VK_PRESENT_MODE_SHARED_CONTINUOUS_REFRESH_KHR } }
|
||||
#if VULKAN_WSI_LAYER_EXPERIMENTAL
|
||||
,
|
||||
VK_PRESENT_MODE_SHARED_CONTINUOUS_REFRESH_KHR, 1, { VK_PRESENT_MODE_SHARED_CONTINUOUS_REFRESH_KHR } },
|
||||
present_mode_compatibility{ VK_PRESENT_MODE_FIFO_LATEST_READY_EXT, 1, { VK_PRESENT_MODE_FIFO_LATEST_READY_EXT } }
|
||||
#endif
|
||||
};
|
||||
m_compatible_present_modes =
|
||||
compatible_present_modes<compatible_present_modes_list.size()>(compatible_present_modes_list);
|
||||
}
|
||||
|
||||
surface_properties::surface_properties()
|
||||
: m_supported_modes({
|
||||
VK_PRESENT_MODE_FIFO_KHR, VK_PRESENT_MODE_FIFO_RELAXED_KHR, VK_PRESENT_MODE_SHARED_DEMAND_REFRESH_KHR,
|
||||
VK_PRESENT_MODE_SHARED_CONTINUOUS_REFRESH_KHR
|
||||
#if VULKAN_WSI_LAYER_EXPERIMENTAL
|
||||
,
|
||||
VK_PRESENT_MODE_FIFO_LATEST_READY_EXT
|
||||
#endif
|
||||
})
|
||||
: m_supported_modes({ VK_PRESENT_MODE_FIFO_KHR, VK_PRESENT_MODE_FIFO_RELAXED_KHR,
|
||||
VK_PRESENT_MODE_SHARED_DEMAND_REFRESH_KHR, VK_PRESENT_MODE_SHARED_CONTINUOUS_REFRESH_KHR,
|
||||
VK_PRESENT_MODE_FIFO_LATEST_READY_EXT })
|
||||
{
|
||||
populate_present_mode_compatibilities();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,14 +33,7 @@ namespace wsi
|
|||
{
|
||||
namespace headless
|
||||
{
|
||||
#if VULKAN_WSI_LAYER_EXPERIMENTAL
|
||||
/*
|
||||
* Due to VK_PRESENT_MODE_FIFO_LATEST_READY_EXT
|
||||
*/
|
||||
constexpr int PRESENT_MODES_NUM = 5;
|
||||
#else
|
||||
constexpr int PRESENT_MODES_NUM = 4;
|
||||
#endif
|
||||
|
||||
class surface_properties : public wsi::surface_properties
|
||||
{
|
||||
|
|
|
|||
|
|
@ -55,11 +55,8 @@ void surface_properties::populate_present_mode_compatibilities()
|
|||
{
|
||||
std::array compatible_present_modes_list = {
|
||||
present_mode_compatibility{ VK_PRESENT_MODE_FIFO_KHR, 1, { VK_PRESENT_MODE_FIFO_KHR } },
|
||||
present_mode_compatibility{ VK_PRESENT_MODE_MAILBOX_KHR, 1, { VK_PRESENT_MODE_MAILBOX_KHR } }
|
||||
#if VULKAN_WSI_LAYER_EXPERIMENTAL
|
||||
,
|
||||
present_mode_compatibility{ VK_PRESENT_MODE_MAILBOX_KHR, 1, { VK_PRESENT_MODE_MAILBOX_KHR } },
|
||||
present_mode_compatibility{ VK_PRESENT_MODE_FIFO_LATEST_READY_EXT, 1, { VK_PRESENT_MODE_FIFO_LATEST_READY_EXT } }
|
||||
#endif
|
||||
};
|
||||
m_compatible_present_modes =
|
||||
compatible_present_modes<compatible_present_modes_list.size()>(compatible_present_modes_list);
|
||||
|
|
@ -68,13 +65,7 @@ void surface_properties::populate_present_mode_compatibilities()
|
|||
surface_properties::surface_properties(surface *wsi_surface, const util::allocator &allocator)
|
||||
: specific_surface(wsi_surface)
|
||||
, supported_formats(allocator)
|
||||
, m_supported_modes({
|
||||
VK_PRESENT_MODE_FIFO_KHR, VK_PRESENT_MODE_MAILBOX_KHR
|
||||
#if VULKAN_WSI_LAYER_EXPERIMENTAL
|
||||
,
|
||||
VK_PRESENT_MODE_FIFO_LATEST_READY_EXT
|
||||
#endif
|
||||
})
|
||||
, m_supported_modes({ VK_PRESENT_MODE_FIFO_KHR, VK_PRESENT_MODE_MAILBOX_KHR, VK_PRESENT_MODE_FIFO_LATEST_READY_EXT })
|
||||
{
|
||||
populate_present_mode_compatibilities();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,14 +32,8 @@ namespace wsi
|
|||
{
|
||||
namespace wayland
|
||||
{
|
||||
#if VULKAN_WSI_LAYER_EXPERIMENTAL
|
||||
/*
|
||||
* Due to VK_PRESENT_MODE_FIFO_LATEST_READY_EXT
|
||||
*/
|
||||
constexpr int PRESENT_MODES_NUM = 3;
|
||||
#else
|
||||
constexpr int PRESENT_MODES_NUM = 2;
|
||||
#endif
|
||||
|
||||
struct surface_format_properties_hasher
|
||||
{
|
||||
size_t operator()(const VkFormat &format) const
|
||||
|
|
|
|||
|
|
@ -192,11 +192,9 @@ VkResult swapchain::init_platform(VkDevice device, const VkSwapchainCreateInfoKH
|
|||
* been chosen by the application we don't initialize the page flip thread
|
||||
* so the present_image function can be called during vkQueuePresent.
|
||||
*/
|
||||
use_presentation_thread = WAYLAND_FIFO_PRESENTATION_THREAD_ENABLED
|
||||
#if VULKAN_WSI_LAYER_EXPERIMENTAL
|
||||
&& (m_present_mode != VK_PRESENT_MODE_FIFO_LATEST_READY_EXT)
|
||||
#endif
|
||||
&& (m_present_mode != VK_PRESENT_MODE_MAILBOX_KHR);
|
||||
use_presentation_thread = WAYLAND_FIFO_PRESENTATION_THREAD_ENABLED &&
|
||||
(m_present_mode != VK_PRESENT_MODE_FIFO_LATEST_READY_EXT) &&
|
||||
(m_present_mode != VK_PRESENT_MODE_MAILBOX_KHR);
|
||||
|
||||
auto present_wait = get_swapchain_extension<wsi_ext_present_wait_wayland>();
|
||||
if (present_wait)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue