skia2/tests/sksl/shared/GeometricIntrinsics.metal
John Stiles abc3b78011 Eliminate left-side comma expressions without side effects.
This takes away one of our gadgets for thwarting dead-code elimination
in unit tests, but it's the right thing to do. Comma expression left-
sides without side effects are clearly dead code.

Change-Id: Iaee490b4a742d06a0a0be94cddaa69a51543d8f5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/366719
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2021-02-05 16:50:33 +00:00

31 lines
791 B
Metal

#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
struct Uniforms {
float4 colorGreen;
};
struct Inputs {
};
struct Outputs {
float4 sk_FragColor [[color(0)]];
};
fragment Outputs fragmentMain(Inputs _in [[stage_in]], constant Uniforms& _uniforms [[buffer(0)]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
Outputs _out;
(void)_out;
float _1_x = 1.0;
_1_x = abs(1.0);
_1_x = abs(_1_x - 2.0);
_1_x = (_1_x * 2.0);
_1_x = sign(_1_x);
float2 _3_x = float2(1.0, 2.0);
_3_x = float2(length(float2(1.0, 2.0)));
_3_x = float2(distance(_3_x, float2(3.0, 4.0)));
_3_x = float2(dot(_3_x, float2(3.0, 4.0)));
_3_x = normalize(_3_x);
_out.sk_FragColor = _uniforms.colorGreen;
return _out;
}