In the Mesh.h file, we just have to add a few lines of code to specify InputBindingDescription and InputAttributeDescription. In InputBindingDesciption, we specify the binding location, the stride of the data itself, and the input rate, which specifies whether the data is per vertex or per instance. In the Mesh.h file in the OpenGL project, we will just add functions to the Vertex struct:
struct Vertex { glm::vec3 pos; glm::vec3 normal; glm::vec3 color; glm::vec2 texCoords; };
So, in the Vertex struct, add the function to retrieve AttributeDesciption:
static VkVertexInputBindingDescription getBindingDescription() { VkVertexInputBindingDescription bindingDescription = {}; bindingDescription.binding = 0; bindingDescription.stride = sizeof(Vertex); bindingDescription.inputRate ...