mirror of https://github.com/axmolengine/axmol.git
Merge pull request #16232 from perminovVS/gl-program-link-status
GLProgram::link always check link status
This commit is contained in:
commit
1e1fad8b04
|
@ -565,12 +565,11 @@ bool GLProgram::link()
|
||||||
|
|
||||||
glLinkProgram(_program);
|
glLinkProgram(_program);
|
||||||
|
|
||||||
parseVertexAttribs();
|
// Calling glGetProgramiv(...GL_LINK_STATUS...) will force linking of the program at this moment.
|
||||||
parseUniforms();
|
// Otherwise, they might be linked when they are used for the first time. (I guess this depends on the driver implementation)
|
||||||
|
// So it might slow down the "booting" process on certain devices. But, on the other hand it is important to know if the shader
|
||||||
clearShader();
|
// linked succesfully. Some shaders might be downloaded in runtime so, release version should have this check.
|
||||||
|
// For more info, see Github issue #16231
|
||||||
#if DEBUG || (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT)
|
|
||||||
glGetProgramiv(_program, GL_LINK_STATUS, &status);
|
glGetProgramiv(_program, GL_LINK_STATUS, &status);
|
||||||
|
|
||||||
if (status == GL_FALSE)
|
if (status == GL_FALSE)
|
||||||
|
@ -579,7 +578,13 @@ bool GLProgram::link()
|
||||||
GL::deleteProgram(_program);
|
GL::deleteProgram(_program);
|
||||||
_program = 0;
|
_program = 0;
|
||||||
}
|
}
|
||||||
#endif
|
else
|
||||||
|
{
|
||||||
|
parseVertexAttribs();
|
||||||
|
parseUniforms();
|
||||||
|
|
||||||
|
clearShader();
|
||||||
|
}
|
||||||
|
|
||||||
return (status == GL_TRUE);
|
return (status == GL_TRUE);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue