Commit 64a7244d by Geoff Lang

Only call glInvalidateFramebuffer if it is available.

BUG=angleproject:885 Change-Id: I30a9bcebc80805aea0c12d9c67194b7b0c98200f Reviewed-on: https://chromium-review.googlesource.com/263475Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarKenneth Russell <kbr@chromium.org> Tested-by: 's avatarGeoff Lang <geofflang@chromium.org>
parent 33d12cb9
...@@ -149,15 +149,25 @@ void FramebufferGL::setReadBuffer(GLenum buffer) ...@@ -149,15 +149,25 @@ void FramebufferGL::setReadBuffer(GLenum buffer)
gl::Error FramebufferGL::invalidate(size_t count, const GLenum *attachments) gl::Error FramebufferGL::invalidate(size_t count, const GLenum *attachments)
{ {
// Since this function is just a hint and not available until OpenGL 4.3, only call it if it is available.
if (mFunctions->invalidateFramebuffer)
{
mStateManager->bindFramebuffer(GL_FRAMEBUFFER, mFramebufferID); mStateManager->bindFramebuffer(GL_FRAMEBUFFER, mFramebufferID);
mFunctions->invalidateFramebuffer(GL_FRAMEBUFFER, count, attachments); mFunctions->invalidateFramebuffer(GL_FRAMEBUFFER, count, attachments);
}
return gl::Error(GL_NO_ERROR); return gl::Error(GL_NO_ERROR);
} }
gl::Error FramebufferGL::invalidateSub(size_t count, const GLenum *attachments, const gl::Rectangle &area) gl::Error FramebufferGL::invalidateSub(size_t count, const GLenum *attachments, const gl::Rectangle &area)
{ {
// Since this function is just a hint and not available until OpenGL 4.3, only call it if it is available.
if (mFunctions->invalidateSubFramebuffer)
{
mStateManager->bindFramebuffer(GL_FRAMEBUFFER, mFramebufferID); mStateManager->bindFramebuffer(GL_FRAMEBUFFER, mFramebufferID);
mFunctions->invalidateSubFramebuffer(GL_FRAMEBUFFER, count, attachments, area.x, area.y, area.width, area.height); mFunctions->invalidateSubFramebuffer(GL_FRAMEBUFFER, count, attachments, area.x, area.y, area.width, area.height);
}
return gl::Error(GL_NO_ERROR); return gl::Error(GL_NO_ERROR);
} }
......
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