Permalink
Browse files

[WIN32] fixed: dirty region rendering on intel iGPU (HD3000 at least).

Keep scissors rect within the rendertarget dimensions.
  • Loading branch information...
1 parent 4d9866c commit 275c12a07e03afcb324a1de5471d8d68c6261d98 @chadoe chadoe committed Jun 18, 2011
Showing with 4 additions and 4 deletions.
  1. +4 −4 xbmc/rendering/dx/RenderSystemDX.cpp
@@ -921,10 +921,10 @@ void CRenderSystemDX::SetScissors(const CRect& rect)
return;
RECT scissor;
- scissor.left = MathUtils::round_int(rect.x1);
- scissor.top = MathUtils::round_int(rect.y1);
- scissor.right = MathUtils::round_int(rect.x2);
- scissor.bottom = MathUtils::round_int(rect.y2);
+ scissor.left = std::max(0, MathUtils::round_int(rect.x1));
+ scissor.top = std::max(0, MathUtils::round_int(rect.y1));
+ scissor.right = std::min(static_cast<int>(m_nBackBufferWidth), MathUtils::round_int(rect.x2));
+ scissor.bottom = std::min(static_cast<int>(m_nBackBufferHeight), MathUtils::round_int(rect.y2));
m_pD3DDevice->SetRenderState(D3DRS_SCISSORTESTENABLE, TRUE);
m_pD3DDevice->SetScissorRect(&scissor);
}

0 comments on commit 275c12a

Please sign in to comment.