Commit fdb400d7 by Olli Etuaho Committed by Commit Bot

Test multiview extension warning

Ensure that a warning is generated if the shader tries to set a global layout qualifier. Since a num_views layout qualifier is the only valid global layout qualifier in GLSL ES 1.00, it's sufficient that checkCanUseExtension() that generates the warning is called for "num_views" specifically. Parsing "layout" or "in" storage qualifier may use the simpler isExtensionEnabled() check that doesn't generate a warning. BUG=angleproject:2238 TEST=angle_unittests Change-Id: I19caff7be9cb4f53c581b5f5526b7cade08469d6 Reviewed-on: https://chromium-review.googlesource.com/803577Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarCorentin Wallez <cwallez@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
parent 3de2703d
...@@ -742,4 +742,30 @@ TEST_F(WEBGLMultiviewVertexShaderOutputCodeTest, GlLayerIsSet) ...@@ -742,4 +742,30 @@ TEST_F(WEBGLMultiviewVertexShaderOutputCodeTest, GlLayerIsSet)
EXPECT_TRUE(foundInCodeInOrder(SH_GLSL_COMPATIBILITY_OUTPUT, expectedStrings)); EXPECT_TRUE(foundInCodeInOrder(SH_GLSL_COMPATIBILITY_OUTPUT, expectedStrings));
} }
// Test that a warning is generated in an ESSL 1.00 shader when using a layout qualifier to set
// num_views and the extension is set to warn.
TEST_F(WEBGLMultiviewVertexShaderTest, WarnOnGlobalLayoutQualifier)
{
const std::string &shaderString =
R"(
#extension GL_OVR_multiview : warn
layout(num_views=2) in;
void main()
{
})";
if (compile(shaderString))
{
if (!hasWarning())
{
FAIL() << "Shader compilation succeeded without warnings, expecting warning:\n"
<< mInfoLog;
}
}
else
{
FAIL() << "Shader compilation failed, expecting success:\n" << mInfoLog;
}
}
} // namespace } // namespace
\ No newline at end of file
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