| 1 |
#include <metal_stdlib> |
| 2 |
#include <simd/simd.h> |
| 3 |
|
| 4 |
using namespace metal; |
| 5 |
|
| 6 |
struct SSBO |
| 7 |
{ |
| 8 |
float4 ssbo; |
| 9 |
}; |
| 10 |
|
| 11 |
struct SSBOs |
| 12 |
{ |
| 13 |
float4 ssbo; |
| 14 |
}; |
| 15 |
|
| 16 |
struct Push |
| 17 |
{ |
| 18 |
float4 push; |
| 19 |
}; |
| 20 |
|
| 21 |
struct UBO |
| 22 |
{ |
| 23 |
float4 ubo; |
| 24 |
}; |
| 25 |
|
| 26 |
struct UBOs |
| 27 |
{ |
| 28 |
float4 ubo; |
| 29 |
}; |
| 30 |
|
| 31 |
struct spvDescriptorSetBuffer0 |
| 32 |
{ |
| 33 |
texture2d<float> uTexture [[id(0)]]; |
| 34 |
sampler uTextureSmplr [[id(1)]]; |
| 35 |
array<texture2d<float>, 2> uTextures [[id(2)]]; |
| 36 |
array<sampler, 2> uTexturesSmplr [[id(4)]]; |
| 37 |
constant UBO* m_90 [[id(6)]]; |
| 38 |
}; |
| 39 |
|
| 40 |
struct spvDescriptorSetBuffer1 |
| 41 |
{ |
| 42 |
array<texture2d<float>, 4> uTexture2 [[id(0)]]; |
| 43 |
array<sampler, 2> uSampler [[id(4)]]; |
| 44 |
device SSBO* m_60 [[id(6)]]; |
| 45 |
const device SSBOs* ssbos [[id(7)]][2]; |
| 46 |
}; |
| 47 |
|
| 48 |
struct spvDescriptorSetBuffer2 |
| 49 |
{ |
| 50 |
constant UBOs* ubos [[id(0)]][4]; |
| 51 |
}; |
| 52 |
|
| 53 |
struct main0_out |
| 54 |
{ |
| 55 |
float4 FragColor [[color(0)]]; |
| 56 |
}; |
| 57 |
|
| 58 |
struct main0_in |
| 59 |
{ |
| 60 |
float2 vUV [[user(locn0)]]; |
| 61 |
}; |
| 62 |
|
| 63 |
fragment main0_out main0(main0_in in [[stage_in]], constant spvDescriptorSetBuffer0& spvDescriptorSet0 [[buffer(0)]], constant spvDescriptorSetBuffer1& spvDescriptorSet1 [[buffer(1)]], constant spvDescriptorSetBuffer2& spvDescriptorSet2 [[buffer(2)]], constant Push& registers [[buffer(3)]]) |
| 64 |
{ |
| 65 |
main0_out out = {}; |
| 66 |
out.FragColor = ((((((spvDescriptorSet0.uTexture.sample(spvDescriptorSet0.uTextureSmplr, in.vUV) + spvDescriptorSet1.uTexture2[2].sample(spvDescriptorSet1.uSampler[1], in.vUV)) + spvDescriptorSet0.uTextures[1].sample(spvDescriptorSet0.uTexturesSmplr[1], in.vUV)) + (*spvDescriptorSet1.m_60).ssbo) + spvDescriptorSet1.ssbos[0]->ssbo) + registers.push) + (*spvDescriptorSet0.m_90).ubo) + spvDescriptorSet2.ubos[0]->ubo; |
| 67 |
out.FragColor += (*spvDescriptorSet0.m_90).ubo; |
| 68 |
out.FragColor += (*spvDescriptorSet1.m_60).ssbo; |
| 69 |
out.FragColor += spvDescriptorSet2.ubos[1]->ubo; |
| 70 |
out.FragColor += registers.push; |
| 71 |
return out; |
| 72 |
} |
| 73 |
|