Fixes incorrect error handling in GetAttribLocation

TRAC #11657 Signed-off-by: Andrew Lewycky Signed-off-by: Daniel Koch Author: Shannon Woods git-svn-id: https://angleproject.googlecode.com/svn/trunk@128 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent d91cfe7e
...@@ -1722,11 +1722,19 @@ int __stdcall glGetAttribLocation(GLuint program, const GLchar* name) ...@@ -1722,11 +1722,19 @@ int __stdcall glGetAttribLocation(GLuint program, const GLchar* name)
if (context) if (context)
{ {
gl::Program *programObject = context->getProgram(program); gl::Program *programObject = context->getProgram(program);
if (!programObject) if (!programObject)
{ {
return error(GL_INVALID_VALUE, -1); if (context->getShader(program))
{
return error(GL_INVALID_OPERATION, -1);
}
else
{
return error(GL_INVALID_VALUE, -1);
}
} }
return programObject->getAttributeLocation(name); return programObject->getAttributeLocation(name);
......
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