From 56e9bba27950206a997d5f2524c5c49c54b5787b Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Mon, 15 Oct 2018 18:35:00 +0200 Subject: [PATCH] [dxgi] Fix scaling when swap image extent mismatches window size In Proton 3.16, the window size is not necessarily equal to the size of the WSI swap chain and DXVK is responsible for doing the scaling, so we should compare to the actual swap image size instead. --- src/dxgi/dxgi_presenter.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/dxgi/dxgi_presenter.cpp b/src/dxgi/dxgi_presenter.cpp index be6f2502..90405709 100644 --- a/src/dxgi/dxgi_presenter.cpp +++ b/src/dxgi/dxgi_presenter.cpp @@ -130,13 +130,6 @@ namespace dxvk { // to enforce the device's frame latency requirement. SyncEvent->wait(); - // Check whether the back buffer size is the same - // as the window size, in which case we should use - // VK_FILTER_NEAREST to avoid blurry output - const bool fitSize = - m_backBuffer->info().extent.width == m_options.preferredBufferSize.width - && m_backBuffer->info().extent.height == m_options.preferredBufferSize.height; - for (uint32_t i = 0; i < SyncInterval || i < 1; i++) { m_context->beginRecording( m_device->createCommandList()); @@ -159,6 +152,10 @@ namespace dxvk { auto swapSemas = m_swapchain->getSemaphorePair(); auto swapImage = m_swapchain->getImageView(swapSemas.acquireSync); + // Use an appropriate texture filter depending on whether + // the back buffer size matches the swap image size + bool fitSize = m_backBuffer->info().extent == swapImage->imageInfo().extent; + m_context->bindShader(VK_SHADER_STAGE_VERTEX_BIT, m_vertShader); m_context->bindShader(VK_SHADER_STAGE_FRAGMENT_BIT, m_fragShader);