GPU: Move graphics API reset state to System
Stops us trying to reset state on objects which don't exist if initialization failed (apparently some Android devices.. of course).
This commit is contained in:
parent
c8e7922c1a
commit
178a659a98
|
@ -19,7 +19,6 @@ GPU_HW_D3D11::GPU_HW_D3D11(ID3D11Device* device, ID3D11DeviceContext* context) :
|
||||||
GPU_HW_D3D11::~GPU_HW_D3D11()
|
GPU_HW_D3D11::~GPU_HW_D3D11()
|
||||||
{
|
{
|
||||||
g_host_display->ClearDisplayTexture();
|
g_host_display->ClearDisplayTexture();
|
||||||
GPU_HW_D3D11::ResetGraphicsAPIState();
|
|
||||||
|
|
||||||
DestroyShaders();
|
DestroyShaders();
|
||||||
DestroyStateObjects();
|
DestroyStateObjects();
|
||||||
|
|
|
@ -22,7 +22,6 @@ GPU_HW_D3D12::GPU_HW_D3D12() = default;
|
||||||
GPU_HW_D3D12::~GPU_HW_D3D12()
|
GPU_HW_D3D12::~GPU_HW_D3D12()
|
||||||
{
|
{
|
||||||
g_host_display->ClearDisplayTexture();
|
g_host_display->ClearDisplayTexture();
|
||||||
GPU_HW_D3D12::ResetGraphicsAPIState();
|
|
||||||
|
|
||||||
DestroyResources();
|
DestroyResources();
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,7 +29,6 @@ GPU_HW_OpenGL::~GPU_HW_OpenGL()
|
||||||
glDeleteTextures(1, &m_texture_buffer_r16ui_texture);
|
glDeleteTextures(1, &m_texture_buffer_r16ui_texture);
|
||||||
|
|
||||||
g_host_display->ClearDisplayTexture();
|
g_host_display->ClearDisplayTexture();
|
||||||
GPU_HW_OpenGL::ResetGraphicsAPIState();
|
|
||||||
|
|
||||||
// One of our programs might've been bound.
|
// One of our programs might've been bound.
|
||||||
GL::Program::ResetLastProgram();
|
GL::Program::ResetLastProgram();
|
||||||
|
|
|
@ -21,7 +21,6 @@ GPU_HW_Vulkan::GPU_HW_Vulkan() = default;
|
||||||
GPU_HW_Vulkan::~GPU_HW_Vulkan()
|
GPU_HW_Vulkan::~GPU_HW_Vulkan()
|
||||||
{
|
{
|
||||||
g_host_display->ClearDisplayTexture();
|
g_host_display->ClearDisplayTexture();
|
||||||
GPU_HW_Vulkan::ResetGraphicsAPIState();
|
|
||||||
DestroyResources();
|
DestroyResources();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1477,6 +1477,8 @@ void System::DestroySystem()
|
||||||
Timers::Shutdown();
|
Timers::Shutdown();
|
||||||
Pad::Shutdown();
|
Pad::Shutdown();
|
||||||
CDROM::Shutdown();
|
CDROM::Shutdown();
|
||||||
|
if (g_gpu)
|
||||||
|
g_gpu->ResetGraphicsAPIState();
|
||||||
g_gpu.reset();
|
g_gpu.reset();
|
||||||
InterruptController::Shutdown();
|
InterruptController::Shutdown();
|
||||||
DMA::Shutdown();
|
DMA::Shutdown();
|
||||||
|
|
Loading…
Reference in New Issue