[PATCH] dxgi: Create an oversized Vulkan swapchain if the app requests one.
Conor McCarthy
cmccarthy at codeweavers.com
Fri Sep 27 10:20:56 CDT 2019
Shadow of the Tomb raider creates a fullscreen swapchain that exceeds the
monitor size by 1 pixel in both dimensions. Buffers for the swapchain must
be created with the requested size, and the mismatch between buffers and
swapchain causes pixel-wide lines of uninitialized data along the bottom
and right display edges. Vulkan allows creation of a swapchain that
extends beyond the advertised capabilities, but warns that the results are
platform-dependent. However, doing so eliminates the lines.
Signed-off-by: Conor McCarthy <cmccarthy at codeweavers.com>
---
dlls/dxgi/swapchain.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/dlls/dxgi/swapchain.c b/dlls/dxgi/swapchain.c
index c76ad1d1..68d8ae42 100644
--- a/dlls/dxgi/swapchain.c
+++ b/dlls/dxgi/swapchain.c
@@ -1752,16 +1752,18 @@ static HRESULT d3d12_swapchain_create_vulkan_swapchain(struct d3d12_swapchain *s
width = swapchain->desc.Width;
height = swapchain->desc.Height;
width = max(width, surface_caps.minImageExtent.width);
- width = min(width, surface_caps.maxImageExtent.width);
height = max(height, surface_caps.minImageExtent.height);
- height = min(height, surface_caps.maxImageExtent.height);
if (width != swapchain->desc.Width || height != swapchain->desc.Height)
{
- WARN("Swapchain dimensions %ux%u are not supported (%u-%u x %u-%u).\n",
+ WARN("Swapchain dimensions %ux%u are not supported (min %ux%u).\n",
swapchain->desc.Width, swapchain->desc.Height,
- surface_caps.minImageExtent.width, surface_caps.maxImageExtent.width,
- surface_caps.minImageExtent.height, surface_caps.maxImageExtent.height);
+ surface_caps.minImageExtent.width, surface_caps.minImageExtent.height);
+ }
+ else if (width > surface_caps.maxImageExtent.width || height > surface_caps.maxImageExtent.height)
+ {
+ WARN("Support for swapchain dimensions %ux%u is platform-dependent (max %ux%u).\n", width, height,
+ surface_caps.maxImageExtent.width, surface_caps.maxImageExtent.height);
}
TRACE("Vulkan swapchain extent %ux%u.\n", width, height);
--
2.23.0
More information about the wine-devel
mailing list