1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-03-13 19:29:14 +01:00

[d3d9] Set scissor to the viewport if that's smaller

Fixes #1608
This commit is contained in:
Robin Kertels 2020-05-13 13:10:29 +02:00 committed by Joshie
parent 6643c75f37
commit 724d0fc0b2

View File

@ -5064,11 +5064,15 @@ namespace dxvk {
VkOffset2D srPosA;
srPosA.x = std::max<int32_t>(0, sr.left);
srPosA.x = std::max<int32_t>(vp.X, srPosA.x);
srPosA.y = std::max<int32_t>(0, sr.top);
srPosA.y = std::max<int32_t>(vp.Y, srPosA.y);
VkOffset2D srPosB;
srPosB.x = std::max<int32_t>(srPosA.x, sr.right);
srPosB.x = std::min<int32_t>(vp.X + vp.Width, srPosB.x);
srPosB.y = std::max<int32_t>(srPosA.y, sr.bottom);
srPosB.y = std::min<int32_t>(vp.Y + vp.Height, srPosB.y);
VkExtent2D srSize;
srSize.width = uint32_t(srPosB.x - srPosA.x);