Permalink
Browse files

Vulkan: Wait for GPU ready on shutdown.

In case it's still busy preloading shaders.
  • Loading branch information...
unknownbrackets committed Oct 31, 2018
1 parent 5ea935f commit 6130eb34beb5e36f6f2d3c89709d89c73e4cd0e3
Showing with 9 additions and 1 deletion.
  1. +7 −1 GPU/GPU.cpp
  2. +2 −0 GPU/Vulkan/GPU_Vulkan.cpp
@@ -17,6 +17,7 @@
#include "ppsspp_config.h"
#include "base/timeutil.h"
#include "Common/GraphicsContext.h"
#include "Core/Core.h"
@@ -105,7 +106,12 @@ bool GPU_Init(GraphicsContext *ctx, Draw::DrawContext *draw) {
#endif
void GPU_Shutdown() {
// Wait for IsReady, since it might be running on a thread.
// Potentially we could set a flag to try to early quit.
while (gpu && !gpu->IsReady()) {
sleep_ms(10);
}
delete gpu;
gpu = nullptr;
gpuDebug = 0;
gpuDebug = nullptr;
}
@@ -110,6 +110,8 @@ GPU_Vulkan::GPU_Vulkan(GraphicsContext *gfxCtx, Draw::DrawContext *draw)
shaderCacheLoaded_ = true;
});
th.detach();
} else {
shaderCacheLoaded_ = true;
}
}

0 comments on commit 6130eb3

Please sign in to comment.