GPU/HW: Reset state when shutting down

This commit is contained in:
Connor McLaughlin 2019-11-05 19:51:08 +10:00
parent 2c631aba5e
commit 2578f34a7c
2 changed files with 10 additions and 3 deletions

View File

@ -13,7 +13,11 @@ GPU_HW_D3D11::GPU_HW_D3D11() = default;
GPU_HW_D3D11::~GPU_HW_D3D11()
{
m_host_display->SetDisplayTexture(nullptr, 0, 0, 0, 0, 0, 0, 1.0f);
if (m_host_display)
{
m_host_display->SetDisplayTexture(nullptr, 0, 0, 0, 0, 0, 0, 1.0f);
ResetGraphicsAPIState();
}
}
bool GPU_HW_D3D11::Initialize(HostDisplay* host_display, System* system, DMA* dma,

View File

@ -11,8 +11,11 @@ GPU_HW_OpenGL::GPU_HW_OpenGL() : GPU_HW() {}
GPU_HW_OpenGL::~GPU_HW_OpenGL()
{
m_host_display->SetDisplayTexture(nullptr, 0, 0, 0, 0, 0, 0, 1.0f);
DestroyFramebuffer();
if (m_host_display)
{
m_host_display->SetDisplayTexture(nullptr, 0, 0, 0, 0, 0, 0, 1.0f);
ResetGraphicsAPIState();
}
}
bool GPU_HW_OpenGL::Initialize(HostDisplay* host_display, System* system, DMA* dma,