xref: /aosp_15_r20/external/skia/tests/sksl/shared/SwizzleScalarBool.metal (revision c8dee2aa9b3f27cf6c858bd81872bdeb2c07ed17)
1#include <metal_stdlib>
2#include <simd/simd.h>
3#ifdef __clang__
4#pragma clang diagnostic ignored "-Wall"
5#endif
6using namespace metal;
7struct Uniforms {
8    half unknownInput;
9};
10struct Inputs {
11};
12struct Outputs {
13    half4 sk_FragColor [[color(0)]];
14};
15fragment Outputs fragmentMain(Inputs _in [[stage_in]], constant Uniforms& _uniforms [[buffer(0)]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
16    Outputs _out;
17    (void)_out;
18    bool b = bool(_uniforms.unknownInput);
19    bool4 b4 = bool4(b);
20    b4 = bool4(bool2(b), false, true);
21    b4 = bool4(false, b, true, false);
22    b4 = bool4(false, b, false, b);
23    _out.sk_FragColor = half4(b4);
24    return _out;
25}
26