mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-23 05:19:56 +00:00
Fix to shutdown sequence
This commit is contained in:
parent
436a3e0d61
commit
d43452f0ce
@ -212,7 +212,6 @@ GLuint ShaderStageToOpenGL(ShaderStage stage) {
|
||||
class OpenGLShaderModule : public ShaderModule {
|
||||
public:
|
||||
OpenGLShaderModule(GLRenderManager *render, ShaderStage stage, const std::string &tag) : render_(render), stage_(stage), tag_(tag) {
|
||||
DEBUG_LOG(G3D, "Shader module created (%p)", this);
|
||||
glstage_ = ShaderStageToOpenGL(stage);
|
||||
}
|
||||
|
||||
|
@ -198,7 +198,6 @@ public:
|
||||
const std::string &GetSource() const { return source_; }
|
||||
~VKShaderModule() {
|
||||
if (module_) {
|
||||
DEBUG_LOG(G3D, "Queueing %s (shmodule %p) for release", tag_.c_str(), module_);
|
||||
VkShaderModule shaderModule = module_->BlockUntilReady();
|
||||
vulkan_->Delete().QueueDeleteShaderModule(shaderModule);
|
||||
vulkan_->Delete().QueueCallback([](VulkanContext *context, void *m) {
|
||||
@ -268,7 +267,6 @@ public:
|
||||
vkrDesc = new VKRGraphicsPipelineDesc();
|
||||
}
|
||||
~VKPipeline() {
|
||||
DEBUG_LOG(G3D, "Queueing %s (pipeline) for release", tag_.c_str());
|
||||
if (pipeline) {
|
||||
pipeline->QueueForDeletion(vulkan_);
|
||||
}
|
||||
|
@ -38,7 +38,6 @@ bool AndroidJavaEGLGraphicsContext::InitFromRenderThread(ANativeWindow *wnd, int
|
||||
|
||||
void AndroidJavaEGLGraphicsContext::ShutdownFromRenderThread() {
|
||||
INFO_LOG(G3D, "AndroidJavaEGLGraphicsContext::Shutdown");
|
||||
renderManager_->WaitUntilQueueIdle();
|
||||
renderManager_ = nullptr; // owned by draw_.
|
||||
delete draw_;
|
||||
draw_ = nullptr;
|
||||
|
@ -40,7 +40,6 @@ public:
|
||||
}
|
||||
|
||||
void StopThread() override {
|
||||
renderManager_->WaitUntilQueueIdle();
|
||||
renderManager_->StopThread();
|
||||
}
|
||||
|
||||
|
@ -868,16 +868,18 @@ extern "C" void Java_org_ppsspp_ppsspp_NativeApp_shutdown(JNIEnv *, jclass) {
|
||||
EmuThreadStop("shutdown");
|
||||
INFO_LOG(SYSTEM, "BeginAndroidShutdown");
|
||||
graphicsContext->BeginAndroidShutdown();
|
||||
INFO_LOG(SYSTEM, "Joining emuthread");
|
||||
EmuThreadJoin();
|
||||
// Now, it could be that we had some frames queued up. Get through them.
|
||||
// We're on the render thread, so this is synchronous.
|
||||
while (graphicsContext->ThreadFrame()) {
|
||||
INFO_LOG(SYSTEM, "graphicsContext->ThreadFrame executed to clear buffers");
|
||||
}
|
||||
do {
|
||||
INFO_LOG(SYSTEM, "Executing graphicsContext->ThreadFrame to clear buffers");
|
||||
} while (graphicsContext->ThreadFrame());
|
||||
graphicsContext->ThreadEnd();
|
||||
INFO_LOG(SYSTEM, "ThreadEnd called.");
|
||||
graphicsContext->ShutdownFromRenderThread();
|
||||
INFO_LOG(SYSTEM, "Graphics context now shut down from NativeApp_shutdown");
|
||||
|
||||
INFO_LOG(SYSTEM, "Joining emuthread");
|
||||
EmuThreadJoin();
|
||||
}
|
||||
|
||||
INFO_LOG(SYSTEM, "NativeApp.shutdown() -- begin");
|
||||
|
Loading…
Reference in New Issue
Block a user