Commit 33f8e4d4 by Shahbaz Youssefi Committed by Commit Bot

Fix sub-invalidate of incomplete framebuffers

Just like invalidate, this should attempt to sync the framebuffer after nooping incomplete framebuffers. Bug: chromium:1119669 Change-Id: Ie4bc6211bbeb1765674f7e0aef884faf7ceb8cc7 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2375565Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
parent 09924221
...@@ -4222,9 +4222,6 @@ void Context::invalidateSubFramebuffer(GLenum target, ...@@ -4222,9 +4222,6 @@ void Context::invalidateSubFramebuffer(GLenum target,
GLsizei width, GLsizei width,
GLsizei height) GLsizei height)
{ {
// Only sync the FBO
ANGLE_CONTEXT_TRY(mState.syncDirtyObject(this, target));
Framebuffer *framebuffer = mState.getTargetFramebuffer(target); Framebuffer *framebuffer = mState.getTargetFramebuffer(target);
ASSERT(framebuffer); ASSERT(framebuffer);
...@@ -4234,6 +4231,8 @@ void Context::invalidateSubFramebuffer(GLenum target, ...@@ -4234,6 +4231,8 @@ void Context::invalidateSubFramebuffer(GLenum target,
} }
Rectangle area(x, y, width, height); Rectangle area(x, y, width, height);
// Only sync the FBO
ANGLE_CONTEXT_TRY(mState.syncDirtyObject(this, target));
ANGLE_CONTEXT_TRY(framebuffer->invalidateSub(this, numAttachments, attachments, area)); ANGLE_CONTEXT_TRY(framebuffer->invalidateSub(this, numAttachments, attachments, area));
} }
......
...@@ -406,6 +406,25 @@ TEST_P(FramebufferTest_ES3, InvalidateIncomplete) ...@@ -406,6 +406,25 @@ TEST_P(FramebufferTest_ES3, InvalidateIncomplete)
EXPECT_GL_NO_ERROR(); EXPECT_GL_NO_ERROR();
} }
// Covers sub-invalidating an incomplete framebuffer. This should be a no-op, but should not error.
TEST_P(FramebufferTest_ES3, SubInvalidateIncomplete)
{
GLFramebuffer framebuffer;
GLRenderbuffer renderbuffer;
glBindFramebuffer(GL_FRAMEBUFFER, framebuffer);
glBindRenderbuffer(GL_RENDERBUFFER, renderbuffer);
glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, renderbuffer);
EXPECT_GLENUM_EQ(GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT,
glCheckFramebufferStatus(GL_FRAMEBUFFER));
std::vector<GLenum> attachments;
attachments.push_back(GL_COLOR_ATTACHMENT0);
glInvalidateSubFramebuffer(GL_FRAMEBUFFER, 1, attachments.data(), 5, 5, 10, 10);
EXPECT_GL_NO_ERROR();
}
// Test that the framebuffer state tracking robustly handles a depth-only attachment being set // Test that the framebuffer state tracking robustly handles a depth-only attachment being set
// as a depth-stencil attachment. It is equivalent to detaching the depth-stencil attachment. // as a depth-stencil attachment. It is equivalent to detaching the depth-stencil attachment.
TEST_P(FramebufferTest_ES3, DepthOnlyAsDepthStencil) TEST_P(FramebufferTest_ES3, DepthOnlyAsDepthStencil)
......
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