mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2024-11-22 05:45:38 +00:00
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()
|
||||
{
|
||||
g_host_display->ClearDisplayTexture();
|
||||
GPU_HW_D3D11::ResetGraphicsAPIState();
|
||||
|
||||
DestroyShaders();
|
||||
DestroyStateObjects();
|
||||
|
|
|
@ -22,7 +22,6 @@ GPU_HW_D3D12::GPU_HW_D3D12() = default;
|
|||
GPU_HW_D3D12::~GPU_HW_D3D12()
|
||||
{
|
||||
g_host_display->ClearDisplayTexture();
|
||||
GPU_HW_D3D12::ResetGraphicsAPIState();
|
||||
|
||||
DestroyResources();
|
||||
}
|
||||
|
|
|
@ -29,7 +29,6 @@ GPU_HW_OpenGL::~GPU_HW_OpenGL()
|
|||
glDeleteTextures(1, &m_texture_buffer_r16ui_texture);
|
||||
|
||||
g_host_display->ClearDisplayTexture();
|
||||
GPU_HW_OpenGL::ResetGraphicsAPIState();
|
||||
|
||||
// One of our programs might've been bound.
|
||||
GL::Program::ResetLastProgram();
|
||||
|
|
|
@ -21,7 +21,6 @@ GPU_HW_Vulkan::GPU_HW_Vulkan() = default;
|
|||
GPU_HW_Vulkan::~GPU_HW_Vulkan()
|
||||
{
|
||||
g_host_display->ClearDisplayTexture();
|
||||
GPU_HW_Vulkan::ResetGraphicsAPIState();
|
||||
DestroyResources();
|
||||
}
|
||||
|
||||
|
|
|
@ -1477,6 +1477,8 @@ void System::DestroySystem()
|
|||
Timers::Shutdown();
|
||||
Pad::Shutdown();
|
||||
CDROM::Shutdown();
|
||||
if (g_gpu)
|
||||
g_gpu->ResetGraphicsAPIState();
|
||||
g_gpu.reset();
|
||||
InterruptController::Shutdown();
|
||||
DMA::Shutdown();
|
||||
|
|
Loading…
Reference in a new issue