skia2/tests/sksl/shared/golden/NegatedVectorLiteral.metal
John Stiles cf27b4f744 Improve constant folding for int vectors.
This implements constant folding optimizations on int vectors
(== != + - * /) that were previously only supported on float vectors.

Bug: skia:10908
Change-Id: Ibf61ab43eb7ae2ce8e99cce21cc55777359817e5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/332424
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2020-11-06 17:22:34 +00:00

28 lines
676 B
Metal

#include <metal_stdlib>
#include <simd/simd.h>
using namespace metal;
struct Inputs {
};
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 = 1.0;
_out->sk_FragColor.y = 1.0;
_out->sk_FragColor.z = 1.0;
_out->sk_FragColor.w = 1.0;
}
{
_out->sk_FragColor.x = 1.0;
_out->sk_FragColor.y = 1.0;
_out->sk_FragColor.z = 1.0;
_out->sk_FragColor.w = 1.0;
}
return *_out;
}