Fixes error handling in ShaderSource

TRAC #11664 Signed-off-by: Nicolas Capens Signed-off-by: Daniel Koch Author: Shannon Woods git-svn-id: https://angleproject.googlecode.com/svn/trunk@135 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent 75401e61
...@@ -3225,7 +3225,7 @@ void __stdcall glShaderSource(GLuint shader, GLsizei count, const GLchar** strin ...@@ -3225,7 +3225,7 @@ void __stdcall glShaderSource(GLuint shader, GLsizei count, const GLchar** strin
try try
{ {
if (shader == 0 || count < 0) if (count < 0)
{ {
return error(GL_INVALID_VALUE); return error(GL_INVALID_VALUE);
} }
...@@ -3238,8 +3238,15 @@ void __stdcall glShaderSource(GLuint shader, GLsizei count, const GLchar** strin ...@@ -3238,8 +3238,15 @@ void __stdcall glShaderSource(GLuint shader, GLsizei count, const GLchar** strin
if (!shaderObject) if (!shaderObject)
{ {
if (context->getProgram(shader))
{
return error(GL_INVALID_OPERATION); return error(GL_INVALID_OPERATION);
} }
else
{
return error(GL_INVALID_VALUE);
}
}
shaderObject->setSource(count, string, length); shaderObject->setSource(count, string, length);
} }
......
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