From 5cfdb2d0c8aba7f7bc07a3c1f3ffec3e66cc20cb Mon Sep 17 00:00:00 2001 From: NeoBrainX Date: Fri, 18 Jun 2010 23:33:07 +0000 Subject: 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 --- Source/Plugins/Plugin_VideoDX11/Src/TextureCache.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'Source/Plugins/Plugin_VideoDX11/Src/TextureCache.cpp') diff --git a/Source/Plugins/Plugin_VideoDX11/Src/TextureCache.cpp b/Source/Plugins/Plugin_VideoDX11/Src/TextureCache.cpp index d0848a4c57..6db655a6d1 100644 --- a/Source/Plugins/Plugin_VideoDX11/Src/TextureCache.cpp +++ b/Source/Plugins/Plugin_VideoDX11/Src/TextureCache.cpp @@ -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(); } -- cgit v1.2.3