MCPcopy Create free account
hub / github.com/Overv/VulkanTutorial / Particle

Class Particle

code/31_compute_shader.cpp:82–111  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

80};
81
82struct 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
113class ComputeShaderApplication {
114public:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected