Fix glDrawBuffersEXT to be compliant with the spec.

Bind GL_NONE to buffers beyond the specified input count, and require a buffer count of one for the default framebuffer.

TRAC #22835

Signed-off-by: Geoff Lang
Signed-off-by: Shannon Woods
Author: Jamie Madill

git-svn-id: https://angleproject.googlecode.com/svn/branches/dx11proto@2039 736b8ea6-26fd-11df-bfd4-992fa37f6226
This commit is contained in:
shannon.woods%[email protected] committed 2013-03-27 16:06:19 +00:00
1 parent a2ed39886b
commit 39c8562cf6
1 file changed
+8 -6
+8 -6
View File
@@ -6977,17 +6977,14 @@ void __stdcall glDrawBuffersEXT(GLsizei n, const GLenum *bufs)
if (context->getDrawFramebufferHandle() == 0)
{
if (n > 1)
if (n != 1)
{
return gl::error(GL_INVALID_OPERATION);
}
if (n == 1)
if (bufs[0] != GL_NONE && bufs[0] != GL_BACK)
{
if (bufs[0] != GL_NONE && bufs[0] != GL_BACK)
{
return gl::error(GL_INVALID_OPERATION);
}
return gl::error(GL_INVALID_OPERATION);
}
}
else
@@ -7008,6 +7005,11 @@ void __stdcall glDrawBuffersEXT(GLsizei n, const GLenum *bufs)
{
framebuffer->setDrawBufferState(colorAttachment, bufs[colorAttachment]);
}
for (int colorAttachment = n; colorAttachment < (int)context->getMaximumRenderTargets(); colorAttachment++)
{
framebuffer->setDrawBufferState(colorAttachment, GL_NONE);
}
}
}
catch (std::bad_alloc&)