mirror of
https://gitlab.freedesktop.org/mesa/vulkan-wsi-layer.git
synced 2025-12-20 08:00:12 +01:00
Guard swapchain maintenance features with experimental flag
The feature is still experimental so we should guard it with the flag until it's ready to be used. Change-Id: I3f10f730ca916374241fdcdceaf332672788040d Signed-off-by: Dennis Tsiang <dennis.tsiang@arm.com>
This commit is contained in:
parent
b1f9e5811a
commit
7e27d1d762
2 changed files with 7 additions and 0 deletions
|
|
@ -239,6 +239,7 @@ if (VULKAN_WSI_LAYER_EXPERIMENTAL)
|
|||
target_sources(${PROJECT_NAME} PUBLIC ${PROJECT_SOURCE_DIR}/layer/present_timing.cpp)
|
||||
else()
|
||||
list(APPEND JSON_COMMANDS COMMAND sed -i '/VK_EXT_present_timing/d' ${CMAKE_CURRENT_BINARY_DIR}/VkLayer_window_system_integration.json)
|
||||
list(APPEND JSON_COMMANDS COMMAND sed -i '/VK_EXT_swapchain_maintenance1/d' ${CMAKE_CURRENT_BINARY_DIR}/VkLayer_window_system_integration.json)
|
||||
endif()
|
||||
|
||||
target_compile_definitions(${PROJECT_NAME} PRIVATE ${WSI_DEFINES})
|
||||
|
|
|
|||
|
|
@ -319,6 +319,7 @@ VKAPI_ATTR VkResult create_device(VkPhysicalDevice physicalDevice, const VkDevic
|
|||
layer::device_private_data::get(*pDevice).set_present_id_feature_enabled(present_id_features->presentId);
|
||||
}
|
||||
|
||||
#if VULKAN_WSI_LAYER_EXPERIMENTAL
|
||||
auto *physical_device_swapchain_maintenance1_features =
|
||||
util::find_extension<VkPhysicalDeviceSwapchainMaintenance1FeaturesEXT>(
|
||||
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SWAPCHAIN_MAINTENANCE_1_FEATURES_EXT, pCreateInfo->pNext);
|
||||
|
|
@ -327,6 +328,7 @@ VKAPI_ATTR VkResult create_device(VkPhysicalDevice physicalDevice, const VkDevic
|
|||
layer::device_private_data::get(*pDevice).set_swapchain_maintenance1_enabled(
|
||||
physical_device_swapchain_maintenance1_features->swapchainMaintenance1);
|
||||
}
|
||||
#endif
|
||||
|
||||
return VK_SUCCESS;
|
||||
}
|
||||
|
|
@ -440,6 +442,7 @@ wsi_layer_vkGetPhysicalDeviceFeatures2KHR(VkPhysicalDevice physicalDevice,
|
|||
present_id_features->presentId = true;
|
||||
}
|
||||
|
||||
#if VULKAN_WSI_LAYER_EXPERIMENTAL
|
||||
auto *physical_device_swapchain_maintenance1_features =
|
||||
util::find_extension<VkPhysicalDeviceSwapchainMaintenance1FeaturesEXT>(
|
||||
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SWAPCHAIN_MAINTENANCE_1_FEATURES_EXT, pFeatures->pNext);
|
||||
|
|
@ -447,6 +450,7 @@ wsi_layer_vkGetPhysicalDeviceFeatures2KHR(VkPhysicalDevice physicalDevice,
|
|||
{
|
||||
physical_device_swapchain_maintenance1_features->swapchainMaintenance1 = true;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#define GET_PROC_ADDR(func) \
|
||||
|
|
@ -486,12 +490,14 @@ wsi_layer_vkGetDeviceProcAddr(VkDevice device, const char *funcName) VWL_API_POS
|
|||
GET_PROC_ADDR(vkCreateImage);
|
||||
GET_PROC_ADDR(vkBindImageMemory2);
|
||||
|
||||
#if VULKAN_WSI_LAYER_EXPERIMENTAL
|
||||
/* VK_EXT_swapchain_maintenance1 */
|
||||
if (layer::device_private_data::get(device).is_device_extension_enabled(
|
||||
VK_EXT_SWAPCHAIN_MAINTENANCE_1_EXTENSION_NAME))
|
||||
{
|
||||
GET_PROC_ADDR(vkReleaseSwapchainImagesEXT);
|
||||
}
|
||||
#endif
|
||||
|
||||
return layer::device_private_data::get(device).disp.get_user_enabled_entrypoint(
|
||||
device, layer::device_private_data::get(device).instance_data.api_version, funcName);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue