mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-12-02 18:53:58 +01:00
Fix possible crash when loading GL shader caches. Should help #9930.
This commit is contained in:
1 parent
2180b1d557
commit
4938ab786e
1 file changed
+10
-2
@@ -1023,7 +1023,11 @@ void ShaderManagerGLES::LoadAndPrecompile(const std::string &filename) {
|
||||
delete vs;
|
||||
return;
|
||||
}
|
||||
vsCache_.Insert(id, vs);
|
||||
if (!vsCache_.Get(id)) {
|
||||
vsCache_.Insert(id, vs);
|
||||
} else {
|
||||
WARN_LOG(G3D, "Duplicate vertex shader found in GL shader cache, ignoring");
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < header.numFragmentShaders; i++) {
|
||||
ShaderID id;
|
||||
@@ -1031,7 +1035,11 @@ void ShaderManagerGLES::LoadAndPrecompile(const std::string &filename) {
|
||||
ERROR_LOG(G3D, "Truncated shader cache file, aborting.");
|
||||
return;
|
||||
}
|
||||
fsCache_.Insert(id, CompileFragmentShader(id));
|
||||
if (!fsCache_.Get(id)) {
|
||||
fsCache_.Insert(id, CompileFragmentShader(id));
|
||||
} else {
|
||||
WARN_LOG(G3D, "Duplicate fragment shader found in GL shader cache, ignoring");
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < header.numLinkedPrograms; i++) {
|
||||
ShaderID vsid, fsid;
|
||||
|
||||
Reference in new issue
Block a user