DX11: Introduce a StateManager class, might improve performance a little.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5740 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
NeoBrainX
2010-06-18 23:33:07 +00:00
parent b4f5a4d89e
commit 5cfdb2d0c8
9 changed files with 54 additions and 334 deletions

View File

@ -561,9 +561,9 @@ void TextureCache::CopyRenderTargetToTexture(u32 address, bool bFromZBuffer, boo
// TODO: Use linear filtering if (bScaleByHalf), else use point filtering
D3D::context->OMSetBlendState(efbcopyblendstate, NULL, 0xffffffff);
D3D::context->RSSetState(efbcopyraststate);
D3D::context->OMSetDepthStencilState(efbcopydepthstate, 0);
D3D::stateman->PushBlendState(efbcopyblendstate);
D3D::stateman->PushRasterizerState(efbcopyraststate);
D3D::stateman->PushDepthState(efbcopydepthstate);
D3D::context->OMSetRenderTargets(1, &tex->GetRTV(), NULL);
D3D::drawShadedTexQuad(
(bFromZBuffer) ? FBManager.GetEFBDepthTexture()->GetSRV() : FBManager.GetEFBColorTexture()->GetSRV(),
@ -573,5 +573,8 @@ void TextureCache::CopyRenderTargetToTexture(u32 address, bool bFromZBuffer, boo
(bFromZBuffer) ? PixelShaderCache::GetDepthMatrixProgram() : PixelShaderCache::GetColorMatrixProgram(), VertexShaderCache::GetSimpleVertexShader(), VertexShaderCache::GetSimpleInputLayout());
D3D::context->OMSetRenderTargets(1, &FBManager.GetEFBColorTexture()->GetRTV(), FBManager.GetEFBDepthTexture()->GetDSV());
D3D::stateman->PopBlendState();
D3D::stateman->PopDepthState();
D3D::stateman->PopRasterizerState();
Renderer::RestoreAPIState();
}