'GLSL buffer with multiple arbitrary sized variables

I'm trying to bind a storage buffer of object structs containing multiple variables of different types so that I can access them in my vertex shader.

Struct:

struct Object
{
    vec2 vertices[4];
};
layout(std140, set = 0, binding = 0) buffer ObjectBlock
{
    Object objects[];
};

Using the code above, although I am able to compile the shader and get the Vulkan program running, the values from the array variable vertices are completely different from the values I inputted. I'm not sure why this is happening.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source