Skip to content

Commit

Permalink
[d3d9] Set scissor to the viewport if that's smaller
Browse files Browse the repository at this point in the history
Fixes #1608
  • Loading branch information
K0bin authored and misyltoad committed May 13, 2020
1 parent 6643c75 commit 724d0fc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/d3d9/d3d9_device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 724d0fc

Please sign in to comment.