Added helper function to get vertex input attribute descriptions from requested vertexattributes as a vector
That vector can directly be used for a pipeline's vertex attribute setup
This commit is contained in:
parent
2b28a60e17
commit
f5dbf162a7
1 changed files with 12 additions and 1 deletions
|
|
@ -534,11 +534,22 @@ namespace vkglTF
|
||||||
return VkVertexInputAttributeDescription({ location, binding, VK_FORMAT_R32G32B32A32_SFLOAT, offsetof(Vertex, joint0) });
|
return VkVertexInputAttributeDescription({ location, binding, VK_FORMAT_R32G32B32A32_SFLOAT, offsetof(Vertex, joint0) });
|
||||||
case VertexComponent::Weight0:
|
case VertexComponent::Weight0:
|
||||||
return VkVertexInputAttributeDescription({ location, binding, VK_FORMAT_R32G32B32A32_SFLOAT, offsetof(Vertex, weight0) });
|
return VkVertexInputAttributeDescription({ location, binding, VK_FORMAT_R32G32B32A32_SFLOAT, offsetof(Vertex, weight0) });
|
||||||
|
default:
|
||||||
|
return VkVertexInputAttributeDescription({});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
static std::vector<VkVertexInputAttributeDescription> inputAttributeDescriptions(uint32_t binding, const std::vector<VertexComponent> components) {
|
||||||
|
std::vector<VkVertexInputAttributeDescription> result;
|
||||||
|
uint32_t location = 0;
|
||||||
|
for (VertexComponent component : components) {
|
||||||
|
result.push_back(Vertex::inputAttributeDescription(binding, location, component));
|
||||||
|
location++;
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef enum FileLoadingFlags {
|
enum FileLoadingFlags {
|
||||||
None = 0x00000000,
|
None = 0x00000000,
|
||||||
PreTransformVertices = 0x00000001,
|
PreTransformVertices = 0x00000001,
|
||||||
PreMultiplyVertexColors = 0x00000002,
|
PreMultiplyVertexColors = 0x00000002,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue