60 lines
763 B
Plaintext
60 lines
763 B
Plaintext
#version 450
|
|
#extension GL_EXT_scalar_block_layout : require
|
|
layout(local_size_x = 1) in;
|
|
|
|
layout(binding = 0, std140) buffer SSBO1
|
|
{
|
|
mat2 a;
|
|
layout(row_major) mat2 a2;
|
|
};
|
|
|
|
layout(scalar, binding = 1) buffer SSBO2
|
|
{
|
|
mat2x3 b;
|
|
layout(row_major) mat3x2 b2;
|
|
};
|
|
|
|
void load_store_column()
|
|
{
|
|
vec2 u = a[0];
|
|
vec2 v = a[1];
|
|
u += v;
|
|
a[0] = u;
|
|
a[1] = v;
|
|
}
|
|
|
|
void load_store_row()
|
|
{
|
|
vec2 u = a2[0];
|
|
vec2 v = a2[1];
|
|
u += v;
|
|
a2[0] = u;
|
|
a2[1] = v;
|
|
}
|
|
|
|
void load_store_packed_column()
|
|
{
|
|
vec3 u = b[0];
|
|
vec3 v = b[1];
|
|
u += v;
|
|
b[0] = u;
|
|
b[1] = v;
|
|
}
|
|
|
|
void load_store_packed_row()
|
|
{
|
|
vec2 u = b2[0];
|
|
vec2 v = b2[1];
|
|
u += v;
|
|
b2[0] = u;
|
|
b2[1] = v;
|
|
}
|
|
|
|
void main()
|
|
{
|
|
load_store_column();
|
|
load_store_row();
|
|
load_store_packed_column();
|
|
load_store_packed_row();
|
|
}
|