mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-28 19:58:53 +00:00
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.
This commit is contained in:
parent
971a95aece
commit
764aee6995
3 changed files with 32 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue