aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quick/scenegraph/rendernode/metalshader.frag
blob: 907faa537fe7ea11ceb015a738ed00fb5609b179 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include <metal_stdlib>
#include <simd/simd.h>

using namespace metal;

struct buf
{
    float4x4 matrix;
    float opacity;
};

struct main0_out
{
    float4 fragColor [[color(0)]];
};

struct main0_in
{
    float4 v_color [[user(locn0)]];
};

fragment main0_out main0(main0_in in [[stage_in]], constant buf& ubuf [[buffer(0)]])
{
    main0_out out = {};
    out.fragColor = in.v_color * ubuf.opacity;
    return out;
}