Clear must ignore buffers that are not present.

TRAC #12643 IDirect3DDevice9::Clear will fail if asked to clear a buffer that is not present, so we have to be careful what we pass to it. Signed-off-by: Shannon Woods Signed-off-by: Daniel Koch Author: Andrew Lewycky git-svn-id: https://angleproject.googlecode.com/svn/trunk@341 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent 4c03fa69
...@@ -2283,13 +2283,17 @@ void Context::clear(GLbitfield mask) ...@@ -2283,13 +2283,17 @@ void Context::clear(GLbitfield mask)
if (mask & GL_COLOR_BUFFER_BIT) if (mask & GL_COLOR_BUFFER_BIT)
{ {
mask &= ~GL_COLOR_BUFFER_BIT; mask &= ~GL_COLOR_BUFFER_BIT;
flags |= D3DCLEAR_TARGET;
if (framebufferObject->getColorbufferType() != GL_NONE)
{
flags |= D3DCLEAR_TARGET;
}
} }
if (mask & GL_DEPTH_BUFFER_BIT) if (mask & GL_DEPTH_BUFFER_BIT)
{ {
mask &= ~GL_DEPTH_BUFFER_BIT; mask &= ~GL_DEPTH_BUFFER_BIT;
if (mState.depthMask) if (mState.depthMask && framebufferObject->getDepthbufferType() != GL_NONE)
{ {
flags |= D3DCLEAR_ZBUFFER; flags |= D3DCLEAR_ZBUFFER;
} }
......
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