- create a render pass for each blend setup

This commit is contained in:
Magnus Norddahl 2019-03-01 00:42:51 +01:00
commit 7f3e473f56
5 changed files with 83 additions and 15 deletions

View file

@ -189,6 +189,7 @@ public:
void setAdditiveBlendMode();
void setAlphaBlendMode();
void setBlendMode(VkBlendOp op, VkBlendFactor src, VkBlendFactor dst);
void setSubpassColorAttachmentCount(int count);
void addVertexShader(VulkanShader *shader);
@ -786,6 +787,17 @@ inline void GraphicsPipelineBuilder::setAlphaBlendMode()
colorBlendAttachment.alphaBlendOp = VK_BLEND_OP_ADD;
}
inline void GraphicsPipelineBuilder::setBlendMode(VkBlendOp op, VkBlendFactor src, VkBlendFactor dst)
{
colorBlendAttachment.blendEnable = VK_TRUE;
colorBlendAttachment.srcColorBlendFactor = src;
colorBlendAttachment.dstColorBlendFactor = dst;
colorBlendAttachment.colorBlendOp = op;
colorBlendAttachment.srcAlphaBlendFactor = src;
colorBlendAttachment.dstAlphaBlendFactor = dst;
colorBlendAttachment.alphaBlendOp = op;
}
inline void GraphicsPipelineBuilder::setSubpassColorAttachmentCount(int count)
{
colorBlendAttachments.resize(count, colorBlendAttachment);