mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-12-04 03:33:44 +01:00
Fixes to in-game GPU shutdown/switching. Fixes #10860
This commit is contained in:
1 parent
4624d09e29
commit
2cd8bd9bc3
2 files changed
+8
-1
No files matched your search
@@ -130,7 +130,7 @@ GPU_GLES::~GPU_GLES() {
|
||||
shaderManagerGL_->ClearCache(true);
|
||||
depalShaderCache_.Clear();
|
||||
fragmentTestCache_.Clear();
|
||||
if (!shaderCachePath_.empty()) {
|
||||
if (!shaderCachePath_.empty() && draw_) {
|
||||
shaderManagerGL_->Save(shaderCachePath_);
|
||||
}
|
||||
delete shaderManagerGL_;
|
||||
|
||||
@@ -141,6 +141,12 @@ void GPU_Vulkan::LoadCache(std::string filename) {
|
||||
}
|
||||
|
||||
void GPU_Vulkan::SaveCache(std::string filename) {
|
||||
if (!draw_) {
|
||||
// Already got the lost message, we're in shutdown.
|
||||
WARN_LOG(G3D, "Not saving shaders - shutting down from in-game.");
|
||||
return;
|
||||
}
|
||||
|
||||
FILE *f = File::OpenCFile(filename, "wb");
|
||||
if (!f)
|
||||
return;
|
||||
@@ -474,6 +480,7 @@ void GPU_Vulkan::DeviceLost() {
|
||||
textureCacheVulkan_->DeviceLost();
|
||||
depalShaderCache_.DeviceLost();
|
||||
shaderManagerVulkan_->ClearShaders();
|
||||
draw_ = nullptr;
|
||||
}
|
||||
|
||||
void GPU_Vulkan::DeviceRestore() {
|
||||
|
||||
Reference in new issue
Block a user