Corrects error handling in UseProgram

TRAC #11666 Signed-off-by: Nicolas Capens Signed-off-by: Daniel Koch Author: Shannon Woods git-svn-id: https://angleproject.googlecode.com/svn/trunk@141 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent d1abe5b0
...@@ -4268,7 +4268,19 @@ void __stdcall glUseProgram(GLuint program) ...@@ -4268,7 +4268,19 @@ void __stdcall glUseProgram(GLuint program)
{ {
gl::Program *programObject = context->getProgram(program); gl::Program *programObject = context->getProgram(program);
if (programObject && !programObject->isLinked()) if (!programObject && program != 0)
{
if (context->getShader(program))
{
return error(GL_INVALID_OPERATION);
}
else
{
return error(GL_INVALID_VALUE);
}
}
if (program != 0 && !programObject->isLinked())
{ {
return error(GL_INVALID_OPERATION); return error(GL_INVALID_OPERATION);
} }
......
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