| 1 |
#include <metal_stdlib> |
| 2 |
#include <simd/simd.h> |
| 3 |
|
| 4 |
using namespace metal; |
| 5 |
|
| 6 |
struct UBO |
| 7 |
{ |
| 8 |
float4 v; |
| 9 |
}; |
| 10 |
|
| 11 |
struct spvDescriptorSetBuffer0 |
| 12 |
{ |
| 13 |
array<texture2d<float>, 10000> uSamplers [[id(0)]]; |
| 14 |
array<sampler, 10000> uSamplersSmplr [[id(10000)]]; |
| 15 |
}; |
| 16 |
|
| 17 |
struct spvDescriptorSetBuffer1 |
| 18 |
{ |
| 19 |
constant UBO* vs [[id(0)]][10000]; |
| 20 |
}; |
| 21 |
|
| 22 |
struct spvDescriptorSetBuffer2 |
| 23 |
{ |
| 24 |
texture2d<float> uSampler [[id(0)]]; |
| 25 |
sampler uSamplerSmplr [[id(1)]]; |
| 26 |
}; |
| 27 |
|
| 28 |
struct main0_out |
| 29 |
{ |
| 30 |
float4 FragColor [[color(0)]]; |
| 31 |
}; |
| 32 |
|
| 33 |
struct main0_in |
| 34 |
{ |
| 35 |
float2 vUV [[user(locn0)]]; |
| 36 |
}; |
| 37 |
|
| 38 |
fragment main0_out main0(main0_in in [[stage_in]], const device spvDescriptorSetBuffer0& spvDescriptorSet0 [[buffer(0)]], const device spvDescriptorSetBuffer1& spvDescriptorSet1 [[buffer(1)]], constant spvDescriptorSetBuffer2& spvDescriptorSet2 [[buffer(2)]]) |
| 39 |
{ |
| 40 |
main0_out out = {}; |
| 41 |
out.FragColor = (spvDescriptorSet0.uSamplers[9999].sample(spvDescriptorSet0.uSamplersSmplr[9999], in.vUV) + spvDescriptorSet1.vs[5000]->v) + spvDescriptorSet2.uSampler.sample(spvDescriptorSet2.uSamplerSmplr, in.vUV); |
| 42 |
return out; |
| 43 |
} |
| 44 |
|