diff options
| author | shuffle2 <godisgovernment@gmail.com> | 2014-12-18 02:59:51 -0800 |
|---|---|---|
| committer | shuffle2 <godisgovernment@gmail.com> | 2014-12-18 02:59:51 -0800 |
| commit | 717e155ce16d7bbfa9c2066f41547d99f7907dda (patch) | |
| tree | e9e9e38793d55446ff14a07c9445cee34e9f05df /Source/Core/VideoBackends/D3D/TextureCache.cpp | |
| parent | 418e006e88306b6f9f3877f946ac5c17dd7e8751 (diff) | |
| parent | 5688c27610f2a6d67b62e8f90f689e3c1d90a953 (diff) | |
Merge pull request #1689 from kayru/d3d_efb_copy_fix
D3D: Fixed D3D validation error during EFB to texture copy
Diffstat (limited to 'Source/Core/VideoBackends/D3D/TextureCache.cpp')
| -rw-r--r-- | Source/Core/VideoBackends/D3D/TextureCache.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Source/Core/VideoBackends/D3D/TextureCache.cpp b/Source/Core/VideoBackends/D3D/TextureCache.cpp index bef632e4fd..b251a30682 100644 --- a/Source/Core/VideoBackends/D3D/TextureCache.cpp +++ b/Source/Core/VideoBackends/D3D/TextureCache.cpp @@ -157,6 +157,10 @@ void TextureCache::TCacheEntry::FromRenderTarget(u32 dstAddr, unsigned int dstFo else D3D::SetPointCopySampler(); + // if texture is currently in use, it needs to be temporarily unset + u32 textureSlotMask = D3D::stateman->UnsetTexture(texture->GetSRV()); + D3D::stateman->Apply(); + D3D::context->OMSetRenderTargets(1, &texture->GetRTV(), nullptr); // Create texture copy @@ -170,6 +174,9 @@ void TextureCache::TCacheEntry::FromRenderTarget(u32 dstAddr, unsigned int dstFo D3D::context->OMSetRenderTargets(1, &FramebufferManager::GetEFBColorTexture()->GetRTV(), FramebufferManager::GetEFBDepthTexture()->GetDSV()); g_renderer->RestoreAPIState(); + + // Restore old texture in all previously used slots, if any + D3D::stateman->SetTextureByMask(textureSlotMask, texture->GetSRV()); } if (!g_ActiveConfig.bCopyEFBToTexture) |
