• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#include <metal_stdlib>
2#include <simd/simd.h>
3
4using namespace metal;
5
6struct UBO
7{
8    float4 v[64];
9};
10
11struct SSBO
12{
13    float4 v[1];
14};
15
16struct main0_out
17{
18    float4 FragColor [[color(0)]];
19};
20
21struct main0_in
22{
23    int vIndex [[user(locn0)]];
24    float2 vUV [[user(locn1)]];
25};
26
27fragment main0_out main0(main0_in in [[stage_in]], constant UBO* ubos_0 [[buffer(0)]], constant UBO* ubos_1 [[buffer(1)]], const device SSBO* ssbos_0 [[buffer(2)]], const device SSBO* ssbos_1 [[buffer(3)]], array<texture2d<float>, 8> uSamplers [[texture(0)]], array<texture2d<float>, 8> uCombinedSamplers [[texture(8)]], array<sampler, 7> uSamps [[sampler(0)]], array<sampler, 8> uCombinedSamplersSmplr [[sampler(7)]])
28{
29    constant UBO* ubos[] =
30    {
31        ubos_0,
32        ubos_1,
33    };
34
35    const device SSBO* ssbos[] =
36    {
37        ssbos_0,
38        ssbos_1,
39    };
40
41    main0_out out = {};
42    int i = in.vIndex;
43    int _25 = i + 10;
44    int _37 = i + 40;
45    out.FragColor = uSamplers[_25].sample(uSamps[_37], in.vUV);
46    int _53 = i + 10;
47    out.FragColor = uCombinedSamplers[_53].sample(uCombinedSamplersSmplr[_53], in.vUV);
48    int _69 = i + 20;
49    int _73 = i + 40;
50    out.FragColor += ubos[_69]->v[_73];
51    int _87 = i + 50;
52    int _91 = i + 60;
53    out.FragColor += ssbos[_87]->v[_91];
54    return out;
55}
56
57