summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends/D3D/D3DState.cpp
diff options
context:
space:
mode:
authorYuriy O'Donnell <yuriyo@gmail.com>2014-12-13 00:32:08 +0100
committerYuriy O'Donnell <yuriyo@gmail.com>2014-12-13 00:32:08 +0100
commit764aee6995d50bf758452d3ced882d2e6b8af94e (patch)
tree3d39123a2b79ea75259b757446ccbb4cdc997b08 /Source/Core/VideoBackends/D3D/D3DState.cpp
parent971a95aecef1c4fc3e5aa8799a296d2734526cfc (diff)
D3D: Fixed D3D validation error during EFB to texture copy
Texture was being bound as a render target while still being set as a shader resource. D3D automatically unbinds the SRV in this case and generates a validation error. The fix is to manually unbind SRV, render into it and then re-bind to old slots.
Diffstat (limited to 'Source/Core/VideoBackends/D3D/D3DState.cpp')
-rw-r--r--Source/Core/VideoBackends/D3D/D3DState.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/Source/Core/VideoBackends/D3D/D3DState.cpp b/Source/Core/VideoBackends/D3D/D3DState.cpp
index 33310c9957..ff4b547e28 100644
--- a/Source/Core/VideoBackends/D3D/D3DState.cpp
+++ b/Source/Core/VideoBackends/D3D/D3DState.cpp
@@ -199,6 +199,22 @@ void StateManager::Apply()
m_dirtyFlags = 0;
}
+u32 StateManager::UnsetTexture(ID3D11ShaderResourceView* srv)
+{
+ u32 mask = 0;
+
+ for (u32 index = 0; index < 8; ++index)
+ {
+ if (m_current.textures[index] == srv)
+ {
+ SetTexture(index, nullptr);
+ mask |= 1 << index;
+ }
+ }
+
+ return mask;
+}
+
} // namespace D3D
ID3D11SamplerState* StateCache::Get(SamplerState state)