2021-05-12 21:12:21 +00:00
|
|
|
uniform half4 colorGreen, colorRed;
|
|
|
|
|
|
|
|
bool test_float() {
|
|
|
|
bool ok = true;
|
|
|
|
|
|
|
|
ok = ok && ((float3x3(2) + 4) == float3x3(6, 4, 4, 4, 6, 4, 4, 4, 6));
|
|
|
|
ok = ok && ((float3x3(2) - 4) == float3x3(-2, -4, -4, -4, -2, -4, -4, -4, -2));
|
|
|
|
ok = ok && ((float3x3(2) * 4) == float3x3(8));
|
2021-05-13 18:01:48 +00:00
|
|
|
ok = ok && ((float3x3(2) / 4) == float3x3(0.5));
|
2021-05-12 21:12:21 +00:00
|
|
|
|
|
|
|
ok = ok && (4 + (float3x3(2)) == float3x3(6, 4, 4, 4, 6, 4, 4, 4, 6));
|
|
|
|
ok = ok && (4 - (float3x3(2)) == float3x3(2, 4, 4, 4, 2, 4, 4, 4, 2));
|
|
|
|
ok = ok && (4 * (float3x3(2)) == float3x3(8));
|
2021-05-13 18:01:48 +00:00
|
|
|
ok = ok && (4 / (float2x2(2, 2, 2, 2)) == float2x2(2, 2, 2, 2));
|
2021-05-12 21:12:21 +00:00
|
|
|
|
|
|
|
return ok;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool test_half() {
|
|
|
|
bool ok = true;
|
|
|
|
|
|
|
|
ok = ok && ((half3x3(2) + 4) == half3x3(6, 4, 4, 4, 6, 4, 4, 4, 6));
|
|
|
|
ok = ok && ((half3x3(2) - 4) == half3x3(-2, -4, -4, -4, -2, -4, -4, -4, -2));
|
|
|
|
ok = ok && ((half3x3(2) * 4) == half3x3(8));
|
2021-05-13 18:01:48 +00:00
|
|
|
ok = ok && ((half3x3(2) / 4) == half3x3(0.5));
|
2021-05-12 21:12:21 +00:00
|
|
|
|
|
|
|
ok = ok && (4 + (half3x3(2)) == half3x3(6, 4, 4, 4, 6, 4, 4, 4, 6));
|
|
|
|
ok = ok && (4 - (half3x3(2)) == half3x3(2, 4, 4, 4, 2, 4, 4, 4, 2));
|
|
|
|
ok = ok && (4 * (half3x3(2)) == half3x3(8));
|
2021-05-13 18:01:48 +00:00
|
|
|
ok = ok && (4 / (half2x2(2, 2, 2, 2)) == half2x2(2, 2, 2, 2));
|
2021-05-12 21:12:21 +00:00
|
|
|
|
|
|
|
return ok;
|
|
|
|
}
|
|
|
|
|
|
|
|
half4 main(float2 coords) {
|
|
|
|
return test_float() && test_half() ? colorGreen : colorRed;
|
|
|
|
}
|