Commit 00f43c91 by Jamie Madill Committed by Commit Bot

Vulkan: Suppress layer warnings about unbound outputs.

This warning could pop up whenever an OpenGL app would write to a particular output and not bind an attachment. This is valid in OpenGL. Also it could happen when writing to gl_FragData instead of gl_FragColor. Since it's hard to fix every usage we can just suppress the warning. Also adds a way to change test platform warnings into errors. Bug: angleproject:2866 Change-Id: I9793f58121ac848d74d6b0131e79ebab2c70f45c Reviewed-on: https://chromium-review.googlesource.com/c/1462057 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org>
parent 54ed8f0a
...@@ -103,9 +103,12 @@ bool ExtensionFound(const char *extensionName, ...@@ -103,9 +103,12 @@ bool ExtensionFound(const char *extensionName,
} }
// Array of Validation error/warning messages that will be ignored, should include bugID // Array of Validation error/warning messages that will be ignored, should include bugID
constexpr std::array<const char *, 1> kSkippedMessages = { constexpr const char *kSkippedMessages[] = {
// http://anglebug.com/2866
"UNASSIGNED-CoreValidation-Shader-OutputNotConsumed",
// http://anglebug.com/2796 // http://anglebug.com/2796
"UNASSIGNED-CoreValidation-Shader-PointSizeMissing"}; "UNASSIGNED-CoreValidation-Shader-PointSizeMissing",
};
// Suppress validation errors that are known // Suppress validation errors that are known
// return "true" if given code/prefix/message is known, else return "false" // return "true" if given code/prefix/message is known, else return "false"
......
...@@ -5116,6 +5116,19 @@ TEST_P(GLSLTest_ES3, InitSameNameArray) ...@@ -5116,6 +5116,19 @@ TEST_P(GLSLTest_ES3, InitSameNameArray)
EXPECT_PIXEL_COLOR_EQ(0, 0, GLColor::green); EXPECT_PIXEL_COLOR_EQ(0, 0, GLColor::green);
} }
// Tests using gl_FragData[0] instead of gl_FragColor.
TEST_P(GLSLTest, FragData)
{
// Ensures that we don't regress and emit Vulkan layer warnings.
treatPlatformWarningsAsErrors();
constexpr char kFS[] = R"(void main() { gl_FragData[0] = vec4(1, 0, 0, 1); })";
ANGLE_GL_PROGRAM(program, essl1_shaders::vs::Simple(), kFS);
drawQuad(program, essl1_shaders::PositionAttrib(), 0.5f);
EXPECT_GL_NO_ERROR();
EXPECT_PIXEL_COLOR_EQ(0, 0, GLColor::red);
}
// Use this to select which configurations (e.g. which renderer, which GLES major version) these // Use this to select which configurations (e.g. which renderer, which GLES major version) these
// tests should be run against. // tests should be run against.
ANGLE_INSTANTIATE_TEST(GLSLTest, ANGLE_INSTANTIATE_TEST(GLSLTest,
......
...@@ -63,7 +63,14 @@ void TestPlatform_logWarning(PlatformMethods *platform, const char *warningMessa ...@@ -63,7 +63,14 @@ void TestPlatform_logWarning(PlatformMethods *platform, const char *warningMessa
if (testPlatformContext->ignoreMessages) if (testPlatformContext->ignoreMessages)
return; return;
std::cerr << "Warning: " << warningMessage << std::endl; if (testPlatformContext->warningsAsErrors)
{
FAIL() << warningMessage;
}
else
{
std::cerr << "Warning: " << warningMessage << std::endl;
}
} }
void TestPlatform_logInfo(PlatformMethods *platform, const char *infoMessage) void TestPlatform_logInfo(PlatformMethods *platform, const char *infoMessage)
...@@ -374,8 +381,9 @@ ANGLETestBase::~ANGLETestBase() ...@@ -374,8 +381,9 @@ ANGLETestBase::~ANGLETestBase()
void ANGLETestBase::ANGLETestSetUp() void ANGLETestBase::ANGLETestSetUp()
{ {
mPlatformContext.ignoreMessages = false; mPlatformContext.ignoreMessages = false;
mPlatformContext.currentTest = this; mPlatformContext.warningsAsErrors = false;
mPlatformContext.currentTest = this;
// Resize the window before creating the context so that the first make current // Resize the window before creating the context so that the first make current
// sets the viewport and scissor box to the right size. // sets the viewport and scissor box to the right size.
...@@ -1252,6 +1260,11 @@ void ANGLETestBase::ignoreD3D11SDKLayersWarnings() ...@@ -1252,6 +1260,11 @@ void ANGLETestBase::ignoreD3D11SDKLayersWarnings()
mIgnoreD3D11SDKLayersWarnings = true; mIgnoreD3D11SDKLayersWarnings = true;
} }
void ANGLETestBase::treatPlatformWarningsAsErrors()
{
mPlatformContext.warningsAsErrors = true;
}
ANGLETestBase::ScopedIgnorePlatformMessages::ScopedIgnorePlatformMessages(ANGLETestBase *test) ANGLETestBase::ScopedIgnorePlatformMessages::ScopedIgnorePlatformMessages(ANGLETestBase *test)
: mTest(test) : mTest(test)
{ {
......
...@@ -245,6 +245,7 @@ class WGLWindow; ...@@ -245,6 +245,7 @@ class WGLWindow;
struct TestPlatformContext final : private angle::NonCopyable struct TestPlatformContext final : private angle::NonCopyable
{ {
bool ignoreMessages = false; bool ignoreMessages = false;
bool warningsAsErrors = false;
ANGLETestBase *currentTest = nullptr; ANGLETestBase *currentTest = nullptr;
}; };
...@@ -369,6 +370,9 @@ class ANGLETestBase ...@@ -369,6 +370,9 @@ class ANGLETestBase
void ignoreD3D11SDKLayersWarnings(); void ignoreD3D11SDKLayersWarnings();
// Allows a test to be more restrictive about platform warnings.
void treatPlatformWarningsAsErrors();
static OSWindow *GetOSWindow() { return mOSWindow; } static OSWindow *GetOSWindow() { return mOSWindow; }
GLuint get2DTexturedQuadProgram(); GLuint get2DTexturedQuadProgram();
......
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