OpenGLDevice: Fix pipeline cache leaving fields uninitialized

This commit is contained in:
Stenzek 2023-08-30 02:02:09 +10:00
parent f993f0923d
commit df4d441b4b
2 changed files with 4 additions and 3 deletions

View file

@ -220,8 +220,7 @@ void OpenGLDevice::PushDebugGroup(const char* fmt, ...)
va_start(ap, fmt);
const std::string buf(StringUtil::StdStringFromFormatV(fmt, ap));
va_end(ap);
if (!buf.empty())
glPushDebugGroup(GL_DEBUG_SOURCE_APPLICATION, 0, static_cast<GLsizei>(buf.size()), buf.c_str());
glPushDebugGroup(GL_DEBUG_SOURCE_APPLICATION, 0, static_cast<GLsizei>(buf.size()), buf.c_str());
#endif
}

View file

@ -362,7 +362,7 @@ void OpenGLDevice::PostLinkProgram(const GPUPipeline::GraphicsConfig& plconfig,
glUniform1i(location, i);
}
glUseProgram(m_current_pipeline ? m_current_pipeline->GetProgram() : 0);
glUseProgram(m_last_program);
}
}
@ -722,6 +722,8 @@ bool OpenGLDevice::ReadPipelineCache(const std::string& filename)
}
OpenGLPipeline::ProgramCacheItem pitem;
pitem.program_id = 0;
pitem.reference_count = 0;
pitem.file_format = entry.format;
pitem.file_offset = entry.offset;
pitem.file_uncompressed_size = entry.uncompressed_size;