skia2/tests/sksl/shared/golden/Enum.glsl
John Stiles 712fd6bbb9 Add support for enums in Metal code generator.
Enums are an SkSL-only concept--when we output code, we emit plain
IntLiterals--so the fix is simply to ignore the Enum program element
when we encounter it. This is what GLSLCodeGen does as well.

Also added a unit test to confirm that enums work normally, and that
enums are subject to optimization and static-comparison checks just as
ints would be.

Change-Id: Ic4f8da7a27983add9eb41b936d46f6638d22bd4b
Bug: skia:11003
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/338800
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-11-30 15:14:34 +00:00

38 lines
645 B
GLSL

out vec4 sk_FragColor;
void main() {
{
sk_FragColor = vec4(1.0);
}
{
sk_FragColor = vec4(2.0);
}
{
sk_FragColor = vec4(6.0);
}
sk_FragColor = vec4(7.0);
sk_FragColor = vec4(-8.0);
sk_FragColor = vec4(-9.0);
sk_FragColor = vec4(10.0);
{
sk_FragColor = vec4(11.0);
}
{
sk_FragColor = vec4(13.0);
}
{
sk_FragColor = vec4(15.0);
}
{
sk_FragColor = vec4(16.0);
}
{
sk_FragColor = vec4(18.0);
}
sk_FragColor = vec4(19.0);
sk_FragColor = vec4(20.0);
{
sk_FragColor = vec4(21.0);
}
}