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
...@@ -675,7 +694,7 @@ TEST_P(FramebufferTest_ES31, RenderingLimitToDefaultFBOSizeWithNoAttachments) ...@@ -675,7 +694,7 @@ TEST_P(FramebufferTest_ES31, RenderingLimitToDefaultFBOSizeWithNoAttachments)
"in layout(location = 0) highp vec2 a_position;\n\n" "in layout(location = 0) highp vec2 a_position;\n\n"
"void main()\n" "void main()\n"
"{\n" "{\n"
" gl_Position = vec4(a_position, 0.0, 1.0);\n" " gl_Position = vec4(a_position, 0.0, 1.0);\n"
"}\n"; "}\n";
const std::string &fragShader = const std::string &fragShader =
"#version 310 es\n" "#version 310 es\n"
...@@ -683,8 +702,8 @@ TEST_P(FramebufferTest_ES31, RenderingLimitToDefaultFBOSizeWithNoAttachments) ...@@ -683,8 +702,8 @@ TEST_P(FramebufferTest_ES31, RenderingLimitToDefaultFBOSizeWithNoAttachments)
"out layout(location = 0) mediump vec4 f_color;\n\n" "out layout(location = 0) mediump vec4 f_color;\n\n"
"void main()\n" "void main()\n"
"{\n" "{\n"
" if (ivec2(gl_FragCoord.xy) != u_expectedSize) discard;\n" " if (ivec2(gl_FragCoord.xy) != u_expectedSize) discard;\n"
" f_color = vec4(1.0, 0.5, 0.25, 1.0);\n" " f_color = vec4(1.0, 0.5, 0.25, 1.0);\n"
"}\n"; "}\n";
GLuint program = CompileProgram(vertexShader, fragShader); GLuint program = CompileProgram(vertexShader, fragShader);
......
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