1
0
mirror of https://github.com/blawar/GLideN64.git synced 2024-07-02 09:03:37 +00:00

Fix crash when fb emulation enabled/disabled during gameplay, issue #601

This commit is contained in:
Sergey Lipskiy 2015-07-23 21:55:30 +06:00
parent 70c4941fb9
commit cbbd5d17de
4 changed files with 17 additions and 8 deletions

View File

@ -582,13 +582,11 @@ void FrameBuffer_Init()
void FrameBuffer_Destroy()
{
if (config.frameBufferEmulation.enable != 0) {
g_RDRAMtoFB.Destroy();
#ifndef GLES2
g_dbToRDRAM.Destroy();
g_fbToRDRAM.Destroy();
#endif
}
frameBufferList().destroy();
}
@ -1099,8 +1097,10 @@ void DepthBufferToRDRAM::Destroy() {
textureCache().removeFrameBufferTexture(m_pDepthTexture);
m_pDepthTexture = NULL;
}
glDeleteBuffers(1, &m_PBO);
m_PBO = 0;
if (m_PBO != 0) {
glDeleteBuffers(1, &m_PBO);
m_PBO = 0;
}
}
bool DepthBufferToRDRAM::CopyToRDRAM( u32 _address) {
@ -1209,8 +1209,10 @@ void RDRAMtoFrameBuffer::Destroy()
m_pTexture = NULL;
}
#ifndef GLES2
glDeleteBuffers(1, &m_PBO);
m_PBO = 0;
if (m_PBO != 0) {
glDeleteBuffers(1, &m_PBO);
m_PBO = 0;
}
#endif
}

View File

@ -182,6 +182,7 @@ public:
u32 getHeightOffset() const {return m_heightOffset;}
bool isFullscreen() const {return m_bFullscreen;}
bool isAdjustScreen() const {return m_bAdjustScreen;}
bool isResizeWindow() const {return m_bResizeWindow;}
OGLRender & getRender() {return m_render;}

View File

@ -7,6 +7,7 @@
#include "GBI.h"
#include "gDP.h"
#include "gSP.h"
#include "OpenGL.h"
#include "Debug.h"
void RDP_Unknown( u32 w0, u32 w1 )
@ -552,7 +553,12 @@ inline u32 READ_RDP_DATA(u32 address)
void RDP_ProcessRDPList()
{
DebugMsg(DEBUG_HIGH | DEBUG_HANDLED, "ProcessRDPList()\n");
if (ConfigOpen || video().isResizeWindow()) {
dp_status &= ~0x0002;
dp_start = dp_current = dp_end;
gDPFullSync();
return;
}
const u32 length = dp_end - dp_current;

View File

@ -137,7 +137,7 @@ void RSP_CheckDLCounter()
void RSP_ProcessDList()
{
if (ConfigOpen) {
if (ConfigOpen || video().isResizeWindow()) {
gDPFullSync();
return;
}