OpenGLDevice: Fix crash when driver doesn't support binaries
This commit is contained in:
parent
7d76643c02
commit
5bbb7cf906
|
@ -299,7 +299,8 @@ GLuint OpenGLDevice::LookupProgramCache(const OpenGLPipeline::ProgramCacheKey& k
|
|||
item.file_compressed_size = 0;
|
||||
if (item.program_id != 0)
|
||||
{
|
||||
AddToPipelineCache(&item);
|
||||
if (m_pipeline_disk_cache_file)
|
||||
AddToPipelineCache(&item);
|
||||
item.reference_count++;
|
||||
}
|
||||
|
||||
|
@ -938,8 +939,11 @@ bool OpenGLDevice::DiscardPipelineCache()
|
|||
void OpenGLDevice::ClosePipelineCache()
|
||||
{
|
||||
const ScopedGuard file_closer = [this]() {
|
||||
std::fclose(m_pipeline_disk_cache_file);
|
||||
m_pipeline_disk_cache_file = nullptr;
|
||||
if (m_pipeline_disk_cache_file)
|
||||
{
|
||||
std::fclose(m_pipeline_disk_cache_file);
|
||||
m_pipeline_disk_cache_file = nullptr;
|
||||
}
|
||||
};
|
||||
|
||||
if (!m_pipeline_disk_cache_changed)
|
||||
|
|
Loading…
Reference in New Issue