Commit 8f8edd6e by Jeff Gilbert Committed by Commit Bot

attachmentsHaveSameDimensions should not compare depths.

From: https://bugzilla.mozilla.org/show_bug.cgi?id=1372083 BUG=angleproject:2210 TEST=angle_end2end_tests Change-Id: I00539fb7e0bc9a21f90f5c87d7082c2a6b1ed907 Reviewed-on: https://chromium-review.googlesource.com/747814Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
parent cda6af19
...@@ -433,7 +433,9 @@ bool FramebufferState::attachmentsHaveSameDimensions() const ...@@ -433,7 +433,9 @@ bool FramebufferState::attachmentsHaveSameDimensions() const
return false; return false;
} }
return (attachment.getSize() != attachmentSize.value()); const auto &prevSize = attachmentSize.value();
const auto &curSize = attachment.getSize();
return (curSize.width != prevSize.width || curSize.height != prevSize.height);
}; };
for (const auto &attachment : mColorAttachments) for (const auto &attachment : mColorAttachments)
......
...@@ -517,6 +517,25 @@ TEST_P(FramebufferTest_ES3, MultisampleDepthOnly) ...@@ -517,6 +517,25 @@ TEST_P(FramebufferTest_ES3, MultisampleDepthOnly)
EXPECT_GE(samples, 2); EXPECT_GE(samples, 2);
} }
// Check that we only compare width and height of attachments, not depth.
TEST_P(FramebufferTest_ES3, AttachmentWith3DLayers)
{
GLTexture texA;
glBindTexture(GL_TEXTURE_2D, texA);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, 4, 4, 0, GL_RGBA, GL_UNSIGNED_BYTE, nullptr);
GLTexture texB;
glBindTexture(GL_TEXTURE_3D, texB);
glTexImage3D(GL_TEXTURE_3D, 0, GL_RGBA8, 4, 4, 2, 0, GL_RGBA, GL_UNSIGNED_BYTE, nullptr);
GLFramebuffer framebuffer;
glBindFramebuffer(GL_FRAMEBUFFER, framebuffer);
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texA, 0);
glFramebufferTextureLayer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT1, texB, 0, 0);
ASSERT_GLENUM_EQ(GL_FRAMEBUFFER_COMPLETE, glCheckFramebufferStatus(GL_FRAMEBUFFER));
EXPECT_GL_NO_ERROR();
}
ANGLE_INSTANTIATE_TEST(FramebufferTest_ES3, ES3_D3D11(), ES3_OPENGL(), ES3_OPENGLES()); ANGLE_INSTANTIATE_TEST(FramebufferTest_ES3, ES3_D3D11(), ES3_OPENGL(), ES3_OPENGLES());
class FramebufferTest_ES31 : public ANGLETest class FramebufferTest_ES31 : public ANGLETest
......
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