Commit 120b13f8 by Jamie Madill Committed by Commit Bot

Add more draw buffer related tests.

Some of these are targeting our workaround for a mac bug. The bug was that the driver was somehow modifying output attachments that the program wasn't writing to. A new test shows a bug where we wouldn't re-sync the state properly after a clear. Also adds more pretty printing for GLColor. Bug: angleproject:2872 Change-Id: I5485893b5f1b269c5407678db27978a789f7acc6 Reviewed-on: https://chromium-review.googlesource.com/c/1269255 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarShahbaz Youssefi <syoussefi@chromium.org>
parent e7ece9e2
......@@ -91,6 +91,55 @@ std::array<angle::Vector3, 4> GetIndexedQuadVertices()
static constexpr std::array<GLushort, 6> IndexedQuadIndices = {{0, 1, 2, 0, 2, 3}};
const char *GetColorName(GLColor color)
{
if (color == GLColor::red)
{
return "Red";
}
if (color == GLColor::green)
{
return "Green";
}
if (color == GLColor::blue)
{
return "Blue";
}
if (color == GLColor::white)
{
return "White";
}
if (color == GLColor::black)
{
return "Black";
}
if (color == GLColor::transparentBlack)
{
return "Transparent Black";
}
if (color == GLColor::yellow)
{
return "Yellow";
}
if (color == GLColor::magenta)
{
return "Magenta";
}
if (color == GLColor::cyan)
{
return "Cyan";
}
return nullptr;
}
} // anonymous namespace
GLColorRGB::GLColorRGB() : R(0), G(0), B(0)
......@@ -177,6 +226,12 @@ bool operator!=(const GLColor &a, const GLColor &b)
std::ostream &operator<<(std::ostream &ostream, const GLColor &color)
{
const char *colorName = GetColorName(color);
if (colorName)
{
return ostream << colorName;
}
ostream << "(" << static_cast<unsigned int>(color.R) << ", "
<< static_cast<unsigned int>(color.G) << ", " << static_cast<unsigned int>(color.B)
<< ", " << static_cast<unsigned int>(color.A) << ")";
......
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