Skip to content

Commit

Permalink
layer: Disable EXT_swapchain_maintenance1
Browse files Browse the repository at this point in the history
Can't implement this easily with limiter and switching between X11 and Wayland
  • Loading branch information
misyltoad committed Nov 9, 2023
1 parent 789c032 commit 0540716
Showing 1 changed file with 31 additions and 1 deletion.
32 changes: 31 additions & 1 deletion layer/VkLayer_FROG_gamescope_wsi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 0540716

Please sign in to comment.