Add a test to expose location'ed varying link bug

Bug: angleproject:4355
Change-Id: I2b914d3e6bf74ccf5d3f42d7bd010e44e45645ea
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2023921
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
This commit is contained in:
Shahbaz Youssefi 2020-01-27 22:17:59 -05:00 коммит произвёл Commit Bot
Родитель f144b77bc8
Коммит 7488a09641
1 изменённых файлов: 28 добавлений и 0 удалений

Просмотреть файл

@ -6078,6 +6078,34 @@ void main()
ANGLE_GL_PROGRAM(program, kVS, kFS);
}
// Test that linking varyings by location works.
TEST_P(GLSLTest_ES31, LinkVaryingsByLocation)
{
// http://anglebug.com/4355
ANGLE_SKIP_TEST_IF(IsVulkan() || IsMetal() || IsD3D11());
constexpr char kVS[] = R"(#version 310 es
precision highp float;
in vec4 position;
layout(location = 1) out vec4 shaderOutput;
void main() {
gl_Position = position;
shaderOutput = vec4(0.0, 1.0, 0.0, 1.0);
})";
constexpr char kFS[] = R"(#version 310 es
precision highp float;
layout(location = 1) in vec4 shaderInput;
out vec4 outColor;
void main() {
outColor = shaderInput;
})";
ANGLE_GL_PROGRAM(program, kVS, kFS);
drawQuad(program, "position", 0.5f);
EXPECT_PIXEL_COLOR_EQ(0, 0, GLColor::green);
}
// Test nesting floor() calls with a large multiplier inside.
TEST_P(GLSLTest_ES3, NestedFloorWithLargeMultiplierInside)
{