SPIRV-Cross/shaders-msl-no-opt/packing/std140-array-of-vectors.comp
2019-07-23 10:38:32 +02:00

48 lines
825 B
Plaintext

#version 450
layout(local_size_x = 1) in;
layout(std140, set = 0, binding = 0) buffer SSBO
{
float v1[4];
vec2 v2[4];
vec3 v3[4];
vec4 v4[4];
float v1_array_of_array[4][4];
vec2 v2_array_of_array[4][4];
vec3 v3_array_of_array[4][4];
vec4 v4_array_of_array[4][4];
float v_unsized[];
};
void main()
{
float loaded1 = v1[1];
v1[2] = loaded1;
vec2 loaded2 = v2[1];
v2[2] = loaded2;
vec3 loaded3 = v3[1];
v3[2] = loaded3;
vec4 loaded4 = v4[1];
v4[2] = loaded4;
loaded1 = v1_array_of_array[1][2];
v1_array_of_array[2][3] = loaded1;
loaded2 = v2_array_of_array[1][2];
v2_array_of_array[2][3] = loaded2;
loaded3 = v3_array_of_array[1][2];
v3_array_of_array[2][3] = loaded3;
loaded4 = v4_array_of_array[1][2];
v4_array_of_array[2][3] = loaded4;
loaded1 = v_unsized[1];
v_unsized[2] = loaded1;
}