Commit e765e215 by Olli Etuaho Committed by Commit Bot

Test that ESSL 300 standard derivatives compile successfully

These functions have the same name in the ESSL 100 extension, creating a possibility for conflicts. This adds a convenient way to test for regressions when refactoring the symbol table. BUG=angleproject:2267 TEST=angle_unittests Change-Id: I9716524a0ea85064ba5f3ee8e7adfbdfc59d257e Reviewed-on: https://chromium-review.googlesource.com/945989Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarCorentin Wallez <cwallez@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
parent 437664b4
...@@ -5759,3 +5759,26 @@ TEST_F(FragmentShaderValidationTest, RedeclaringBuiltInFromAnotherShaderStage) ...@@ -5759,3 +5759,26 @@ TEST_F(FragmentShaderValidationTest, RedeclaringBuiltInFromAnotherShaderStage)
FAIL() << "Shader compilation failed, expecting success:\n" << mInfoLog; FAIL() << "Shader compilation failed, expecting success:\n" << mInfoLog;
} }
} }
// Test that standard derivative functions that are in core ESSL 3.00 compile successfully.
TEST_F(FragmentShaderValidationTest, ESSL300StandardDerivatives)
{
const std::string &shaderString =
R"(#version 300 es
precision mediump float;
in vec4 iv;
out vec4 my_FragColor;
void main()
{
vec4 v4 = vec4(0.0);
v4 += fwidth(iv);
v4 += dFdx(iv);
v4 += dFdy(iv);
my_FragColor = v4;
})";
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