mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
libretro: context cleanup
This commit is contained in:
parent
07db63e9ff
commit
a83c95ab9b
5 changed files with 29 additions and 26 deletions
|
@ -8,7 +8,7 @@
|
|||
#include "libretro/LibretroGLContext.h"
|
||||
|
||||
bool LibretroGLContext::Init() {
|
||||
if (!LibretroHWRenderContext::Init(true))
|
||||
if (!LibretroHWRenderContext::Init(false))
|
||||
return false;
|
||||
|
||||
g_Config.iGPUBackend = (int)GPUBackend::OPENGL;
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
#include "libretro/LibretroGLCoreContext.h"
|
||||
|
||||
bool LibretroGLCoreContext::Init() {
|
||||
if (!LibretroHWRenderContext::Init(true))
|
||||
if (!LibretroHWRenderContext::Init(false))
|
||||
return false;
|
||||
|
||||
g_Config.iGPUBackend = (int)GPUBackend::OPENGL;
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
#include "libretro/LibretroGraphicsContext.h"
|
||||
#include "libretro/LibretroGLContext.h"
|
||||
#include "libretro/LibretroGLCoreContext.h"
|
||||
#include "libretro/libretro.h"
|
||||
#include "libretro/LibretroVulkanContext.h"
|
||||
#ifdef _WIN32
|
||||
#include "libretro/LibretroD3D11Context.h"
|
||||
|
@ -43,10 +42,8 @@ LibretroHWRenderContext::LibretroHWRenderContext(retro_hw_context_type context_t
|
|||
void LibretroHWRenderContext::ContextReset() {
|
||||
INFO_LOG(G3D, "Context reset");
|
||||
|
||||
// needed to restart the thread
|
||||
// TODO: find a way to move this to ContextDestroy.
|
||||
if (!hw_render_.cache_context && Libretro::useEmuThread && draw_ && Libretro::emuThreadState != Libretro::EmuThreadState::PAUSED) {
|
||||
DestroyDrawContext();
|
||||
if (gpu) {
|
||||
gpu->DeviceLost();
|
||||
}
|
||||
|
||||
if (!draw_) {
|
||||
|
@ -66,11 +63,15 @@ void LibretroHWRenderContext::ContextDestroy() {
|
|||
INFO_LOG(G3D, "Context destroy");
|
||||
|
||||
if (Libretro::useEmuThread) {
|
||||
#if 0
|
||||
Libretro::EmuThreadPause();
|
||||
#else
|
||||
Libretro::EmuThreadStop();
|
||||
#endif
|
||||
}
|
||||
|
||||
if (gpu) {
|
||||
gpu->DeviceLost();
|
||||
}
|
||||
|
||||
if (!hw_render_.cache_context && Libretro::useEmuThread && draw_ && Libretro::emuThreadState != Libretro::EmuThreadState::PAUSED) {
|
||||
DestroyDrawContext();
|
||||
}
|
||||
|
||||
if (!hw_render_.cache_context && !Libretro::useEmuThread) {
|
||||
|
|
|
@ -97,7 +97,7 @@ static const VkApplicationInfo *GetApplicationInfo(void) {
|
|||
}
|
||||
|
||||
bool LibretroVulkanContext::Init() {
|
||||
if (!LibretroHWRenderContext::Init(false)) {
|
||||
if (!LibretroHWRenderContext::Init(true)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -131,6 +131,8 @@ void LibretroVulkanContext::ContextReset() {
|
|||
|
||||
void LibretroVulkanContext::ContextDestroy() {
|
||||
INFO_LOG(G3D, "LibretroVulkanContext::ContextDestroy()");
|
||||
vk->WaitUntilQueueIdle();
|
||||
LibretroHWRenderContext::ContextDestroy();
|
||||
}
|
||||
|
||||
void LibretroVulkanContext::CreateDrawContext() {
|
||||
|
|
Loading…
Add table
Reference in a new issue