protonscr

Steam vulkan layer prevents compression on Intel GPUs

steamclosed overlay
ValveSoftware/steam-for-linux#8899 · opened 2022-11-07 by vsyrjala2 · updated 2022-11-08 · 7 comments · github
Vvsyrjala2 2022-11-07 github

The steam vulkan layer forces VK_IMAGE_USAGE_STORAGE_BIT for swapchain images, which has the unfortunate side effect of preventing Intel GPUs from using compression.

Fortunately one can use DISABLE_VK_LAYER_VALVE_steam_overlay_1=1 avoid this, but would be nice if worked out of the box.

Any chance of removing the forced VK_IMAGE_USAGE_STORAGE_BIT?

PPlagman 2022-11-07 github

Are you seeing applied to all games, or only certain games that can present from compute?

Ddanginsburg 2022-11-07 github

@vsyrjala2 That was actually added at Intel's request :) The problem is if an application presents from the compute queue we need to be able to write to it from a compute shader in order to render the overlay. We don't know ahead of time if an app is going to present from compute, so we conservatively set the bit during vkCreateSwapchainKHR if the app has done vkGetDeviceQueue on a compute queue that supports present. If you can think of another way we could detect this case, we could change it.

Ggfxstrand 2022-11-08 github

How does that check work? Is it only if it creates a compute-only queue or any queue that supports compute? Intel shouldn't be advertising compute-only queues unless you set debug flags. On TGL and later where the hardware theoretically supports compute-only queues (not advertised today), it can also do storage+CCS so it should be ok modulo software bugs.

Ddanginsburg 2022-11-08 github

How does that check work?

If the application has done a vkGetDeviceQueue on a queue that supports VK_QUEUE_COMPUTE_BIT and vkGetPhysicalDeviceSurfaceSupportKHR reports that present is supported for the VkSwapchainCreateInfoKHR->surface on that queue family we enable VK_IMAGE_USAGE_STORAGE_BIT during vkCreateSwapchainKHR. Perhaps instead we could relax it to supports VK_QUEUE_COMPUTE_BIT and does NOT support VK_QUEUE_GRAPHICS_BIT since if it supports graphics we will be able to render to it with non-compute.

Ggfxstrand 2022-11-08 github

Yeah, that would be the thing to do. Most apps are going to grab a universal queue which supports 3D+compute. IDK how many implementations have a 3D queue which doesn't support compute for that matter.

Vvsyrjala 2022-11-08 github

Slight side note: I also tried to hack off STORAGE_BIT from supportedUsageFlags, but that made no difference to the layer's behaviour. Should it perhaps check that stuff and at least complain a bit if the reported caps don't have what it needs?

Ddanginsburg 2022-11-08 github

I've checked in a fix so that the overlay will only do this for a compute queue that does not support graphics (and does support present). Fix will be in the next Steam Beta client update.

Nothing extracted yet.