In fullscreen mode, Shadow of the Tomb Raider uses an unscaled swapchain that is oversized by 1x1 pixel. The pixel-wide lines on the right and bottom should be clipped to fit the display. This eliminates the two lines of uninitialized data.
Signed-off-by: Conor McCarthy cmccarthy@codeweavers.com --- dlls/dxgi/swapchain.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-)
diff --git a/dlls/dxgi/swapchain.c b/dlls/dxgi/swapchain.c index c76ad1d1..2a5ec672 100644 --- a/dlls/dxgi/swapchain.c +++ b/dlls/dxgi/swapchain.c @@ -1432,8 +1432,19 @@ static VkResult d3d12_swapchain_record_swapchain_blit(struct d3d12_swapchain *sw blit.dstOffsets[0].x = 0; blit.dstOffsets[0].y = 0; blit.dstOffsets[0].z = 0; - blit.dstOffsets[1].x = swapchain->vk_swapchain_width; - blit.dstOffsets[1].y = swapchain->vk_swapchain_height; + if (swapchain->desc.Scaling == DXGI_SCALING_NONE) + { + blit.srcOffsets[1].x = min(swapchain->vk_swapchain_width, blit.srcOffsets[1].x); + blit.srcOffsets[1].y = min(swapchain->vk_swapchain_height, blit.srcOffsets[1].y); + blit.dstOffsets[1].x = blit.srcOffsets[1].x; + blit.dstOffsets[1].y = blit.srcOffsets[1].y; + } + else + { + /* FIXME: handle DXGI_SCALING_ASPECT_RATIO_STRETCH. */ + blit.dstOffsets[1].x = swapchain->vk_swapchain_width; + blit.dstOffsets[1].y = swapchain->vk_swapchain_height; + } blit.dstOffsets[1].z = 1;
vk_funcs->p_vkCmdBlitImage(vk_cmd_buffer, @@ -2873,7 +2884,7 @@ static HRESULT d3d12_swapchain_init(struct d3d12_swapchain *swapchain, IWineDXGI
if (swapchain_desc->BufferUsage && swapchain_desc->BufferUsage != DXGI_USAGE_RENDER_TARGET_OUTPUT) FIXME("Ignoring buffer usage %#x.\n", swapchain_desc->BufferUsage); - if (swapchain_desc->Scaling != DXGI_SCALING_STRETCH) + if (swapchain_desc->Scaling != DXGI_SCALING_STRETCH && swapchain_desc->Scaling != DXGI_SCALING_NONE) FIXME("Ignoring scaling %#x.\n", swapchain_desc->Scaling); if (swapchain_desc->AlphaMode && swapchain_desc->AlphaMode != DXGI_ALPHA_MODE_IGNORE) FIXME("Ignoring alpha mode %#x.\n", swapchain_desc->AlphaMode);
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=57919
Your paranoid android.
=== debian10 (32 bit Chinese:China report) ===
dxgi: Unhandled exception: page fault on execute access to 0x45455246 in 32-bit code (0x45455246).
=== debian10 (32 bit WoW report) ===
dxgi: dxgi.c:2122: Test failed: Failed to get output desc, hr 0xb. Unhandled exception: page fault on read access to 0x0000000b in 32-bit code (0x7e8e4301).