| 80 | }; |
| 81 | |
| 82 | struct Particle { |
| 83 | glm::vec2 position; |
| 84 | glm::vec2 velocity; |
| 85 | glm::vec4 color; |
| 86 | |
| 87 | static VkVertexInputBindingDescription getBindingDescription() { |
| 88 | VkVertexInputBindingDescription bindingDescription{}; |
| 89 | bindingDescription.binding = 0; |
| 90 | bindingDescription.stride = sizeof(Particle); |
| 91 | bindingDescription.inputRate = VK_VERTEX_INPUT_RATE_VERTEX; |
| 92 | |
| 93 | return bindingDescription; |
| 94 | } |
| 95 | |
| 96 | static std::array<VkVertexInputAttributeDescription, 2> getAttributeDescriptions() { |
| 97 | std::array<VkVertexInputAttributeDescription, 2> attributeDescriptions{}; |
| 98 | |
| 99 | attributeDescriptions[0].binding = 0; |
| 100 | attributeDescriptions[0].location = 0; |
| 101 | attributeDescriptions[0].format = VK_FORMAT_R32G32_SFLOAT; |
| 102 | attributeDescriptions[0].offset = offsetof(Particle, position); |
| 103 | |
| 104 | attributeDescriptions[1].binding = 0; |
| 105 | attributeDescriptions[1].location = 1; |
| 106 | attributeDescriptions[1].format = VK_FORMAT_R32G32B32A32_SFLOAT; |
| 107 | attributeDescriptions[1].offset = offsetof(Particle, color); |
| 108 | |
| 109 | return attributeDescriptions; |
| 110 | } |
| 111 | }; |
| 112 | |
| 113 | class ComputeShaderApplication { |
| 114 | public: |
nothing calls this directly
no outgoing calls
no test coverage detected