summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends/D3D/TextureCache.cpp
diff options
context:
space:
mode:
authorJules Blok <jules.blok@gmail.com>2016-04-24 11:47:32 +0200
committerJules Blok <jules.blok@gmail.com>2016-04-24 11:47:32 +0200
commit8a21b082d63363b12522b6fcbc7249ab578babf0 (patch)
tree0d061be1d87ccabf94f2c0680766912cad83f60f /Source/Core/VideoBackends/D3D/TextureCache.cpp
parent21e56b5ce1c3628e4d9fe1f93d19674e819c40ad (diff)
parent53cf42fb0649fe2e5eea79d56e1f6e2cb9f2269a (diff)
Merge pull request #3745 from stenzek/d3d11-texcache
D3D11: Fix EFB MSAA depth buffer copies, StateManager desyncs in some cases
Diffstat (limited to 'Source/Core/VideoBackends/D3D/TextureCache.cpp')
-rw-r--r--Source/Core/VideoBackends/D3D/TextureCache.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/Source/Core/VideoBackends/D3D/TextureCache.cpp b/Source/Core/VideoBackends/D3D/TextureCache.cpp
index ac8271fbb5..f30d0309ef 100644
--- a/Source/Core/VideoBackends/D3D/TextureCache.cpp
+++ b/Source/Core/VideoBackends/D3D/TextureCache.cpp
@@ -118,6 +118,9 @@ void TextureCache::TCacheEntry::CopyRectangleFromTexture(
float(dstrect.GetWidth()),
float(dstrect.GetHeight()));
+ D3D::stateman->UnsetTexture(texture->GetSRV());
+ D3D::stateman->Apply();
+
D3D::context->OMSetRenderTargets(1, &texture->GetRTV(), nullptr);
D3D::context->RSSetViewports(1, &vp);
D3D::SetLinearCopySampler();
@@ -234,6 +237,7 @@ void TextureCache::TCacheEntry::FromRenderTarget(u8* dst, PEControl::PixelFormat
// Make sure we don't draw with the texture set as both a source and target.
// (This can happen because we don't unbind textures when we free them.)
D3D::stateman->UnsetTexture(texture->GetSRV());
+ D3D::stateman->Apply();
D3D::context->OMSetRenderTargets(1, &texture->GetRTV(), nullptr);
@@ -364,6 +368,7 @@ void TextureCache::ConvertTexture(TCacheEntryBase* entry, TCacheEntryBase* uncon
// Make sure we don't draw with the texture set as both a source and target.
// (This can happen because we don't unbind textures when we free them.)
D3D::stateman->UnsetTexture(static_cast<TCacheEntry*>(entry)->texture->GetSRV());
+ D3D::stateman->Apply();
D3D::context->OMSetRenderTargets(1, &static_cast<TCacheEntry*>(entry)->texture->GetRTV(), nullptr);