Hi I'm tiring to pass a 3 dimensional array to fragment shader with a storage buffer but the data are corrupted
Is it a problem with alignment ?
The struct of the buffer data:
struct Pos {
glm::uint32 position;
static VkVertexInputBindingDescription getBindingDescription() {
VkVertexInputBindingDescription bindingDescription{};
bindingDescription.binding = 0;
bindingDescription.stride = sizeof(Pos);
bindingDescription.inputRate = VK_VERTEX_INPUT_RATE_VERTEX;
return bindingDescription;
}
static std::array<VkVertexInputAttributeDescription, 2> getAttributeDescriptions() {
std::array<VkVertexInputAttributeDescription, 2> attributeDescriptions{};
attributeDescriptions[0].binding = 0;
attributeDescriptions[0].location = 0;
attributeDescriptions[0].format = VK_FORMAT_R64_SINT;
attributeDescriptions[0].offset = offsetof(Pos, position);
return attributeDescriptions;
}
};