Commit 3582c0e2 by Olli Etuaho Committed by Commit Bot

Add a test for redefining an unavailable built-in

This is going to guard against regressions when symbol table init is optimized. TEST=angle_unittests BUG=angleproject:2267 Change-Id: Iec7b9814f4af215dc0b3e8a39c8cfab004451836 Reviewed-on: https://chromium-review.googlesource.com/931883Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarCorentin Wallez <cwallez@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
parent 81aa15f1
......@@ -5738,3 +5738,24 @@ TEST_F(FragmentShaderValidationTest, RedeclaringBuiltIn)
FAIL() << "Shader compilation succeeded, expecting failure:\n" << mInfoLog;
}
}
// Redefining a built-in that is not available in the current shader stage is assumed to be not an
// error. Test with redefining groupMemoryBarrier() in fragment shader. The built-in
// groupMemoryBarrier() is only available in compute shaders.
TEST_F(FragmentShaderValidationTest, RedeclaringBuiltInFromAnotherShaderStage)
{
const std::string &shaderString =
R"(#version 310 es
precision mediump float;
out vec4 my_FragColor;
float groupMemoryBarrier() { return 1.0; }
void main()
{
my_FragColor = vec4(groupMemoryBarrier());
})";
if (!compile(shaderString))
{
FAIL() << "Shader compilation failed, expecting success:\n" << mInfoLog;
}
}
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