mirror of
https://gitlab.freedesktop.org/mesa/vulkan-wsi-layer.git
synced 2025-12-20 03:20:09 +01:00
Merge 'Update the layer's readme and release notes with VK_KHR_present_wait2 support' into 'main'
See merge request mesa/vulkan-wsi-layer!205
This commit is contained in:
commit
2f7e6e7ff3
13 changed files with 8 additions and 38 deletions
|
|
@ -334,7 +334,7 @@ if (VULKAN_WSI_LAYER_EXPERIMENTAL)
|
|||
target_sources(${PROJECT_NAME} PUBLIC ${PROJECT_SOURCE_DIR}/wsi/extensions/present_timing.cpp)
|
||||
add_definitions("-DVULKAN_WSI_LAYER_EXPERIMENTAL=1")
|
||||
else()
|
||||
list(APPEND JSON_COMMANDS COMMAND sed -Ei '/VK_EXT_present_timing|VK_KHR_present_wait2/d' ${CMAKE_CURRENT_BINARY_DIR}/VkLayer_window_system_integration.json)
|
||||
list(APPEND JSON_COMMANDS COMMAND sed -Ei '/VK_EXT_present_timing/d' ${CMAKE_CURRENT_BINARY_DIR}/VkLayer_window_system_integration.json)
|
||||
add_definitions("-DVULKAN_WSI_LAYER_EXPERIMENTAL=0")
|
||||
endif()
|
||||
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@ implements the following extensions:
|
|||
* VK_EXT_present_mode_fifo_latest_ready (For Headless and Wayland only)
|
||||
* VK_KHR_present_id2
|
||||
* VK_KHR_swapchain_mutable_format (For Headless and Wayland only)
|
||||
* VK_KHR_present_wait2
|
||||
|
||||
## Building
|
||||
|
||||
|
|
|
|||
|
|
@ -397,14 +397,12 @@ VKAPI_ATTR VkResult create_device(VkPhysicalDevice physicalDevice, const VkDevic
|
|||
device_data.set_present_wait_enabled(present_wait_features->presentWait);
|
||||
}
|
||||
|
||||
#if VULKAN_WSI_LAYER_EXPERIMENTAL
|
||||
auto *present_wait2_features = util::find_extension<VkPhysicalDevicePresentWait2FeaturesKHR>(
|
||||
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_WAIT_2_FEATURES_KHR, pCreateInfo->pNext);
|
||||
if (present_wait2_features != nullptr)
|
||||
{
|
||||
device_data.set_present_wait2_enabled(present_wait2_features->presentWait2);
|
||||
}
|
||||
#endif
|
||||
|
||||
return VK_SUCCESS;
|
||||
}
|
||||
|
|
@ -514,14 +512,12 @@ wsi_layer_vkGetPhysicalDeviceFeatures2(VkPhysicalDevice physical_device,
|
|||
|
||||
instance.disp.GetPhysicalDeviceFeatures2KHR(physical_device, pFeatures);
|
||||
|
||||
#if VULKAN_WSI_LAYER_EXPERIMENTAL
|
||||
auto *present_wait2_features = util::find_extension<VkPhysicalDevicePresentWait2FeaturesKHR>(
|
||||
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_WAIT_2_FEATURES_KHR, pFeatures->pNext);
|
||||
if (present_wait2_features != nullptr)
|
||||
{
|
||||
present_wait2_features->presentWait2 = VK_TRUE;
|
||||
}
|
||||
#endif
|
||||
|
||||
auto *image_compression_control_swapchain_features =
|
||||
util::find_extension<VkPhysicalDeviceImageCompressionControlSwapchainFeaturesEXT>(
|
||||
|
|
@ -679,13 +675,12 @@ wsi_layer_vkGetDeviceProcAddr(VkDevice device, const char *funcName) VWL_API_POS
|
|||
{
|
||||
GET_PROC_ADDR(vkWaitForPresentKHR);
|
||||
}
|
||||
#if VULKAN_WSI_LAYER_EXPERIMENTAL
|
||||
|
||||
/* VK_KHR_present_wait2 */
|
||||
if (device_data.is_device_extension_enabled(VK_KHR_PRESENT_WAIT_2_EXTENSION_NAME))
|
||||
{
|
||||
GET_PROC_ADDR(vkWaitForPresent2KHR);
|
||||
}
|
||||
#endif
|
||||
|
||||
return device_data.disp.get_user_enabled_entrypoint(device, funcName);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,7 +56,6 @@ wsi_layer_vkWaitForPresentKHR(VkDevice device, VkSwapchainKHR swapchain, uint64_
|
|||
return ext->wait_for_present_id(present_id, timeout);
|
||||
}
|
||||
|
||||
#if VULKAN_WSI_LAYER_EXPERIMENTAL
|
||||
/**
|
||||
* @brief Implements vkWaitForPresent2KHR Vulkan entrypoint.
|
||||
*/
|
||||
|
|
@ -79,4 +78,3 @@ wsi_layer_vkWaitForPresent2KHR(VkDevice device, VkSwapchainKHR swapchain,
|
|||
|
||||
return ext->wait_for_present_id(pPresentWait2Info->presentId, pPresentWait2Info->timeout);
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -34,8 +34,6 @@ VWL_VKAPI_CALL(VkResult)
|
|||
wsi_layer_vkWaitForPresentKHR(VkDevice device, VkSwapchainKHR swapchain, uint64_t present_id,
|
||||
uint64_t timeout) VWL_API_POST;
|
||||
|
||||
#if VULKAN_WSI_LAYER_EXPERIMENTAL
|
||||
VWL_VKAPI_CALL(VkResult)
|
||||
wsi_layer_vkWaitForPresent2KHR(VkDevice device, VkSwapchainKHR swapchain,
|
||||
const VkPresentWait2InfoKHR *pPresentWait2Info) VWL_API_POST;
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -473,8 +473,8 @@ device_private_data::device_private_data(instance_private_data &inst_data, VkPhy
|
|||
, swapchain_maintenance1_enabled{ false }
|
||||
#if VULKAN_WSI_LAYER_EXPERIMENTAL
|
||||
, present_timing_enabled { true }
|
||||
, present_wait2_enabled { false }
|
||||
#endif
|
||||
, present_wait2_enabled { false }
|
||||
, present_id2_enabled { false }
|
||||
, present_mode_fifo_latest_ready_enabled { false }
|
||||
/* clang-format on */
|
||||
|
|
@ -712,7 +712,6 @@ bool device_private_data::is_present_wait_enabled()
|
|||
return present_wait_enabled;
|
||||
}
|
||||
|
||||
#if VULKAN_WSI_LAYER_EXPERIMENTAL
|
||||
void device_private_data::set_present_wait2_enabled(bool enable)
|
||||
{
|
||||
present_wait2_enabled = enable;
|
||||
|
|
@ -722,7 +721,6 @@ bool device_private_data::is_present_wait2_enabled()
|
|||
{
|
||||
return present_wait2_enabled;
|
||||
}
|
||||
#endif
|
||||
|
||||
void device_private_data::set_present_mode_fifo_latest_ready_enabled(bool enable)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -383,9 +383,7 @@ private:
|
|||
EP(GetSwapchainTimeDomainPropertiesEXT, VK_EXT_PRESENT_TIMING_EXTENSION_NAME, API_VERSION_MAX, false, ) \
|
||||
EP(GetSwapchainTimingPropertiesEXT, VK_EXT_PRESENT_TIMING_EXTENSION_NAME, API_VERSION_MAX, false, ) \
|
||||
EP(SetSwapchainPresentTimingQueueSizeEXT, VK_EXT_PRESENT_TIMING_EXTENSION_NAME, API_VERSION_MAX, false, ) \
|
||||
EP(GetPastPresentationTimingEXT, VK_EXT_PRESENT_TIMING_EXTENSION_NAME, API_VERSION_MAX, false, ) \
|
||||
/* VK_KHR_present_wait2 */ \
|
||||
EP(WaitForPresent2KHR, VK_KHR_PRESENT_WAIT_2_EXTENSION_NAME, API_VERSION_MAX, false, )
|
||||
EP(GetPastPresentationTimingEXT, VK_EXT_PRESENT_TIMING_EXTENSION_NAME, API_VERSION_MAX, false, )
|
||||
#else
|
||||
#define DEVICE_ENTRYPOINTS_LIST_EXPERIMENTAL(EP)
|
||||
#endif
|
||||
|
|
@ -479,6 +477,8 @@ private:
|
|||
EP(GetCalibratedTimestampsKHR, VK_KHR_CALIBRATED_TIMESTAMPS_EXTENSION_NAME, API_VERSION_MAX, false, ) \
|
||||
/* VK_KHR_present_wait */ \
|
||||
EP(WaitForPresentKHR, VK_KHR_PRESENT_WAIT_EXTENSION_NAME, API_VERSION_MAX, false, ) \
|
||||
/* VK_KHR_present_wait2 */ \
|
||||
EP(WaitForPresent2KHR, VK_KHR_PRESENT_WAIT_2_EXTENSION_NAME, API_VERSION_MAX, false, ) \
|
||||
/* Custom entrypoints */ \
|
||||
DEVICE_ENTRYPOINTS_LIST_EXPANSION(EP)
|
||||
|
||||
|
|
@ -981,7 +981,6 @@ public:
|
|||
*/
|
||||
bool is_present_wait_enabled();
|
||||
|
||||
#if VULKAN_WSI_LAYER_EXPERIMENTAL
|
||||
/**
|
||||
* @brief Set whether present wait2 feature is enabled.
|
||||
*
|
||||
|
|
@ -995,7 +994,6 @@ public:
|
|||
* @return true if supported, false otherwise.
|
||||
*/
|
||||
bool is_present_wait2_enabled();
|
||||
#endif
|
||||
|
||||
private:
|
||||
/* Allow util::allocator to access the private constructor */
|
||||
|
|
@ -1065,13 +1063,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 present wait2 feature.
|
||||
*
|
||||
*/
|
||||
bool present_wait2_enabled{ false };
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Stores whether the device supports the present ID2 feature.
|
||||
|
|
|
|||
|
|
@ -106,14 +106,12 @@ VkResult surface_properties::get_surface_capabilities(VkPhysicalDevice physical_
|
|||
present_id2_surface_cap->presentId2Supported = VK_TRUE;
|
||||
}
|
||||
|
||||
#if VULKAN_WSI_LAYER_EXPERIMENTAL
|
||||
auto present_wait2_surface_cap = util::find_extension<VkSurfaceCapabilitiesPresentWait2KHR>(
|
||||
VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_PRESENT_WAIT_2_KHR, pSurfaceCapabilities->pNext);
|
||||
if (present_wait2_surface_cap != nullptr)
|
||||
{
|
||||
present_wait2_surface_cap->presentWait2Supported = VK_TRUE;
|
||||
}
|
||||
#endif
|
||||
|
||||
return VK_SUCCESS;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -103,13 +103,9 @@ VkResult swapchain::add_required_extensions(VkDevice device, const VkSwapchainCr
|
|||
}
|
||||
|
||||
bool present_wait2;
|
||||
#if VULKAN_WSI_LAYER_EXPERIMENTAL
|
||||
constexpr VkSwapchainCreateFlagsKHR present_wait2_mask =
|
||||
(VK_SWAPCHAIN_CREATE_PRESENT_ID_2_BIT_KHR | VK_SWAPCHAIN_CREATE_PRESENT_WAIT_2_BIT_KHR);
|
||||
present_wait2 = (swapchain_create_info->flags & present_wait2_mask) == present_wait2_mask;
|
||||
#else
|
||||
present_wait2 = false;
|
||||
#endif
|
||||
|
||||
if (m_device_data.is_present_wait_enabled() || present_wait2)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -112,14 +112,12 @@ VkResult surface_properties::get_surface_capabilities(VkPhysicalDevice physical_
|
|||
present_id2_surface_cap->presentId2Supported = VK_TRUE;
|
||||
}
|
||||
|
||||
#if VULKAN_WSI_LAYER_EXPERIMENTAL
|
||||
auto present_wait2_surface_cap = util::find_extension<VkSurfaceCapabilitiesPresentWait2KHR>(
|
||||
VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_PRESENT_WAIT_2_KHR, surface_capabilities->pNext);
|
||||
if (present_wait2_surface_cap != nullptr)
|
||||
{
|
||||
present_wait2_surface_cap->presentWait2Supported = VK_TRUE;
|
||||
}
|
||||
#endif
|
||||
|
||||
return VK_SUCCESS;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -110,13 +110,9 @@ VkResult swapchain::add_required_extensions(VkDevice device, const VkSwapchainCr
|
|||
#endif
|
||||
|
||||
bool present_wait2;
|
||||
#if VULKAN_WSI_LAYER_EXPERIMENTAL
|
||||
constexpr VkSwapchainCreateFlagsKHR present_wait2_mask =
|
||||
(VK_SWAPCHAIN_CREATE_PRESENT_ID_2_BIT_KHR | VK_SWAPCHAIN_CREATE_PRESENT_WAIT_2_BIT_KHR);
|
||||
present_wait2 = (swapchain_create_info->flags & present_wait2_mask) == present_wait2_mask;
|
||||
#else
|
||||
present_wait2 = false;
|
||||
#endif
|
||||
|
||||
if (m_device_data.is_present_wait_enabled() || present_wait2)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -126,14 +126,12 @@ VkResult surface_properties::get_surface_capabilities(VkPhysicalDevice physical_
|
|||
present_id2_surface_cap->presentId2Supported = VK_TRUE;
|
||||
}
|
||||
|
||||
#if VULKAN_WSI_LAYER_EXPERIMENTAL
|
||||
auto present_wait2_surface_cap = util::find_extension<VkSurfaceCapabilitiesPresentWait2KHR>(
|
||||
VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_PRESENT_WAIT_2_KHR, pSurfaceCapabilities->pNext);
|
||||
if (present_wait2_surface_cap != nullptr)
|
||||
{
|
||||
present_wait2_surface_cap->presentWait2Supported = VK_TRUE;
|
||||
}
|
||||
#endif
|
||||
|
||||
return VK_SUCCESS;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -115,13 +115,9 @@ VkResult swapchain::add_required_extensions(VkDevice device, const VkSwapchainCr
|
|||
}
|
||||
|
||||
bool present_wait2;
|
||||
#if VULKAN_WSI_LAYER_EXPERIMENTAL
|
||||
constexpr VkSwapchainCreateFlagsKHR present_wait2_mask =
|
||||
(VK_SWAPCHAIN_CREATE_PRESENT_ID_2_BIT_KHR | VK_SWAPCHAIN_CREATE_PRESENT_WAIT_2_BIT_KHR);
|
||||
present_wait2 = (swapchain_create_info->flags & present_wait2_mask) == present_wait2_mask;
|
||||
#else
|
||||
present_wait2 = false;
|
||||
#endif
|
||||
|
||||
if (m_device_data.is_present_wait_enabled() || present_wait2)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue