2020-09-26 03:51:39 +00:00
|
|
|
|
2020-09-28 16:28:16 +00:00
|
|
|
out vec4 sk_FragColor;
|
2021-02-04 19:50:03 +00:00
|
|
|
uniform vec4 colorGreen;
|
|
|
|
uniform vec4 colorRed;
|
|
|
|
uniform vec4 colorWhite;
|
2021-03-17 17:20:10 +00:00
|
|
|
void out_half(out float v) {
|
|
|
|
v = colorWhite.x;
|
|
|
|
}
|
|
|
|
void out_half2(out vec2 v) {
|
|
|
|
v = vec2(colorWhite.y);
|
|
|
|
}
|
|
|
|
void out_half3(out vec3 v) {
|
|
|
|
v = vec3(colorWhite.z);
|
|
|
|
}
|
|
|
|
void out_half4(out vec4 v) {
|
|
|
|
v = vec4(colorWhite.w);
|
|
|
|
}
|
|
|
|
void out_half2x2(out mat2 v) {
|
|
|
|
v = mat2(colorWhite.x);
|
|
|
|
}
|
|
|
|
void out_half3x3(out mat3 v) {
|
|
|
|
v = mat3(colorWhite.y);
|
|
|
|
}
|
|
|
|
void out_half4x4(out mat4 v) {
|
|
|
|
v = mat4(colorWhite.z);
|
|
|
|
}
|
|
|
|
void out_int(out int v) {
|
|
|
|
v = int(colorWhite.x);
|
|
|
|
}
|
|
|
|
void out_int2(out ivec2 v) {
|
|
|
|
v = ivec2(int(colorWhite.y));
|
|
|
|
}
|
|
|
|
void out_int3(out ivec3 v) {
|
|
|
|
v = ivec3(int(colorWhite.z));
|
|
|
|
}
|
|
|
|
void out_int4(out ivec4 v) {
|
|
|
|
v = ivec4(int(colorWhite.w));
|
|
|
|
}
|
|
|
|
void out_float(out float v) {
|
|
|
|
v = colorWhite.x;
|
|
|
|
}
|
|
|
|
void out_float2(out vec2 v) {
|
|
|
|
v = vec2(colorWhite.y);
|
|
|
|
}
|
|
|
|
void out_float3(out vec3 v) {
|
|
|
|
v = vec3(colorWhite.z);
|
|
|
|
}
|
|
|
|
void out_float4(out vec4 v) {
|
|
|
|
v = vec4(colorWhite.w);
|
|
|
|
}
|
|
|
|
void out_float2x2(out mat2 v) {
|
|
|
|
v = mat2(colorWhite.x);
|
|
|
|
}
|
|
|
|
void out_float3x3(out mat3 v) {
|
|
|
|
v = mat3(colorWhite.y);
|
|
|
|
}
|
|
|
|
void out_float4x4(out mat4 v) {
|
|
|
|
v = mat4(colorWhite.z);
|
|
|
|
}
|
|
|
|
void out_bool(out bool v) {
|
|
|
|
v = bool(colorWhite.x);
|
|
|
|
}
|
|
|
|
void out_bool2(out bvec2 v) {
|
|
|
|
v = bvec2(bool(colorWhite.y));
|
|
|
|
}
|
|
|
|
void out_bool3(out bvec3 v) {
|
|
|
|
v = bvec3(bool(colorWhite.z));
|
|
|
|
}
|
|
|
|
void out_bool4(out bvec4 v) {
|
|
|
|
v = bvec4(bool(colorWhite.w));
|
|
|
|
}
|
2021-02-04 19:50:03 +00:00
|
|
|
vec4 main() {
|
|
|
|
float h;
|
2021-03-17 17:20:10 +00:00
|
|
|
out_half(h);
|
2021-02-04 19:50:03 +00:00
|
|
|
vec2 h2;
|
2021-03-17 17:20:10 +00:00
|
|
|
out_half2(h2);
|
2020-09-28 16:28:16 +00:00
|
|
|
vec3 h3;
|
2021-03-17 17:20:10 +00:00
|
|
|
out_half3(h3);
|
2020-09-28 16:28:16 +00:00
|
|
|
vec4 h4;
|
2021-03-17 17:20:10 +00:00
|
|
|
out_half4(h4);
|
|
|
|
out_half(h3.y);
|
|
|
|
out_half2(h3.xz);
|
|
|
|
out_half4(h4.zwxy);
|
2020-12-04 20:36:49 +00:00
|
|
|
mat2 h2x2;
|
2021-03-17 17:20:10 +00:00
|
|
|
out_half2x2(h2x2);
|
2020-09-28 16:28:16 +00:00
|
|
|
mat3 h3x3;
|
2021-03-17 17:20:10 +00:00
|
|
|
out_half3x3(h3x3);
|
2020-09-28 16:28:16 +00:00
|
|
|
mat4 h4x4;
|
2021-03-17 17:20:10 +00:00
|
|
|
out_half4x4(h4x4);
|
|
|
|
out_half3(h3x3[1]);
|
|
|
|
out_half(h4x4[3].w);
|
|
|
|
out_half(h2x2[0].x);
|
2021-02-04 19:50:03 +00:00
|
|
|
int i;
|
2021-03-17 17:20:10 +00:00
|
|
|
out_int(i);
|
2020-12-04 20:36:49 +00:00
|
|
|
ivec2 i2;
|
2021-03-17 17:20:10 +00:00
|
|
|
out_int2(i2);
|
2021-02-04 19:50:03 +00:00
|
|
|
ivec3 i3;
|
2021-03-17 17:20:10 +00:00
|
|
|
out_int3(i3);
|
2020-09-28 16:28:16 +00:00
|
|
|
ivec4 i4;
|
2021-03-17 17:20:10 +00:00
|
|
|
out_int4(i4);
|
|
|
|
out_int3(i4.xyz);
|
|
|
|
out_int(i2.y);
|
2021-02-04 19:50:03 +00:00
|
|
|
float f;
|
2021-03-17 17:20:10 +00:00
|
|
|
out_float(f);
|
2020-12-04 20:36:49 +00:00
|
|
|
vec2 f2;
|
2021-03-17 17:20:10 +00:00
|
|
|
out_float2(f2);
|
2020-09-28 16:28:16 +00:00
|
|
|
vec3 f3;
|
2021-03-17 17:20:10 +00:00
|
|
|
out_float3(f3);
|
2021-02-04 19:50:03 +00:00
|
|
|
vec4 f4;
|
2021-03-17 17:20:10 +00:00
|
|
|
out_float4(f4);
|
|
|
|
out_float2(f3.xy);
|
|
|
|
out_float(f2.x);
|
2020-09-28 16:28:16 +00:00
|
|
|
mat2 f2x2;
|
2021-03-17 17:20:10 +00:00
|
|
|
out_float2x2(f2x2);
|
2021-02-04 19:50:03 +00:00
|
|
|
mat3 f3x3;
|
2021-03-17 17:20:10 +00:00
|
|
|
out_float3x3(f3x3);
|
2021-02-04 19:50:03 +00:00
|
|
|
mat4 f4x4;
|
2021-03-17 17:20:10 +00:00
|
|
|
out_float4x4(f4x4);
|
|
|
|
out_float(f2x2[0].x);
|
2021-02-04 19:50:03 +00:00
|
|
|
bool b;
|
2021-03-17 17:20:10 +00:00
|
|
|
out_bool(b);
|
2021-02-04 19:50:03 +00:00
|
|
|
bvec2 b2;
|
2021-03-17 17:20:10 +00:00
|
|
|
out_bool2(b2);
|
2020-12-04 20:36:49 +00:00
|
|
|
bvec3 b3;
|
2021-03-17 17:20:10 +00:00
|
|
|
out_bool3(b3);
|
2020-09-28 16:28:16 +00:00
|
|
|
bvec4 b4;
|
2021-03-17 17:20:10 +00:00
|
|
|
out_bool4(b4);
|
|
|
|
out_bool2(b4.xw);
|
|
|
|
out_bool(b3.z);
|
2021-02-04 19:50:03 +00:00
|
|
|
bool ok = true;
|
2021-03-08 18:29:15 +00:00
|
|
|
ok = ok && 1.0 == (((((h * h2.x) * h3.x) * h4.x) * h2x2[0].x) * h3x3[0].x) * h4x4[0].x;
|
2021-02-04 19:50:03 +00:00
|
|
|
ok = ok && 1.0 == (((((f * f2.x) * f3.x) * f4.x) * f2x2[0].x) * f3x3[0].x) * f4x4[0].x;
|
|
|
|
ok = ok && 1 == ((i * i2.x) * i3.x) * i4.x;
|
|
|
|
ok = ok && (((b && b2.x) && b3.x) && b4.x);
|
|
|
|
return ok ? colorGreen : colorRed;
|
2020-09-28 16:28:16 +00:00
|
|
|
}
|