Refactored Renderer::setScissor to no longer require render target size.
TRAC #22145
Signed-off-by: Nicolas Capens
Signed-off-by: Daniel Koch
git-svn-id: https://angleproject.googlecode.com/svn/branches/dx11proto@1514 736b8ea6-26fd-11df-bfd4-992fa37f6226
diff --git a/src/libGLESv2/renderer/Renderer11.cpp b/src/libGLESv2/renderer/Renderer11.cpp
index 986d001..1230d49 100644
--- a/src/libGLESv2/renderer/Renderer11.cpp
+++ b/src/libGLESv2/renderer/Renderer11.cpp
@@ -350,25 +350,19 @@
mForceSetDepthStencilState = false;
}
-void Renderer11::setScissorRectangle(const gl::Rectangle& scissor, unsigned int renderTargetWidth,
- unsigned int renderTargetHeight)
+void Renderer11::setScissorRectangle(const gl::Rectangle &scissor)
{
- if (mForceSetScissor ||
- renderTargetWidth != mCurRenderTargetWidth ||
- renderTargetHeight != mCurRenderTargetHeight ||
- memcmp(&scissor, &mCurScissor, sizeof(gl::Rectangle)) != 0)
+ if (mForceSetScissor || memcmp(&scissor, &mCurScissor, sizeof(gl::Rectangle)) != 0)
{
D3D11_RECT rect;
- rect.left = gl::clamp(scissor.x, 0, static_cast<int>(renderTargetWidth));
- rect.top = gl::clamp(scissor.y, 0, static_cast<int>(renderTargetHeight));
- rect.right = gl::clamp(scissor.x + scissor.width, 0, static_cast<int>(renderTargetWidth));
- rect.bottom = gl::clamp(scissor.y + scissor.height, 0, static_cast<int>(renderTargetHeight));
+ rect.left = gl::clamp(scissor.x, 0, static_cast<int>(mRenderTargetDesc.width));
+ rect.top = gl::clamp(scissor.y, 0, static_cast<int>(mRenderTargetDesc.height));
+ rect.right = gl::clamp(scissor.x + scissor.width, 0, static_cast<int>(mRenderTargetDesc.width));
+ rect.bottom = gl::clamp(scissor.y + scissor.height, 0, static_cast<int>(mRenderTargetDesc.height));
mDeviceContext->RSSetScissorRects(1, &rect);
mCurScissor = scissor;
- mCurRenderTargetWidth = renderTargetWidth;
- mCurRenderTargetHeight = renderTargetHeight;
}
mForceSetScissor = false;