Fixes improper error generation by DeleteShader

TRAC #11662 Signed-off-by: Nicolas Capens Signed-off-by: Daniel Koch Author: Shannon Woods git-svn-id: https://angleproject.googlecode.com/svn/trunk@134 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent 0cefaf45
...@@ -1104,10 +1104,27 @@ void __stdcall glDeleteProgram(GLuint program) ...@@ -1104,10 +1104,27 @@ void __stdcall glDeleteProgram(GLuint program)
try try
{ {
if (program == 0)
{
return;
}
gl::Context *context = gl::getContext(); gl::Context *context = gl::getContext();
if (context) if (context)
{ {
if (!context->getProgram(program))
{
if(context->getShader(program))
{
return error(GL_INVALID_OPERATION);
}
else
{
return error(GL_INVALID_VALUE);
}
}
context->deleteProgram(program); context->deleteProgram(program);
} }
} }
...@@ -1150,10 +1167,27 @@ void __stdcall glDeleteShader(GLuint shader) ...@@ -1150,10 +1167,27 @@ void __stdcall glDeleteShader(GLuint shader)
try try
{ {
if (shader == 0)
{
return;
}
gl::Context *context = gl::getContext(); gl::Context *context = gl::getContext();
if (context) if (context)
{ {
if (!context->getShader(shader))
{
if(context->getProgram(shader))
{
return error(GL_INVALID_OPERATION);
}
else
{
return error(GL_INVALID_VALUE);
}
}
context->deleteShader(shader); context->deleteShader(shader);
} }
} }
......
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