Make Program link() and setProgramBinary() return the status of the operation

Trac #21270 Bug=351 Signed-off-by: Nicolas Capens git-svn-id: https://angleproject.googlecode.com/svn/trunk@1239 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent 95d29424
...@@ -240,7 +240,7 @@ void Program::bindAttributeLocation(GLuint index, const char *name) ...@@ -240,7 +240,7 @@ void Program::bindAttributeLocation(GLuint index, const char *name)
// Links the HLSL code of the vertex and pixel shader by matching up their varyings, // Links the HLSL code of the vertex and pixel shader by matching up their varyings,
// compiling them into binaries, determining the attribute mappings, and collecting // compiling them into binaries, determining the attribute mappings, and collecting
// a list of uniforms // a list of uniforms
void Program::link() bool Program::link()
{ {
unlink(false); unlink(false);
...@@ -250,7 +250,11 @@ void Program::link() ...@@ -250,7 +250,11 @@ void Program::link()
if (!mProgramBinary->link(mInfoLog, mAttributeBindings, mFragmentShader, mVertexShader)) if (!mProgramBinary->link(mInfoLog, mAttributeBindings, mFragmentShader, mVertexShader))
{ {
unlink(false); unlink(false);
return false;
} }
return true;
} }
int AttributeBindings::getAttributeBinding(const std::string &name) const int AttributeBindings::getAttributeBinding(const std::string &name) const
...@@ -296,7 +300,7 @@ ProgramBinary* Program::getProgramBinary() ...@@ -296,7 +300,7 @@ ProgramBinary* Program::getProgramBinary()
return mProgramBinary; return mProgramBinary;
} }
void Program::setProgramBinary(const void *binary, GLsizei length) bool Program::setProgramBinary(const void *binary, GLsizei length)
{ {
unlink(false); unlink(false);
...@@ -307,7 +311,11 @@ void Program::setProgramBinary(const void *binary, GLsizei length) ...@@ -307,7 +311,11 @@ void Program::setProgramBinary(const void *binary, GLsizei length)
{ {
delete mProgramBinary; delete mProgramBinary;
mProgramBinary = NULL; mProgramBinary = NULL;
return false;
} }
return true;
} }
void Program::release() void Program::release()
......
...@@ -68,8 +68,8 @@ class Program ...@@ -68,8 +68,8 @@ class Program
void bindAttributeLocation(GLuint index, const char *name); void bindAttributeLocation(GLuint index, const char *name);
void link(); bool link();
void setProgramBinary(const void *binary, GLsizei length); bool setProgramBinary(const void *binary, GLsizei length);
ProgramBinary *getProgramBinary(); ProgramBinary *getProgramBinary();
int getInfoLogLength() const; int getInfoLogLength() const;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment