2021-03-17 15:16:41 +00:00
|
|
|
|
|
|
|
out vec4 sk_FragColor;
|
|
|
|
uniform vec4 colorGreen;
|
|
|
|
uniform vec4 colorRed;
|
|
|
|
uniform vec4 colorWhite;
|
2021-03-22 15:43:11 +00:00
|
|
|
void out_half_vh(out float v) {
|
2021-03-17 15:16:41 +00:00
|
|
|
v = colorWhite.x;
|
|
|
|
}
|
2021-03-22 15:43:11 +00:00
|
|
|
void out_half2_vh2(out vec2 v) {
|
2021-03-17 15:16:41 +00:00
|
|
|
v = vec2(colorWhite.y);
|
|
|
|
}
|
2021-03-22 15:43:11 +00:00
|
|
|
void out_half3_vh3(out vec3 v) {
|
2021-03-17 15:16:41 +00:00
|
|
|
v = vec3(colorWhite.z);
|
|
|
|
}
|
2021-03-22 15:43:11 +00:00
|
|
|
void out_half4_vh4(out vec4 v) {
|
2021-03-17 15:16:41 +00:00
|
|
|
v = vec4(colorWhite.w);
|
|
|
|
}
|
2021-03-22 15:43:11 +00:00
|
|
|
void out_half2x2_vh22(out mat2 v) {
|
2021-03-17 15:16:41 +00:00
|
|
|
v = mat2(colorWhite.x);
|
|
|
|
}
|
2021-03-22 15:43:11 +00:00
|
|
|
void out_half3x3_vh33(out mat3 v) {
|
2021-03-17 15:16:41 +00:00
|
|
|
v = mat3(colorWhite.y);
|
|
|
|
}
|
2021-03-22 15:43:11 +00:00
|
|
|
void out_half4x4_vh44(out mat4 v) {
|
2021-03-17 15:16:41 +00:00
|
|
|
v = mat4(colorWhite.z);
|
|
|
|
}
|
2021-03-22 15:43:11 +00:00
|
|
|
void out_int_vi(out int v) {
|
2021-03-17 15:16:41 +00:00
|
|
|
v = int(colorWhite.x);
|
|
|
|
}
|
2021-03-22 15:43:11 +00:00
|
|
|
void out_int2_vi2(out ivec2 v) {
|
2021-03-17 15:16:41 +00:00
|
|
|
v = ivec2(int(colorWhite.y));
|
|
|
|
}
|
2021-03-22 15:43:11 +00:00
|
|
|
void out_int3_vi3(out ivec3 v) {
|
2021-03-17 15:16:41 +00:00
|
|
|
v = ivec3(int(colorWhite.z));
|
|
|
|
}
|
2021-03-22 15:43:11 +00:00
|
|
|
void out_int4_vi4(out ivec4 v) {
|
2021-03-17 15:16:41 +00:00
|
|
|
v = ivec4(int(colorWhite.w));
|
|
|
|
}
|
2021-03-22 15:43:11 +00:00
|
|
|
void out_float_vf(out float v) {
|
2021-03-17 15:16:41 +00:00
|
|
|
v = colorWhite.x;
|
|
|
|
}
|
2021-03-22 15:43:11 +00:00
|
|
|
void out_float2_vf2(out vec2 v) {
|
2021-03-17 15:16:41 +00:00
|
|
|
v = vec2(colorWhite.y);
|
|
|
|
}
|
2021-03-22 15:43:11 +00:00
|
|
|
void out_float3_vf3(out vec3 v) {
|
2021-03-17 15:16:41 +00:00
|
|
|
v = vec3(colorWhite.z);
|
|
|
|
}
|
2021-03-22 15:43:11 +00:00
|
|
|
void out_float4_vf4(out vec4 v) {
|
2021-03-17 15:16:41 +00:00
|
|
|
v = vec4(colorWhite.w);
|
|
|
|
}
|
2021-03-22 15:43:11 +00:00
|
|
|
void out_float2x2_vf22(out mat2 v) {
|
2021-03-17 15:16:41 +00:00
|
|
|
v = mat2(colorWhite.x);
|
|
|
|
}
|
2021-03-22 15:43:11 +00:00
|
|
|
void out_float3x3_vf33(out mat3 v) {
|
2021-03-17 15:16:41 +00:00
|
|
|
v = mat3(colorWhite.y);
|
|
|
|
}
|
2021-03-22 15:43:11 +00:00
|
|
|
void out_float4x4_vf44(out mat4 v) {
|
2021-03-17 15:16:41 +00:00
|
|
|
v = mat4(colorWhite.z);
|
|
|
|
}
|
2021-03-22 15:43:11 +00:00
|
|
|
void out_bool_vb(out bool v) {
|
2021-03-17 15:16:41 +00:00
|
|
|
v = bool(colorWhite.x);
|
|
|
|
}
|
2021-03-22 15:43:11 +00:00
|
|
|
void out_bool2_vb2(out bvec2 v) {
|
2021-03-17 15:16:41 +00:00
|
|
|
v = bvec2(bool(colorWhite.y));
|
|
|
|
}
|
2021-03-22 15:43:11 +00:00
|
|
|
void out_bool3_vb3(out bvec3 v) {
|
2021-03-17 15:16:41 +00:00
|
|
|
v = bvec3(bool(colorWhite.z));
|
|
|
|
}
|
2021-03-22 15:43:11 +00:00
|
|
|
void out_bool4_vb4(out bvec4 v) {
|
2021-03-17 15:16:41 +00:00
|
|
|
v = bvec4(bool(colorWhite.w));
|
|
|
|
}
|
|
|
|
vec4 main() {
|
|
|
|
float h;
|
2021-03-22 15:43:11 +00:00
|
|
|
out_half_vh(h);
|
2021-03-17 15:16:41 +00:00
|
|
|
vec2 h2;
|
2021-03-22 15:43:11 +00:00
|
|
|
out_half2_vh2(h2);
|
2021-03-17 15:16:41 +00:00
|
|
|
vec3 h3;
|
2021-03-22 15:43:11 +00:00
|
|
|
out_half3_vh3(h3);
|
2021-03-17 15:16:41 +00:00
|
|
|
vec4 h4;
|
2021-03-22 15:43:11 +00:00
|
|
|
out_half4_vh4(h4);
|
|
|
|
out_half_vh(h3.y);
|
|
|
|
out_half2_vh2(h3.xz);
|
|
|
|
out_half4_vh4(h4.zwxy);
|
2021-03-17 15:16:41 +00:00
|
|
|
mat2 h2x2;
|
2021-03-22 15:43:11 +00:00
|
|
|
out_half2x2_vh22(h2x2);
|
2021-03-17 15:16:41 +00:00
|
|
|
mat3 h3x3;
|
2021-03-22 15:43:11 +00:00
|
|
|
out_half3x3_vh33(h3x3);
|
2021-03-17 15:16:41 +00:00
|
|
|
mat4 h4x4;
|
2021-03-22 15:43:11 +00:00
|
|
|
out_half4x4_vh44(h4x4);
|
|
|
|
out_half3_vh3(h3x3[1]);
|
|
|
|
out_half_vh(h4x4[3].w);
|
|
|
|
out_half_vh(h2x2[0].x);
|
2021-03-17 15:16:41 +00:00
|
|
|
int i;
|
2021-03-22 15:43:11 +00:00
|
|
|
out_int_vi(i);
|
2021-03-17 15:16:41 +00:00
|
|
|
ivec2 i2;
|
2021-03-22 15:43:11 +00:00
|
|
|
out_int2_vi2(i2);
|
2021-03-17 15:16:41 +00:00
|
|
|
ivec3 i3;
|
2021-03-22 15:43:11 +00:00
|
|
|
out_int3_vi3(i3);
|
2021-03-17 15:16:41 +00:00
|
|
|
ivec4 i4;
|
2021-03-22 15:43:11 +00:00
|
|
|
out_int4_vi4(i4);
|
|
|
|
out_int3_vi3(i4.xyz);
|
|
|
|
out_int_vi(i2.y);
|
2021-03-17 15:16:41 +00:00
|
|
|
float f;
|
2021-03-22 15:43:11 +00:00
|
|
|
out_float_vf(f);
|
2021-03-17 15:16:41 +00:00
|
|
|
vec2 f2;
|
2021-03-22 15:43:11 +00:00
|
|
|
out_float2_vf2(f2);
|
2021-03-17 15:16:41 +00:00
|
|
|
vec3 f3;
|
2021-03-22 15:43:11 +00:00
|
|
|
out_float3_vf3(f3);
|
2021-03-17 15:16:41 +00:00
|
|
|
vec4 f4;
|
2021-03-22 15:43:11 +00:00
|
|
|
out_float4_vf4(f4);
|
|
|
|
out_float2_vf2(f3.xy);
|
|
|
|
out_float_vf(f2.x);
|
2021-03-17 15:16:41 +00:00
|
|
|
mat2 f2x2;
|
2021-03-22 15:43:11 +00:00
|
|
|
out_float2x2_vf22(f2x2);
|
2021-03-17 15:16:41 +00:00
|
|
|
mat3 f3x3;
|
2021-03-22 15:43:11 +00:00
|
|
|
out_float3x3_vf33(f3x3);
|
2021-03-17 15:16:41 +00:00
|
|
|
mat4 f4x4;
|
2021-03-22 15:43:11 +00:00
|
|
|
out_float4x4_vf44(f4x4);
|
|
|
|
out_float_vf(f2x2[0].x);
|
2021-03-17 15:16:41 +00:00
|
|
|
bool b;
|
2021-03-22 15:43:11 +00:00
|
|
|
out_bool_vb(b);
|
2021-03-17 15:16:41 +00:00
|
|
|
bvec2 b2;
|
2021-03-22 15:43:11 +00:00
|
|
|
out_bool2_vb2(b2);
|
2021-03-17 15:16:41 +00:00
|
|
|
bvec3 b3;
|
2021-03-22 15:43:11 +00:00
|
|
|
out_bool3_vb3(b3);
|
2021-03-17 15:16:41 +00:00
|
|
|
bvec4 b4;
|
2021-03-22 15:43:11 +00:00
|
|
|
out_bool4_vb4(b4);
|
|
|
|
out_bool2_vb2(b4.xw);
|
|
|
|
out_bool_vb(b3.z);
|
2021-03-17 15:16:41 +00:00
|
|
|
bool ok = true;
|
|
|
|
ok = ok && 1.0 == (((((h * h2.x) * h3.x) * h4.x) * h2x2[0].x) * h3x3[0].x) * h4x4[0].x;
|
|
|
|
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;
|
|
|
|
}
|