MayaFlux 0.1.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ build_color_blend_state()

vk::PipelineColorBlendStateCreateInfo MayaFlux::Core::VKGraphicsPipeline::build_color_blend_state ( const GraphicsPipelineConfig config,
std::vector< vk::PipelineColorBlendAttachmentState > &  attachments 
)
private

Build color blend state.

Definition at line 533 of file VKGraphicsPipeline.cpp.

536{
537 for (const auto& config_attachment : config.color_blend_attachments) {
538 vk::PipelineColorBlendAttachmentState attachment;
539 attachment.blendEnable = config_attachment.blend_enable;
540 attachment.srcColorBlendFactor = config_attachment.src_color_blend_factor;
541 attachment.dstColorBlendFactor = config_attachment.dst_color_blend_factor;
542 attachment.colorBlendOp = config_attachment.color_blend_op;
543 attachment.srcAlphaBlendFactor = config_attachment.src_alpha_blend_factor;
544 attachment.dstAlphaBlendFactor = config_attachment.dst_alpha_blend_factor;
545 attachment.alphaBlendOp = config_attachment.alpha_blend_op;
546 attachment.colorWriteMask = config_attachment.color_write_mask;
547 attachments.push_back(attachment);
548 }
549
550 vk::PipelineColorBlendStateCreateInfo color_blend;
551 color_blend.logicOpEnable = config.logic_op_enable;
552 color_blend.logicOp = config.logic_op;
553 color_blend.attachmentCount = static_cast<uint32_t>(attachments.size());
554 color_blend.pAttachments = attachments.empty() ? nullptr : attachments.data();
555 color_blend.blendConstants[0] = config.blend_constants[0];
556 color_blend.blendConstants[1] = config.blend_constants[1];
557 color_blend.blendConstants[2] = config.blend_constants[2];
558 color_blend.blendConstants[3] = config.blend_constants[3];
559
560 return color_blend;
561}

References MayaFlux::Core::GraphicsPipelineConfig::blend_constants, MayaFlux::Core::GraphicsPipelineConfig::color_blend_attachments, MayaFlux::Core::GraphicsPipelineConfig::logic_op, and MayaFlux::Core::GraphicsPipelineConfig::logic_op_enable.

Referenced by create().

+ Here is the caller graph for this function: