Updated PipelineBuilder to now allow adding vertex bindings
This commit is contained in:
@@ -6,6 +6,8 @@ basalt::PipelineBuilder::PipelineBuilder(basalt::Device& device, VkExtent2D exte
|
||||
shader_modules(MEMORY_TAG_CLASS_DYNARRAY | MEMORY_TAG_ZONE_ENGINE | MEMORY_TAG_ALIGN_ANY),
|
||||
colour_attachments(MEMORY_TAG_CLASS_DYNARRAY | MEMORY_TAG_ZONE_ENGINE | MEMORY_TAG_ALIGN_ANY),
|
||||
dynamic_states(MEMORY_TAG_CLASS_DYNARRAY | MEMORY_TAG_ZONE_ENGINE | MEMORY_TAG_ALIGN_ANY),
|
||||
vertex_input_attributes(MEMORY_TAG_CLASS_DYNARRAY | MEMORY_TAG_ZONE_ENGINE | MEMORY_TAG_ALIGN_ANY),
|
||||
vertex_binding_description(MEMORY_TAG_CLASS_DYNARRAY | MEMORY_TAG_ZONE_ENGINE | MEMORY_TAG_ALIGN_ANY),
|
||||
device(device), previous_pipeline(previous_pipeline)
|
||||
{
|
||||
dynamic_state_ci.sType = VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO;
|
||||
@@ -171,6 +173,11 @@ basalt::Pipeline basalt::PipelineBuilder::build()
|
||||
colour_blend_ci.attachmentCount = this->colour_attachments.m_nelements;
|
||||
colour_blend_ci.pAttachments = this->colour_attachments.m_pdata;
|
||||
|
||||
vertex_ci.pVertexBindingDescriptions = this->vertex_binding_description.m_pdata;
|
||||
vertex_ci.vertexBindingDescriptionCount = this->vertex_binding_description.m_nelements;
|
||||
vertex_ci.pVertexAttributeDescriptions = this->vertex_input_attributes.m_pdata;
|
||||
vertex_ci.vertexAttributeDescriptionCount = this->vertex_input_attributes.m_nelements;
|
||||
|
||||
VkGraphicsPipelineCreateInfo ci = { VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO };
|
||||
ci.flags = VK_PIPELINE_CREATE_DERIVATIVE_BIT * (this->previous_pipeline != VK_NULL_HANDLE);
|
||||
ci.basePipelineHandle = this->previous_pipeline;
|
||||
@@ -224,3 +231,10 @@ basalt::PipelineBuilder& basalt::PipelineBuilder::add_colour_attachment(VkPipeli
|
||||
this->colour_attachments.push_back(attachment);
|
||||
return *this;
|
||||
}
|
||||
|
||||
basalt::PipelineBuilder& basalt::PipelineBuilder::add_vertex_binding(VkVertexInputBindingDescription binding, VkVertexInputAttributeDescription* attributes, u32 num_bindings)
|
||||
{
|
||||
this->vertex_input_attributes.push_back(attributes, num_bindings);
|
||||
this->vertex_binding_description.push_back(binding);
|
||||
return *this;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user