2019-07-10 01:28:02 +00:00
|
|
|
#version 310 es
|
|
|
|
#extension GL_EXT_scalar_block_layout : require
|
|
|
|
|
|
|
|
layout(local_size_x = 1) in;
|
|
|
|
|
|
|
|
struct S0
|
|
|
|
{
|
|
|
|
vec2 a[1];
|
|
|
|
float b;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct S1
|
|
|
|
{
|
|
|
|
vec3 a;
|
|
|
|
float b;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct S2
|
|
|
|
{
|
|
|
|
vec3 a[1];
|
|
|
|
float b;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct S3
|
|
|
|
{
|
|
|
|
vec2 a;
|
|
|
|
float b;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct S4
|
|
|
|
{
|
2019-07-10 23:37:31 +00:00
|
|
|
vec2 c;
|
2019-07-10 01:28:02 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct Content
|
|
|
|
{
|
|
|
|
S0 m0s[1];
|
|
|
|
S1 m1s[1];
|
|
|
|
S2 m2s[1];
|
|
|
|
S0 m0;
|
|
|
|
S1 m1;
|
|
|
|
S2 m2;
|
|
|
|
S3 m3;
|
|
|
|
float m4;
|
|
|
|
|
2019-07-19 12:43:42 +00:00
|
|
|
// glslang seems to miscompile this atm into ArrayStride of 16 even in scalar layout.
|
|
|
|
//S4 m3s[8];
|
2019-07-10 01:28:02 +00:00
|
|
|
};
|
|
|
|
|
2019-07-10 23:37:31 +00:00
|
|
|
layout(binding = 2, scalar) restrict buffer SSBO2
|
|
|
|
{
|
|
|
|
float m0;
|
|
|
|
mat2 m1;
|
|
|
|
layout(row_major) mat3x2 m2;
|
|
|
|
} ssbo_scalar2;
|
|
|
|
|
2019-07-10 01:28:02 +00:00
|
|
|
layout(binding = 1, scalar) restrict buffer SSBO1
|
|
|
|
{
|
|
|
|
Content content;
|
|
|
|
Content content1[2];
|
|
|
|
Content content2;
|
|
|
|
|
|
|
|
layout(column_major) mat2 m0;
|
|
|
|
layout(column_major) mat2 m1;
|
|
|
|
layout(column_major) mat2x3 m2[4];
|
|
|
|
layout(column_major) mat3x2 m3;
|
|
|
|
layout(row_major) mat2 m4;
|
|
|
|
layout(row_major) mat2 m5[9];
|
|
|
|
layout(row_major) mat2x3 m6[4][2];
|
|
|
|
layout(row_major) mat3x2 m7;
|
|
|
|
float array[];
|
2019-07-10 23:37:31 +00:00
|
|
|
} ssbo_scalar;
|
2019-07-10 01:28:02 +00:00
|
|
|
|
|
|
|
layout(binding = 0, std140) restrict buffer SSBO0
|
|
|
|
{
|
|
|
|
Content content;
|
|
|
|
Content content1[2];
|
|
|
|
Content content2;
|
|
|
|
|
|
|
|
layout(column_major) mat2 m0;
|
|
|
|
layout(column_major) mat2 m1;
|
|
|
|
layout(column_major) mat2x3 m2[4];
|
|
|
|
layout(column_major) mat3x2 m3;
|
|
|
|
layout(row_major) mat2 m4;
|
|
|
|
layout(row_major) mat2 m5[9];
|
|
|
|
layout(row_major) mat2x3 m6[4][2];
|
|
|
|
layout(row_major) mat3x2 m7;
|
|
|
|
|
|
|
|
float array[];
|
|
|
|
} ssbo_140;
|
|
|
|
|
|
|
|
void main()
|
|
|
|
{
|
2019-07-10 23:37:31 +00:00
|
|
|
ssbo_scalar.content = ssbo_140.content;
|
|
|
|
ssbo_scalar.content.m1.a = ssbo_scalar.m2[1] * ssbo_scalar.content.m0.a[0]; // test packed matrix access
|
|
|
|
ssbo_scalar.m0 = ssbo_scalar2.m1;
|
|
|
|
ssbo_scalar2.m1 = ssbo_scalar.m4;
|
|
|
|
ssbo_scalar2.m2 = ssbo_scalar.m3;
|
2019-07-10 01:28:02 +00:00
|
|
|
}
|
|
|
|
|