diff options
| author | NeoBrainX <NeoBrainX@googlemail.com> | 2010-10-23 18:44:01 +0000 |
|---|---|---|
| committer | NeoBrainX <NeoBrainX@googlemail.com> | 2010-10-23 18:44:01 +0000 |
| commit | 91186d2b8a714da4ddaa10b85a4d0165b615c4de (patch) | |
| tree | d812584120d69a0cbe57210ca4fb8c1c79528d74 /Source/Plugins | |
| parent | 7410056536e67044b7d0defd7809d8d8b89ae3c8 (diff) | |
DX11: If the virtual XFB list overflows, replace the oldest XFB with a new one instead of just failing.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6305 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Plugins')
| -rw-r--r-- | Source/Plugins/Plugin_VideoDX11/Src/FramebufferManager.cpp | 14 | ||||
| -rw-r--r-- | Source/Plugins/Plugin_VideoDX11/Src/FramebufferManager.h | 10 |
2 files changed, 7 insertions, 17 deletions
diff --git a/Source/Plugins/Plugin_VideoDX11/Src/FramebufferManager.cpp b/Source/Plugins/Plugin_VideoDX11/Src/FramebufferManager.cpp index 94cd925886..79d162d558 100644 --- a/Source/Plugins/Plugin_VideoDX11/Src/FramebufferManager.cpp +++ b/Source/Plugins/Plugin_VideoDX11/Src/FramebufferManager.cpp @@ -181,8 +181,8 @@ void FramebufferManager::copyToVirtualXFB(u32 xfbAddr, u32 fbWidth, u32 fbHeight if (it == m_virtualXFBList.end() && (int)m_virtualXFBList.size() >= MAX_VIRTUAL_XFB) { - PanicAlert("Requested creating a new virtual XFB although the maximum number has already been reached! Report this to the devs"); - return; + // Replace the last virtual XFB (might cause glitches, but better than allocating 50 XFBs...) + --it; } float scaleX = Renderer::GetTargetScaleX(); @@ -243,12 +243,10 @@ void FramebufferManager::copyToVirtualXFB(u32 xfbAddr, u32 fbWidth, u32 fbHeight // Add the new Virtual XFB to the list if (m_virtualXFBList.size() >= MAX_VIRTUAL_XFB) { - PanicAlert("Requested creating a new virtual XFB although the maximum number has already been reached! Report this to the devs"); - SAFE_RELEASE(newVirt.xfbSource.tex); - return; - // TODO, possible alternative to failing: just delete the oldest virtual XFB: - // m_virtualXFBList.back().xfbSource.tex->Release(); - // m_virtualXFBList.pop_back(); + // List overflowed; delete the oldest. + m_virtualXFBList.back().xfbSource.tex->Release(); + m_virtualXFBList.pop_back(); + WARN_LOG(VIDEO, "Virtual XFB list overflown, releasing oldest virtual XFB"); } m_virtualXFBList.push_front(newVirt); } diff --git a/Source/Plugins/Plugin_VideoDX11/Src/FramebufferManager.h b/Source/Plugins/Plugin_VideoDX11/Src/FramebufferManager.h index ae98765355..5ec009bda1 100644 --- a/Source/Plugins/Plugin_VideoDX11/Src/FramebufferManager.h +++ b/Source/Plugins/Plugin_VideoDX11/Src/FramebufferManager.h @@ -61,15 +61,7 @@ inline bool addrRangesOverlap(u32 aLower, u32 aUpper, u32 bLower, u32 bUpper) struct XFBSource { - XFBSource() - { - this->srcAddr = 0; - this->srcWidth = 0; - this->srcHeight = 0; - this->tex = NULL; - this->texWidth = 0; - this->texHeight = 0; - } + XFBSource() : srcAddr(0), srcWidth(0), srcHeight(0), tex(NULL), texWidth(0), texHeight(0) {} u32 srcAddr; u32 srcWidth; |
