712fd6bbb9
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>
38 lines
645 B
GLSL
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);
|
|
}
|
|
}
|