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
try
{
if (shader == 0 || count < 0)
if (count < 0)
{
return error(GL_INVALID_VALUE);
}
......@@ -3238,7 +3238,14 @@ void __stdcall glShaderSource(GLuint shader, GLsizei count, const GLchar** strin
if (!shaderObject)
{
return error(GL_INVALID_OPERATION);
if (context->getProgram(shader))
{
return error(GL_INVALID_OPERATION);
}
else
{
return error(GL_INVALID_VALUE);
}
}
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