Commit 9a47fe71 by Shahbaz Youssefi Committed by Commit Bot

Use 4 colors in Checkered test shader

This shader previously output red and green in a checkered pattern (with four regions). This makes it hard to verify that the output is not rotated / flipped. This change makes the shader output: +--------+--------+ | red | blue | +--------+--------+ | green | yellow | +--------+--------+ Bug: angleproject:4901 Change-Id: I02723306dec17d1419f11d9f76e96b1cefc3bf06 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2498261Reviewed-by: 's avatarIan Elliott <ianelliott@google.com> Reviewed-by: 's avatarShahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
parent 98c5ff6b
...@@ -405,13 +405,29 @@ varying vec4 v_position; ...@@ -405,13 +405,29 @@ varying vec4 v_position;
void main() void main()
{ {
if (v_position.x * v_position.y > 0.0) bool isLeft = v_position.x < 0.0;
bool isTop = v_position.y < 0.0;
if (isLeft)
{ {
gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0); if (isTop)
{
gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
}
else
{
gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);
}
} }
else else
{ {
gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0); if (isTop)
{
gl_FragColor = vec4(0.0, 0.0, 1.0, 1.0);
}
else
{
gl_FragColor = vec4(1.0, 1.0, 0.0, 1.0);
}
} }
})"; })";
} }
......
...@@ -79,8 +79,13 @@ ANGLE_UTIL_EXPORT const char *Texture2D(); ...@@ -79,8 +79,13 @@ ANGLE_UTIL_EXPORT const char *Texture2D();
namespace fs namespace fs
{ {
// A shader that renders a simple checker pattern of red and green. X axis and y axis separate the // A shader that renders a simple checker pattern of red, green and blue. X axis and Y axis separate
// different colors. Needs varying v_position. // the different colors. Needs varying v_position.
//
// - X < 0 && y < 0: Red
// - X < 0 && y >= 0: Green
// - X >= 0 && y < 0: Blue
// - X >= 0 && y >= 0: Yellow
ANGLE_UTIL_EXPORT const char *Checkered(); ANGLE_UTIL_EXPORT const char *Checkered();
// A shader that fills with color taken from uniform named "color". // A shader that fills with color taken from uniform named "color".
......
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