ShaderCache: Fix crash if pipeline from uid cache fails creation

This commit is contained in:
Stenzek 2019-04-20 23:15:25 +10:00
parent 96aa762d1e
commit c6b45c5ca9
1 changed files with 20 additions and 16 deletions

View File

@ -641,6 +641,7 @@ const AbstractPipeline* ShaderCache::InsertGXPipeline(const GXPipelineUid& confi
auto& entry = m_gx_pipeline_cache[config]; auto& entry = m_gx_pipeline_cache[config];
entry.second = false; entry.second = false;
if (!entry.first && pipeline) if (!entry.first && pipeline)
{
entry.first = std::move(pipeline); entry.first = std::move(pipeline);
if (g_ActiveConfig.bShaderCache) if (g_ActiveConfig.bShaderCache)
@ -654,6 +655,7 @@ const AbstractPipeline* ShaderCache::InsertGXPipeline(const GXPipelineUid& confi
static_cast<u32>(cache_data.size())); static_cast<u32>(cache_data.size()));
} }
} }
}
return entry.first.get(); return entry.first.get();
} }
@ -665,6 +667,7 @@ ShaderCache::InsertGXUberPipeline(const GXUberPipelineUid& config,
auto& entry = m_gx_uber_pipeline_cache[config]; auto& entry = m_gx_uber_pipeline_cache[config];
entry.second = false; entry.second = false;
if (!entry.first && pipeline) if (!entry.first && pipeline)
{
entry.first = std::move(pipeline); entry.first = std::move(pipeline);
if (g_ActiveConfig.bShaderCache) if (g_ActiveConfig.bShaderCache)
@ -678,6 +681,7 @@ ShaderCache::InsertGXUberPipeline(const GXUberPipelineUid& config,
static_cast<u32>(cache_data.size())); static_cast<u32>(cache_data.size()));
} }
} }
}
return entry.first.get(); return entry.first.get();
} }