76c1ff1566
Previously, SkSL was unable to resolve the constant expression `x[y]` for a constant-array `x` and a constant-integer-scalar `y`. Now, if `x` and `y` are known, we can replace `x[y]` with the indexed array element. Note that we need to be careful here, as it's not a valid optimization to eliminate array elements that have side effects. We preserve side- effecting expressions using the comma operator. Change-Id: I5721337eb42b48c0b05f919c1cadfae19dd3b84f Bug: skia:12472 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/469839 Auto-Submit: John Stiles <johnstiles@google.com> Commit-Queue: John Stiles <johnstiles@google.com> Commit-Queue: Brian Osman <brianosman@google.com> Reviewed-by: Brian Osman <brianosman@google.com>
15 lines
379 B
Metal
15 lines
379 B
Metal
#include <metal_stdlib>
|
|
#include <simd/simd.h>
|
|
using namespace metal;
|
|
struct Inputs {
|
|
};
|
|
struct Outputs {
|
|
half4 sk_FragColor [[color(0)]];
|
|
};
|
|
fragment Outputs fragmentMain(Inputs _in [[stage_in]], bool _frontFacing [[front_facing]], float4 _fragCoord [[position]]) {
|
|
Outputs _out;
|
|
(void)_out;
|
|
_out.sk_FragColor = half4(0.0h, 1.0h, 0.0h, 1.0h);
|
|
return _out;
|
|
}
|