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)); ok = ok && ((float3x3(2) / 4) == float3x3(0.5)); 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)); ok = ok && (4 / (float2x2(2, 2, 2, 2)) == float2x2(2, 2, 2, 2)); 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)); ok = ok && ((half3x3(2) / 4) == half3x3(0.5)); 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)); ok = ok && (4 / (half2x2(2, 2, 2, 2)) == half2x2(2, 2, 2, 2)); return ok; } half4 main(float2 coords) { return test_float() && test_half() ? colorGreen : colorRed; }