[Fix] (MG_Impl/GLImpl, MG_State/GLState): reject unlinked empty programs [skip ci]

This commit is contained in:
2026-07-02 14:37:29 +08:00
parent bc2db26e07
commit ced7f28898
2 changed files with 12 additions and 0 deletions
@@ -171,6 +171,11 @@ namespace MobileGL::MG_State::GLState {
if (addDefaultFSIfMissingForRenderingPipelineProgram) {
AddDefaultFragmentShaderIfMissing();
}
if (m_shaders.empty()) {
m_infoLog = "No shader objects are attached to program.";
MGLOG_E("ProgramObject %u: Link failed - no shader objects attached.", m_externalIndex);
return;
}
std::sort(m_shaders.begin(), m_shaders.end(),
[](const SharedPtr<ShaderObject>& a, const SharedPtr<ShaderObject>& b) {