| 1 |
#include <metal_stdlib> |
| 2 |
#include <simd/simd.h> |
| 3 |
|
| 4 |
using namespace metal; |
| 5 |
|
| 6 |
struct UBO |
| 7 |
{ |
| 8 |
float4 v[64]; |
| 9 |
}; |
| 10 |
|
| 11 |
struct SSBO |
| 12 |
{ |
| 13 |
float4 v[1]; |
| 14 |
}; |
| 15 |
|
| 16 |
struct main0_out |
| 17 |
{ |
| 18 |
float4 FragColor [[color(0)]]; |
| 19 |
}; |
| 20 |
|
| 21 |
struct main0_in |
| 22 |
{ |
| 23 |
int vIndex [[user(locn0)]]; |
| 24 |
float2 vUV [[user(locn1)]]; |
| 25 |
}; |
| 26 |
|
| 27 |
fragment 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 _25 = in.vIndex + 10; |
| 43 |
int _37 = in.vIndex + 40; |
| 44 |
out.FragColor = uSamplers[_25].sample(uSamps[_37], in.vUV); |
| 45 |
out.FragColor = uCombinedSamplers[_25].sample(uCombinedSamplersSmplr[_25], in.vUV); |
| 46 |
int _69 = in.vIndex + 20; |
| 47 |
out.FragColor += ubos[(_69)]->v[_37]; |
| 48 |
int _87 = in.vIndex + 50; |
| 49 |
int _91 = in.vIndex + 60; |
| 50 |
out.FragColor += ssbos[(_87)]->v[_91]; |
| 51 |
return out; |
| 52 |
} |
| 53 |
|