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);
|
||||
|
||||
parseVertexAttribs();
|
||||
parseUniforms();
|
||||
|
||||
clearShader();
|
||||
|
||||
#if DEBUG || (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT)
|
||||
// Calling glGetProgramiv(...GL_LINK_STATUS...) will force linking of the program at this moment.
|
||||
// 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
|
||||
// linked succesfully. Some shaders might be downloaded in runtime so, release version should have this check.
|
||||
// For more info, see Github issue #16231
|
||||
glGetProgramiv(_program, GL_LINK_STATUS, &status);
|
||||
|
||||
if (status == GL_FALSE)
|
||||
|
@ -579,7 +578,13 @@ bool GLProgram::link()
|
|||
GL::deleteProgram(_program);
|
||||
_program = 0;
|
||||
}
|
||||
#endif
|
||||
else
|
||||
{
|
||||
parseVertexAttribs();
|
||||
parseUniforms();
|
||||
|
||||
clearShader();
|
||||
}
|
||||
|
||||
return (status == GL_TRUE);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue