Commit 2d5da029 by Jamie Madill Committed by Commit Bot

Minor angle_end2end_tests cleanups.

Minor refactoring and call consolidation. Was done while working on deferring clears in the Vulkan back-end. Bug: angleproject:4517 Change-Id: I60d80d4f9646c990c4cb8bbc349fc0051389bf02 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2151171 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarYuly Novikov <ynovikov@chromium.org>
parent dc3477f3
...@@ -409,10 +409,10 @@ TEST_P(BlitFramebufferANGLETest, BlitColorToDefault) ...@@ -409,10 +409,10 @@ TEST_P(BlitFramebufferANGLETest, BlitColorToDefault)
glBindFramebuffer(GL_FRAMEBUFFER, mOriginalFBO); glBindFramebuffer(GL_FRAMEBUFFER, mOriginalFBO);
EXPECT_PIXEL_EQ(getWindowWidth() / 4, getWindowHeight() / 4, 255, 0, 0, 255); EXPECT_PIXEL_COLOR_EQ(getWindowWidth() / 4, getWindowHeight() / 4, GLColor::red);
EXPECT_PIXEL_EQ(3 * getWindowWidth() / 4, getWindowHeight() / 4, 0, 255, 0, 255); EXPECT_PIXEL_COLOR_EQ(3 * getWindowWidth() / 4, getWindowHeight() / 4, GLColor::green);
EXPECT_PIXEL_EQ(3 * getWindowWidth() / 4, 3 * getWindowHeight() / 4, 255, 0, 0, 255); EXPECT_PIXEL_COLOR_EQ(3 * getWindowWidth() / 4, 3 * getWindowHeight() / 4, GLColor::red);
EXPECT_PIXEL_EQ(getWindowWidth() / 4, 3 * getWindowHeight() / 4, 0, 255, 0, 255); EXPECT_PIXEL_COLOR_EQ(getWindowWidth() / 4, 3 * getWindowHeight() / 4, GLColor::green);
} }
// Draw to system framebuffer, blit whole-buffer color to user-created framebuffer. // Draw to system framebuffer, blit whole-buffer color to user-created framebuffer.
...@@ -633,10 +633,10 @@ TEST_P(BlitFramebufferANGLETest, BlitWithDepthUserToDefault) ...@@ -633,10 +633,10 @@ TEST_P(BlitFramebufferANGLETest, BlitWithDepthUserToDefault)
glDisable(GL_DEPTH_TEST); glDisable(GL_DEPTH_TEST);
EXPECT_PIXEL_EQ(getWindowWidth() / 4, getWindowHeight() / 4, 255, 0, 0, 255); EXPECT_PIXEL_COLOR_EQ(getWindowWidth() / 4, getWindowHeight() / 4, GLColor::red);
EXPECT_PIXEL_EQ(3 * getWindowWidth() / 4, getWindowHeight() / 4, 255, 0, 0, 255); EXPECT_PIXEL_COLOR_EQ(3 * getWindowWidth() / 4, getWindowHeight() / 4, GLColor::red);
EXPECT_PIXEL_EQ(3 * getWindowWidth() / 4, 3 * getWindowHeight() / 4, 0, 0, 255, 255); EXPECT_PIXEL_COLOR_EQ(3 * getWindowWidth() / 4, 3 * getWindowHeight() / 4, GLColor::blue);
EXPECT_PIXEL_EQ(getWindowWidth() / 4, 3 * getWindowHeight() / 4, 0, 0, 255, 255); EXPECT_PIXEL_COLOR_EQ(getWindowWidth() / 4, 3 * getWindowHeight() / 4, GLColor::blue);
} }
// blit from system FBO to user-created framebuffer, with depth buffer. // blit from system FBO to user-created framebuffer, with depth buffer.
...@@ -754,10 +754,10 @@ TEST_P(BlitFramebufferANGLETest, BlitPartialColor) ...@@ -754,10 +754,10 @@ TEST_P(BlitFramebufferANGLETest, BlitPartialColor)
glBindFramebuffer(GL_FRAMEBUFFER, mOriginalFBO); glBindFramebuffer(GL_FRAMEBUFFER, mOriginalFBO);
EXPECT_PIXEL_EQ(getWindowWidth() / 4, getWindowHeight() / 4, 255, 255, 255, 255); EXPECT_PIXEL_COLOR_EQ(getWindowWidth() / 4, getWindowHeight() / 4, GLColor::white);
EXPECT_PIXEL_EQ(3 * getWindowWidth() / 4, getWindowHeight() / 4, 255, 255, 255, 255); EXPECT_PIXEL_COLOR_EQ(3 * getWindowWidth() / 4, getWindowHeight() / 4, GLColor::white);
EXPECT_PIXEL_EQ(3 * getWindowWidth() / 4, 3 * getWindowHeight() / 4, 255, 255, 255, 255); EXPECT_PIXEL_COLOR_EQ(3 * getWindowWidth() / 4, 3 * getWindowHeight() / 4, GLColor::white);
EXPECT_PIXEL_EQ(getWindowWidth() / 4, 3 * getWindowHeight() / 4, 255, 0, 0, 255); EXPECT_PIXEL_COLOR_EQ(getWindowWidth() / 4, 3 * getWindowHeight() / 4, GLColor::red);
} }
TEST_P(BlitFramebufferANGLETest, BlitDifferentSizes) TEST_P(BlitFramebufferANGLETest, BlitDifferentSizes)
...@@ -831,15 +831,14 @@ TEST_P(BlitFramebufferANGLETest, BlitStencil) ...@@ -831,15 +831,14 @@ TEST_P(BlitFramebufferANGLETest, BlitStencil)
{ {
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled("GL_ANGLE_framebuffer_blit")); ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled("GL_ANGLE_framebuffer_blit"));
// TODO(jmadill): Figure out if we can fix this on D3D9. // http://anglebug.com/2205
// https://code.google.com/p/angleproject/issues/detail?id=2205
ANGLE_SKIP_TEST_IF(IsIntel() && IsD3D9()); ANGLE_SKIP_TEST_IF(IsIntel() && IsD3D9());
glBindFramebuffer(GL_FRAMEBUFFER, mUserFBO); glBindFramebuffer(GL_FRAMEBUFFER, mUserFBO);
glClearColor(0.0, 1.0, 0.0, 1.0); glClearColor(0.0, 1.0, 0.0, 1.0);
glClear(GL_COLOR_BUFFER_BIT | GL_STENCIL_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glClearStencil(0x0); glClearStencil(0x0);
glClear(GL_COLOR_BUFFER_BIT | GL_STENCIL_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
// Scissor half the screen so we fill the stencil only halfway // Scissor half the screen so we fill the stencil only halfway
glScissor(0, 0, getWindowWidth(), getWindowHeight() / 2); glScissor(0, 0, getWindowWidth(), getWindowHeight() / 2);
......
...@@ -215,7 +215,7 @@ class MaskedScissoredClearTestBase ...@@ -215,7 +215,7 @@ class MaskedScissoredClearTestBase
setConfigStencilBits(8); setConfigStencilBits(8);
} }
void MaskedScissoredColorDepthStencilClear( void maskedScissoredColorDepthStencilClear(
const MaskedScissoredClearVariationsTestParams &params); const MaskedScissoredClearVariationsTestParams &params);
bool mHasDepth = true; bool mHasDepth = true;
...@@ -1268,7 +1268,7 @@ TEST_P(ClearTestES3, RepeatedClear) ...@@ -1268,7 +1268,7 @@ TEST_P(ClearTestES3, RepeatedClear)
ASSERT_GL_NO_ERROR(); ASSERT_GL_NO_ERROR();
} }
void MaskedScissoredClearTestBase::MaskedScissoredColorDepthStencilClear( void MaskedScissoredClearTestBase::maskedScissoredColorDepthStencilClear(
const MaskedScissoredClearVariationsTestParams &params) const MaskedScissoredClearVariationsTestParams &params)
{ {
// Flaky on Android Nexus 5x and Pixel 2, possible Qualcomm driver bug. // Flaky on Android Nexus 5x and Pixel 2, possible Qualcomm driver bug.
...@@ -1449,7 +1449,7 @@ void MaskedScissoredClearTestBase::MaskedScissoredColorDepthStencilClear( ...@@ -1449,7 +1449,7 @@ void MaskedScissoredClearTestBase::MaskedScissoredColorDepthStencilClear(
// Tests combinations of color, depth, stencil clears with or without masks or scissor. // Tests combinations of color, depth, stencil clears with or without masks or scissor.
TEST_P(MaskedScissoredClearTest, Test) TEST_P(MaskedScissoredClearTest, Test)
{ {
MaskedScissoredColorDepthStencilClear(GetParam()); maskedScissoredColorDepthStencilClear(GetParam());
} }
// Tests combinations of color, depth, stencil clears with or without masks or scissor. // Tests combinations of color, depth, stencil clears with or without masks or scissor.
...@@ -1483,7 +1483,7 @@ TEST_P(VulkanClearTest, Test) ...@@ -1483,7 +1483,7 @@ TEST_P(VulkanClearTest, Test)
bindColorStencilFBO(); bindColorStencilFBO();
} }
MaskedScissoredColorDepthStencilClear(GetParam()); maskedScissoredColorDepthStencilClear(GetParam());
} }
// Test that just clearing a nonexistent drawbuffer of the default framebuffer doesn't cause an // Test that just clearing a nonexistent drawbuffer of the default framebuffer doesn't cause an
......
...@@ -372,7 +372,7 @@ TEST_P(SimpleOperationTest, DrawLine) ...@@ -372,7 +372,7 @@ TEST_P(SimpleOperationTest, DrawLine)
ASSERT_GL_NO_ERROR(); ASSERT_GL_NO_ERROR();
for (auto x = 0; x < getWindowWidth(); x++) for (int x = 0; x < getWindowWidth(); x++)
{ {
EXPECT_PIXEL_COLOR_EQ(x, x, GLColor::green); EXPECT_PIXEL_COLOR_EQ(x, x, GLColor::green);
} }
......
...@@ -730,29 +730,26 @@ TEST_P(StateChangeRenderTest, RecreateRenderbuffer) ...@@ -730,29 +730,26 @@ TEST_P(StateChangeRenderTest, RecreateRenderbuffer)
glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, mRenderbuffer); glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, mRenderbuffer);
// Explictly check FBO status sync in some versions of ANGLE no_error skips FBO checks. // Explictly check FBO status sync in some versions of ANGLE no_error skips FBO checks.
ASSERT_GLENUM_EQ(GL_FRAMEBUFFER_COMPLETE, glCheckFramebufferStatus(GL_FRAMEBUFFER)); ASSERT_GL_FRAMEBUFFER_COMPLETE(GL_FRAMEBUFFER);
// Draw with red to the FBO. // Draw with red to the FBO.
GLColor red(255, 0, 0, 255); setUniformColor(GLColor::red);
setUniformColor(red);
drawQuad(mProgram, "position", 0.5f); drawQuad(mProgram, "position", 0.5f);
EXPECT_PIXEL_COLOR_EQ(0, 0, red); EXPECT_PIXEL_COLOR_EQ(0, 0, GLColor::red);
// Recreate the renderbuffer and clear to green. // Recreate the renderbuffer and clear to green.
glRenderbufferStorage(GL_RENDERBUFFER, GL_RGBA8, 32, 32); glRenderbufferStorage(GL_RENDERBUFFER, GL_RGBA8, 32, 32);
glClearColor(0.0f, 1.0f, 0.0f, 1.0f); glClearColor(0.0f, 1.0f, 0.0f, 1.0f);
glClear(GL_COLOR_BUFFER_BIT); glClear(GL_COLOR_BUFFER_BIT);
GLColor green(0, 255, 0, 255); EXPECT_PIXEL_COLOR_EQ(0, 0, GLColor::green);
EXPECT_PIXEL_COLOR_EQ(0, 0, green);
// Explictly check FBO status sync in some versions of ANGLE no_error skips FBO checks. // Explictly check FBO status sync in some versions of ANGLE no_error skips FBO checks.
ASSERT_GLENUM_EQ(GL_FRAMEBUFFER_COMPLETE, glCheckFramebufferStatus(GL_FRAMEBUFFER)); ASSERT_GL_FRAMEBUFFER_COMPLETE(GL_FRAMEBUFFER);
// Verify drawing blue gives blue. This covers the FBO sync with D3D dirty bits. // Verify drawing blue gives blue. This covers the FBO sync with D3D dirty bits.
GLColor blue(0, 0, 255, 255); setUniformColor(GLColor::blue);
setUniformColor(blue);
drawQuad(mProgram, "position", 0.5f); drawQuad(mProgram, "position", 0.5f);
EXPECT_PIXEL_COLOR_EQ(0, 0, blue); EXPECT_PIXEL_COLOR_EQ(0, 0, GLColor::blue);
EXPECT_GL_NO_ERROR(); EXPECT_GL_NO_ERROR();
} }
......
...@@ -4380,13 +4380,13 @@ TEST_P(WebGLCompatibilityTest, DrawBuffers) ...@@ -4380,13 +4380,13 @@ TEST_P(WebGLCompatibilityTest, DrawBuffers)
GLFramebuffer readFBO; GLFramebuffer readFBO;
glBindFramebuffer(GL_FRAMEBUFFER, readFBO); glBindFramebuffer(GL_FRAMEBUFFER, readFBO);
for (int i = 0; i < 4; ++i) for (int attachmentIndex = 0; attachmentIndex < 4; ++attachmentIndex)
{ {
if (mask & (1 << i)) if (mask & (1 << attachmentIndex))
{ {
glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER,
renderbuffers[i]); renderbuffers[attachmentIndex]);
EXPECT_PIXEL_COLOR_EQ(0, 0, color); EXPECT_PIXEL_COLOR_EQ(0, 0, color) << "attachment " << attachmentIndex;
} }
} }
ASSERT_GL_NO_ERROR(); ASSERT_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