From 724d0fc0b238620359ad812ab10b1060bfef5d9f Mon Sep 17 00:00:00 2001 From: Robin Kertels Date: Wed, 13 May 2020 13:10:29 +0200 Subject: [PATCH] [d3d9] Set scissor to the viewport if that's smaller Fixes #1608 --- src/d3d9/d3d9_device.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/d3d9/d3d9_device.cpp b/src/d3d9/d3d9_device.cpp index af83ced4..162a1bc8 100644 --- a/src/d3d9/d3d9_device.cpp +++ b/src/d3d9/d3d9_device.cpp @@ -5064,11 +5064,15 @@ namespace dxvk { VkOffset2D srPosA; srPosA.x = std::max(0, sr.left); + srPosA.x = std::max(vp.X, srPosA.x); srPosA.y = std::max(0, sr.top); + srPosA.y = std::max(vp.Y, srPosA.y); VkOffset2D srPosB; srPosB.x = std::max(srPosA.x, sr.right); + srPosB.x = std::min(vp.X + vp.Width, srPosB.x); srPosB.y = std::max(srPosA.y, sr.bottom); + srPosB.y = std::min(vp.Y + vp.Height, srPosB.y); VkExtent2D srSize; srSize.width = uint32_t(srPosB.x - srPosA.x);