2017-11-06 02:34:42 +00:00
|
|
|
#include <metal_stdlib>
|
|
|
|
#include <simd/simd.h>
|
|
|
|
|
|
|
|
using namespace metal;
|
|
|
|
|
2018-02-11 21:52:57 +00:00
|
|
|
typedef float3x2 packed_float2x3;
|
|
|
|
|
2017-11-06 02:34:42 +00:00
|
|
|
struct S0
|
|
|
|
{
|
|
|
|
float2 a[1];
|
|
|
|
float b;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct S1
|
|
|
|
{
|
|
|
|
packed_float3 a;
|
|
|
|
float b;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct S2
|
|
|
|
{
|
|
|
|
float3 a[1];
|
|
|
|
float b;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct S3
|
|
|
|
{
|
|
|
|
float2 a;
|
|
|
|
float b;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct S4
|
|
|
|
{
|
|
|
|
float2 c;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct Content
|
|
|
|
{
|
|
|
|
S0 m0s[1];
|
|
|
|
S1 m1s[1];
|
|
|
|
S2 m2s[1];
|
|
|
|
S0 m0;
|
|
|
|
S1 m1;
|
|
|
|
S2 m2;
|
|
|
|
S3 m3;
|
|
|
|
char pad7[4];
|
|
|
|
float m4;
|
|
|
|
S4 m3s[8];
|
|
|
|
};
|
|
|
|
|
|
|
|
struct SSBO1
|
|
|
|
{
|
|
|
|
Content content;
|
|
|
|
Content content1[2];
|
|
|
|
Content content2;
|
|
|
|
char pad3[8];
|
|
|
|
float2x2 m0;
|
|
|
|
float2x2 m1;
|
|
|
|
float2x3 m2[4];
|
|
|
|
float3x2 m3;
|
|
|
|
float2x2 m4;
|
|
|
|
float2x2 m5[9];
|
2018-02-11 21:52:57 +00:00
|
|
|
packed_float2x3 m6[4][2];
|
|
|
|
char pad10[8];
|
2017-11-06 02:34:42 +00:00
|
|
|
float3x2 m7;
|
2018-02-11 21:52:57 +00:00
|
|
|
char pad11[8];
|
2017-11-06 02:34:42 +00:00
|
|
|
float array[1];
|
|
|
|
};
|
|
|
|
|
2018-03-05 15:34:42 +00:00
|
|
|
struct S0_1
|
|
|
|
{
|
|
|
|
float2 a[1];
|
|
|
|
float b;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct S1_1
|
|
|
|
{
|
|
|
|
packed_float3 a;
|
|
|
|
float b;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct S2_1
|
|
|
|
{
|
|
|
|
float3 a[1];
|
|
|
|
float b;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct S3_1
|
|
|
|
{
|
|
|
|
float2 a;
|
|
|
|
float b;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct S4_1
|
|
|
|
{
|
|
|
|
float2 c;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct Content_1
|
|
|
|
{
|
|
|
|
S0_1 m0s[1];
|
|
|
|
S1_1 m1s[1];
|
|
|
|
S2_1 m2s[1];
|
|
|
|
S0_1 m0;
|
|
|
|
S1_1 m1;
|
|
|
|
S2_1 m2;
|
|
|
|
S3_1 m3;
|
|
|
|
char pad7[4];
|
|
|
|
float m4;
|
|
|
|
S4_1 m3s[8];
|
|
|
|
};
|
|
|
|
|
2017-11-06 02:34:42 +00:00
|
|
|
struct SSBO0
|
|
|
|
{
|
2018-03-05 15:34:42 +00:00
|
|
|
Content_1 content;
|
|
|
|
Content_1 content1[2];
|
|
|
|
Content_1 content2;
|
2017-11-06 02:34:42 +00:00
|
|
|
float array[1];
|
|
|
|
};
|
|
|
|
|
2018-04-04 08:00:37 +00:00
|
|
|
kernel void main0(device SSBO0& ssbo_140 [[buffer(0)]], device SSBO1& ssbo_430 [[buffer(1)]])
|
2017-11-06 02:34:42 +00:00
|
|
|
{
|
|
|
|
ssbo_430.content.m0s[0].a[0] = ssbo_140.content.m0s[0].a[0];
|
|
|
|
ssbo_430.content.m0s[0].b = ssbo_140.content.m0s[0].b;
|
|
|
|
ssbo_430.content.m1s[0].a = ssbo_140.content.m1s[0].a;
|
|
|
|
ssbo_430.content.m1s[0].b = ssbo_140.content.m1s[0].b;
|
|
|
|
ssbo_430.content.m2s[0].a[0] = ssbo_140.content.m2s[0].a[0];
|
|
|
|
ssbo_430.content.m2s[0].b = ssbo_140.content.m2s[0].b;
|
|
|
|
ssbo_430.content.m0.a[0] = ssbo_140.content.m0.a[0];
|
|
|
|
ssbo_430.content.m0.b = ssbo_140.content.m0.b;
|
|
|
|
ssbo_430.content.m1.a = ssbo_140.content.m1.a;
|
|
|
|
ssbo_430.content.m1.b = ssbo_140.content.m1.b;
|
|
|
|
ssbo_430.content.m2.a[0] = ssbo_140.content.m2.a[0];
|
|
|
|
ssbo_430.content.m2.b = ssbo_140.content.m2.b;
|
|
|
|
ssbo_430.content.m3.a = ssbo_140.content.m3.a;
|
|
|
|
ssbo_430.content.m3.b = ssbo_140.content.m3.b;
|
|
|
|
ssbo_430.content.m4 = ssbo_140.content.m4;
|
|
|
|
ssbo_430.content.m3s[0].c = ssbo_140.content.m3s[0].c;
|
|
|
|
ssbo_430.content.m3s[1].c = ssbo_140.content.m3s[1].c;
|
|
|
|
ssbo_430.content.m3s[2].c = ssbo_140.content.m3s[2].c;
|
|
|
|
ssbo_430.content.m3s[3].c = ssbo_140.content.m3s[3].c;
|
|
|
|
ssbo_430.content.m3s[4].c = ssbo_140.content.m3s[4].c;
|
|
|
|
ssbo_430.content.m3s[5].c = ssbo_140.content.m3s[5].c;
|
|
|
|
ssbo_430.content.m3s[6].c = ssbo_140.content.m3s[6].c;
|
|
|
|
ssbo_430.content.m3s[7].c = ssbo_140.content.m3s[7].c;
|
2018-02-11 21:52:57 +00:00
|
|
|
ssbo_430.content.m1.a = ssbo_430.content.m3.a * ssbo_430.m6[1][1];
|
2017-11-06 02:34:42 +00:00
|
|
|
}
|
|
|
|
|