| 1 |
#include <metal_stdlib> |
| 2 |
#include <simd/simd.h> |
| 3 |
|
| 4 |
using namespace metal; |
| 5 |
|
| 6 |
typedef packed_float2 packed_float2x2[2]; |
| 7 |
typedef packed_float3 packed_float2x3[2]; |
| 8 |
typedef packed_float3 packed_rm_float3x2[2]; |
| 9 |
|
| 10 |
struct S0 |
| 11 |
{ |
| 12 |
packed_float2 a[1]; |
| 13 |
float b; |
| 14 |
}; |
| 15 |
|
| 16 |
struct S1 |
| 17 |
{ |
| 18 |
packed_float3 a; |
| 19 |
float b; |
| 20 |
}; |
| 21 |
|
| 22 |
struct S2 |
| 23 |
{ |
| 24 |
packed_float3 a[1]; |
| 25 |
float b; |
| 26 |
}; |
| 27 |
|
| 28 |
struct S3 |
| 29 |
{ |
| 30 |
packed_float2 a; |
| 31 |
float b; |
| 32 |
}; |
| 33 |
|
| 34 |
struct Content |
| 35 |
{ |
| 36 |
S0 m0s[1]; |
| 37 |
S1 m1s[1]; |
| 38 |
S2 m2s[1]; |
| 39 |
S0 m0; |
| 40 |
S1 m1; |
| 41 |
S2 m2; |
| 42 |
S3 m3; |
| 43 |
float m4; |
| 44 |
}; |
| 45 |
|
| 46 |
struct SSBO1 |
| 47 |
{ |
| 48 |
Content content; |
| 49 |
Content content1[2]; |
| 50 |
Content content2; |
| 51 |
float2x2 m0; |
| 52 |
float2x2 m1; |
| 53 |
packed_float2x3 m2[4]; |
| 54 |
float3x2 m3; |
| 55 |
float2x2 m4; |
| 56 |
float2x2 m5[9]; |
| 57 |
float3x2 m6[4][2]; |
| 58 |
packed_rm_float3x2 m7; |
| 59 |
float array[1]; |
| 60 |
}; |
| 61 |
|
| 62 |
struct S0_1 |
| 63 |
{ |
| 64 |
float2 a[1]; |
| 65 |
char _m1_pad[8]; |
| 66 |
float b; |
| 67 |
char _m0_final_padding[12]; |
| 68 |
}; |
| 69 |
|
| 70 |
struct S1_1 |
| 71 |
{ |
| 72 |
packed_float3 a; |
| 73 |
float b; |
| 74 |
}; |
| 75 |
|
| 76 |
struct S2_1 |
| 77 |
{ |
| 78 |
float3 a[1]; |
| 79 |
float b; |
| 80 |
char _m0_final_padding[12]; |
| 81 |
}; |
| 82 |
|
| 83 |
struct S3_1 |
| 84 |
{ |
| 85 |
float2 a; |
| 86 |
float b; |
| 87 |
}; |
| 88 |
|
| 89 |
struct Content_1 |
| 90 |
{ |
| 91 |
S0_1 m0s[1]; |
| 92 |
S1_1 m1s[1]; |
| 93 |
S2_1 m2s[1]; |
| 94 |
S0_1 m0; |
| 95 |
S1_1 m1; |
| 96 |
S2_1 m2; |
| 97 |
S3_1 m3; |
| 98 |
float m4; |
| 99 |
char _m0_final_padding[12]; |
| 100 |
}; |
| 101 |
|
| 102 |
struct SSBO0 |
| 103 |
{ |
| 104 |
Content_1 content; |
| 105 |
Content_1 content1[2]; |
| 106 |
Content_1 content2; |
| 107 |
float2x4 m0; |
| 108 |
float2x4 m1; |
| 109 |
float2x3 m2[4]; |
| 110 |
float3x4 m3; |
| 111 |
float2x4 m4; |
| 112 |
float2x4 m5[9]; |
| 113 |
float3x4 m6[4][2]; |
| 114 |
float2x3 m7; |
| 115 |
float4 array[1]; |
| 116 |
}; |
| 117 |
|
| 118 |
struct SSBO2 |
| 119 |
{ |
| 120 |
float m0; |
| 121 |
packed_float2x2 m1; |
| 122 |
packed_rm_float3x2 m2; |
| 123 |
}; |
| 124 |
|
| 125 |
constant uint3 gl_WorkGroupSize [[maybe_unused]] = uint3(1u); |
| 126 |
|
| 127 |
kernel void main0(device SSBO1& ssbo_scalar [[buffer(0)]], device SSBO0& ssbo_140 [[buffer(1)]], device SSBO2& ssbo_scalar2 [[buffer(2)]]) |
| 128 |
{ |
| 129 |
ssbo_scalar.content.m0s[0].a[0] = ssbo_140.content.m0s[0].a[0]; |
| 130 |
ssbo_scalar.content.m0s[0].b = ssbo_140.content.m0s[0].b; |
| 131 |
ssbo_scalar.content.m1s[0].a = float3(ssbo_140.content.m1s[0].a); |
| 132 |
ssbo_scalar.content.m1s[0].b = ssbo_140.content.m1s[0].b; |
| 133 |
ssbo_scalar.content.m2s[0].a[0] = ssbo_140.content.m2s[0].a[0]; |
| 134 |
ssbo_scalar.content.m2s[0].b = ssbo_140.content.m2s[0].b; |
| 135 |
ssbo_scalar.content.m0.a[0] = ssbo_140.content.m0.a[0]; |
| 136 |
ssbo_scalar.content.m0.b = ssbo_140.content.m0.b; |
| 137 |
ssbo_scalar.content.m1.a = float3(ssbo_140.content.m1.a); |
| 138 |
ssbo_scalar.content.m1.b = ssbo_140.content.m1.b; |
| 139 |
ssbo_scalar.content.m2.a[0] = ssbo_140.content.m2.a[0]; |
| 140 |
ssbo_scalar.content.m2.b = ssbo_140.content.m2.b; |
| 141 |
ssbo_scalar.content.m3.a = ssbo_140.content.m3.a; |
| 142 |
ssbo_scalar.content.m3.b = ssbo_140.content.m3.b; |
| 143 |
ssbo_scalar.content.m4 = ssbo_140.content.m4; |
| 144 |
ssbo_scalar.content.m1.a = float2x3(float3(ssbo_scalar.m2[1][0]), float3(ssbo_scalar.m2[1][1])) * float2(ssbo_scalar.content.m0.a[0]); |
| 145 |
ssbo_scalar.m0 = float2x2(float2(ssbo_scalar2.m1[0]), float2(ssbo_scalar2.m1[1])); |
| 146 |
ssbo_scalar2.m1[0] = float2(ssbo_scalar.m4[0][0], ssbo_scalar.m4[1][0]); |
| 147 |
ssbo_scalar2.m1[1] = float2(ssbo_scalar.m4[0][1], ssbo_scalar.m4[1][1]); |
| 148 |
ssbo_scalar2.m2[0] = float3(ssbo_scalar.m3[0][0], ssbo_scalar.m3[1][0], ssbo_scalar.m3[2][0]); |
| 149 |
ssbo_scalar2.m2[1] = float3(ssbo_scalar.m3[0][1], ssbo_scalar.m3[1][1], ssbo_scalar.m3[2][1]); |
| 150 |
} |
| 151 |
|