diff --git a/layer/VkLayer_FROG_gamescope_wsi.cpp b/layer/VkLayer_FROG_gamescope_wsi.cpp index 169dfc28e..77636cbc9 100644 --- a/layer/VkLayer_FROG_gamescope_wsi.cpp +++ b/layer/VkLayer_FROG_gamescope_wsi.cpp @@ -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(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: