skia2/tests/sksl/shared/NumberConversions.sksl

44 lines
1.1 KiB
Plaintext
Raw Normal View History

short s = short(sqrt(1));
int i = int(sqrt(1));
ushort us = ushort(sqrt(1));
uint ui = uint(sqrt(1));
half h = half(sqrt(1));
float f = sqrt(1);
short s2s = s;
short i2s = short(i);
short us2s = short(us);
short ui2s = short(ui);
short h2s = short(h);
short f2s = short(f);
int s2i = s;
int i2i = i;
int us2i = int(us);
int ui2i = int(ui);
int h2i = int(h);
int f2i = int(f);
ushort s2us = ushort(s);
ushort i2us = ushort(i);
ushort us2us = us;
ushort ui2us = ushort(ui);
ushort h2us = ushort(h);
ushort f2us = ushort(f);
uint s2ui = uint(s);
uint i2ui = uint(i);
uint us2ui = us;
uint ui2ui = ui;
uint h2ui = uint(h);
uint f2ui = uint(f);
float s2f = s;
float i2f = i;
float us2f = us;
float ui2f = ui;
float h2f = h;
float f2f = f;
void main() {
sk_FragColor.r = half(s + i + us + half(ui) + h + f + s2s + i2s + us2s + ui2s + h2s + f2s +
s2i + i2i + us2i + ui2i + h2i + f2i + s2us + i2us + us2us);
sk_FragColor.r += half(ui2us + h2us + f2us + half(s2ui) + half(i2ui) + half(us2ui) + half(ui2ui)
+ half(h2ui) + half(f2ui) + s2f + i2f + us2f + ui2f + h2f + f2f);
}