mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-29 04:08:55 +00:00
Merge pull request #1689 from kayru/d3d_efb_copy_fix
D3D: Fixed D3D validation error during EFB to texture copy
This commit is contained in:
commit
717e155ce1
3 changed files with 38 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue