5f675be193
This does not give us 100% coverage of intrinsics yet, but it is a pretty good start. Change-Id: I97d49324db1afd9f2975c2eeafbacdead710d4aa Bug: skia:11054 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/341977 Commit-Queue: John Stiles <johnstiles@google.com> Auto-Submit: John Stiles <johnstiles@google.com> Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
19 lines
454 B
Metal
19 lines
454 B
Metal
#include <metal_stdlib>
|
|
#include <simd/simd.h>
|
|
using namespace metal;
|
|
struct Inputs {
|
|
float4 a;
|
|
float4 b;
|
|
};
|
|
struct Outputs {
|
|
float4 sk_FragColor [[color(0)]];
|
|
};
|
|
|
|
|
|
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
|
|
Outputs _outputStruct;
|
|
thread Outputs* _out = &_outputStruct;
|
|
_out->sk_FragColor.x = float((_in.a <= _in.b).x ? 1 : 0);
|
|
return *_out;
|
|
}
|