mirror of
https://github.com/utmapp/angle.git
synced 2026-12-01 22:13:25 -10:00
D3D11: Consolidate Scissor state application.
BUG=angleproject:2052 Change-Id: Ib6f55be3d71d083a87e845447f174a55413c8a2f Reviewed-on: https://chromium-review.googlesource.com/659398 Reviewed-by: Geoff Lang <[email protected]> Commit-Queue: Jamie Madill <[email protected]>
This commit is contained in:
1 parent
da7185fb74
commit
2cedb58c8d
4 files changed
+21
-15
No files matched your search
@@ -1198,13 +1198,7 @@ gl::Error Blit11::copyTexture(const gl::Context *context,
|
||||
|
||||
if (scissor)
|
||||
{
|
||||
D3D11_RECT scissorRect;
|
||||
scissorRect.left = scissor->x;
|
||||
scissorRect.right = scissor->x + scissor->width;
|
||||
scissorRect.top = scissor->y;
|
||||
scissorRect.bottom = scissor->y + scissor->height;
|
||||
|
||||
deviceContext->RSSetScissorRects(1, &scissorRect);
|
||||
stateManager->setSimpleScissorRect(*scissor);
|
||||
stateManager->setRasterizerState(&mScissorEnabledRasterizerState);
|
||||
}
|
||||
else
|
||||
@@ -1311,13 +1305,7 @@ gl::Error Blit11::copyDepth(const gl::Context *context,
|
||||
|
||||
if (scissor)
|
||||
{
|
||||
D3D11_RECT scissorRect;
|
||||
scissorRect.left = scissor->x;
|
||||
scissorRect.right = scissor->x + scissor->width;
|
||||
scissorRect.top = scissor->y;
|
||||
scissorRect.bottom = scissor->y + scissor->height;
|
||||
|
||||
deviceContext->RSSetScissorRects(1, &scissorRect);
|
||||
stateManager->setSimpleScissorRect(*scissor);
|
||||
stateManager->setRasterizerState(&mScissorEnabledRasterizerState);
|
||||
}
|
||||
else
|
||||
|
||||
@@ -822,7 +822,7 @@ gl::Error Clear11::clearFramebuffer(const gl::Context *context,
|
||||
if (needScissoredClear)
|
||||
{
|
||||
ASSERT(i < scissorRects.size());
|
||||
deviceContext->RSSetScissorRects(1, &scissorRects[i]);
|
||||
stateManager->setScissorRectD3D(scissorRects[i]);
|
||||
}
|
||||
// Draw the fullscreen quad.
|
||||
if (!hasLayeredLayout || isSideBySideFBO)
|
||||
|
||||
@@ -2144,6 +2144,22 @@ void StateManager11::setSimplePixelTextureAndSampler(const d3d11::SharedSRV &srv
|
||||
mInternalDirtyBits.set(DIRTY_BIT_TEXTURE_AND_SAMPLER_STATE);
|
||||
}
|
||||
|
||||
void StateManager11::setSimpleScissorRect(const gl::Rectangle &glRect)
|
||||
{
|
||||
D3D11_RECT scissorRect;
|
||||
scissorRect.left = glRect.x;
|
||||
scissorRect.right = glRect.x + glRect.width;
|
||||
scissorRect.top = glRect.y;
|
||||
scissorRect.bottom = glRect.y + glRect.height;
|
||||
setScissorRectD3D(scissorRect);
|
||||
}
|
||||
|
||||
void StateManager11::setScissorRectD3D(const D3D11_RECT &d3dRect)
|
||||
{
|
||||
mRenderer->getDeviceContext()->RSSetScissorRects(1, &d3dRect);
|
||||
mInternalDirtyBits.set(DIRTY_BIT_SCISSOR_STATE);
|
||||
}
|
||||
|
||||
// For each Direct3D sampler of either the pixel or vertex stage,
|
||||
// looks up the corresponding OpenGL texture image unit and texture type,
|
||||
// and sets the texture and its addressing/filtering state (or NULL when inactive).
|
||||
|
||||
@@ -220,6 +220,8 @@ class StateManager11 final : angle::NonCopyable
|
||||
void setSimpleViewport(int width, int height);
|
||||
void setSimplePixelTextureAndSampler(const d3d11::SharedSRV &srv,
|
||||
const d3d11::SamplerState &samplerState);
|
||||
void setSimpleScissorRect(const gl::Rectangle &glRect);
|
||||
void setScissorRectD3D(const D3D11_RECT &d3dRect);
|
||||
|
||||
// Not handled by an internal dirty bit because of the extra draw parameters.
|
||||
gl::Error applyVertexBuffer(const gl::Context *context,
|
||||
|
||||
Reference in new issue
Block a user