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:
Stenzek committed 2023-02-05 13:12:45 +10:00
1 parent c8e7922c1a
commit 178a659a98
5 files changed
+2 -4

No files matched your search

-1
View File
@@ -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();
-1
View File
@@ -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();
}
-1
View File
@@ -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();
-1
View File
@@ -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();
}
+2
View File
@@ -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();