We are migrating issue tracker of Cocos2d-x Project to Github, please create new issue there. Thanks.
CCGLProgram::compileShader() aborts the program
CCGLProgram::compileShader() aborts the program
Bug #4600 [Closed]
Redmine issue system is closed, we are using github issue system instead.
This issue was moved to https://github.com/cocos2d/cocos2d-x/issues/8389
Status: | Closed | |
---|---|---|
Start date: | 2014-03-28 | |
Priority: | Low | |
Due date: | ||
Assignee: | - | |
% Done: | 0% |
|
Category: | all | |
Target version: | - |
CCGLProgram::compileShader() calls abort() when the shader program is invalid.
But it should return false.
What I want to do is this:
・Shader A: Better performance. Compilable on some device, not on the other device.
・Shader B: Worse performance. Compilable on all devices.
In this case, first I want to try using shader A, and on failure, next shader B.
But current behavior make the program aborted when failed in shader A, so I can't try shader B.
To do this, I have to try glCompileShader(shader A) manually and re-compile with CCGLProgram::initWithVertexShaderByteArray(), it is inefficient.
If CCGLProgram::compileShader() returns false on failure, this'll be more simple.
I have only to call CCGLProgram::initWithVertexShaderByteArray() twice.