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
parent a2ed3988
......@@ -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&)
......
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