mirror of
https://github.com/AxioDL/boo.git
synced 2025-12-14 07:36:26 +00:00
Geometrically correct viewport rectangle clamp for D3D
This commit is contained in:
@@ -902,9 +902,10 @@ struct D3D11CommandQueue : IGraphicsCommandQueue
|
||||
}
|
||||
else
|
||||
{
|
||||
int y = tlOrigin ? rect.location[1] : (tex->m_height - rect.size[1] - rect.location[1]);
|
||||
D3D11_BOX box = {UINT(std::max(0, rect.location[0])), UINT(std::max(0, y)), 0,
|
||||
UINT(std::max(0, rect.location[0] + rect.size[0])), UINT(std::max(0, y + rect.size[1])), 1};
|
||||
SWindowRect intersectRect = rect.intersect(SWindowRect(0, 0, tex->m_width, tex->m_height));
|
||||
int y = tlOrigin ? intersectRect.location[1] : (tex->m_height - intersectRect.size[1] - intersectRect.location[1]);
|
||||
D3D11_BOX box = {UINT(intersectRect.location[0]), UINT(y), 0,
|
||||
UINT(intersectRect.location[0] + intersectRect.size[0]), UINT(y + intersectRect.size[1]), 1};
|
||||
m_deferredCtx->CopySubresourceRegion1(tex->m_colorBindTex.Get(), 0, box.left, box.top, 0,
|
||||
tex->m_colorTex.Get(), 0, &box, D3D11_COPY_DISCARD);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user