layer: Disable EXT_swapchain_maintenance1

Can't implement this easily with limiter and switching between X11 and Wayland
This commit is contained in:
Joshua Ashton 2023-11-08 18:46:14 +00:00
parent 789c0324d6
commit 05407167cd

View file

@ -495,6 +495,24 @@ namespace GamescopeWSILayer {
return VK_SUCCESS;
}
static void GetPhysicalDeviceFeatures2(
const vkroots::VkInstanceDispatch* pDispatch,
VkPhysicalDevice physicalDevice,
VkPhysicalDeviceFeatures2* pFeatures) {
pDispatch->GetPhysicalDeviceFeatures2(physicalDevice, pFeatures);
auto pSwapchainMaintenance1Features = vkroots::FindInChainMutable<VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SWAPCHAIN_MAINTENANCE_1_FEATURES_EXT, VkPhysicalDeviceSwapchainMaintenance1FeaturesEXT>(pFeatures);
if (pSwapchainMaintenance1Features)
pSwapchainMaintenance1Features->swapchainMaintenance1 = VK_FALSE;
}
static void GetPhysicalDeviceFeatures2KHR(
const vkroots::VkInstanceDispatch* pDispatch,
VkPhysicalDevice physicalDevice,
VkPhysicalDeviceFeatures2* pFeatures) {
GetPhysicalDeviceFeatures2(pDispatch, physicalDevice, pFeatures);
}
static void DestroySurfaceKHR(
const vkroots::VkInstanceDispatch* pDispatch,
VkInstance instance,
@ -529,13 +547,25 @@ namespace GamescopeWSILayer {
}
}
return vkroots::helpers::append(
VkResult result = vkroots::helpers::append(
pDispatch->EnumerateDeviceExtensionProperties,
s_LayerExposedExts,
pPropertyCount,
pProperties,
physicalDevice,
pLayerName);
// Filter out extensions we don't/can't support in the layer.
if (pProperties) {
for (uint32_t i = 0; i < *pPropertyCount; i++) {
if (pProperties[i].extensionName == "VK_EXT_swapchain_maintenance1"sv) {
strcpy(pProperties[i].extensionName, "DISABLED_EXT_swapchain_maintenance1");
pProperties[i].specVersion = 0;
}
}
}
return result;
}
private: