2018-02-02 09:10:17 +00:00
|
|
|
#include <metal_stdlib>
|
|
|
|
#include <simd/simd.h>
|
|
|
|
|
|
|
|
using namespace metal;
|
|
|
|
|
|
|
|
struct Foo
|
|
|
|
{
|
|
|
|
float a;
|
|
|
|
float b;
|
|
|
|
};
|
|
|
|
|
2018-09-10 08:04:17 +00:00
|
|
|
constant float _16[4] = { 1.0, 4.0, 3.0, 2.0 };
|
|
|
|
constant Foo _28[2] = { Foo{ 10.0, 20.0 }, Foo{ 30.0, 40.0 } };
|
2018-02-08 12:06:29 +00:00
|
|
|
|
2018-06-12 15:41:35 +00:00
|
|
|
struct main0_out
|
2018-02-02 09:10:17 +00:00
|
|
|
{
|
2018-06-12 15:41:35 +00:00
|
|
|
float4 FragColor [[color(0)]];
|
2018-02-02 09:10:17 +00:00
|
|
|
};
|
|
|
|
|
2018-06-12 15:41:35 +00:00
|
|
|
struct main0_in
|
2018-02-02 09:10:17 +00:00
|
|
|
{
|
2018-06-12 15:41:35 +00:00
|
|
|
int line [[user(locn0)]];
|
2018-02-02 09:10:17 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
fragment main0_out main0(main0_in in [[stage_in]])
|
|
|
|
{
|
|
|
|
main0_out out = {};
|
2018-09-27 09:10:22 +00:00
|
|
|
out.FragColor = float4(_16[in.line]);
|
2019-01-10 08:49:33 +00:00
|
|
|
out.FragColor += float4(_28[in.line].a * _28[1 - in.line].a);
|
2018-02-02 09:10:17 +00:00
|
|
|
return out;
|
|
|
|
}
|
|
|
|
|