vOOlkan
An object oriented approach to Vulkan
PipelineColorBlendingModes.h
Go to the documentation of this file.
1#ifndef VULKAN_PIPELINECOLORBLENDINGMODES
2#define VULKAN_PIPELINECOLORBLENDINGMODES
3
4#include <vulkan/vulkan.h>
5#include "Subpass.h"
6
7
8namespace Vulkan::PipelineOptions { class PipelineColorBlendingModes; }
9
14public:
15 PipelineColorBlendingModes(const RenderPassOptions::Subpass& subpass, float blendCostantR = 0.0f, float blendCostantG = 0.0f, float blendCostantB = 0.0f, float blendCostantA = 0.0f) : pipelineColorBlendingModes{} {
16 colorBlendingDescriptors = subpass.getColorBlendingDescriptors();
17
18 pipelineColorBlendingModes.sType = VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO;
19 pipelineColorBlendingModes.logicOpEnable = VK_FALSE;
20 pipelineColorBlendingModes.logicOp = VK_LOGIC_OP_COPY;
21 pipelineColorBlendingModes.attachmentCount = subpass.getColorBlendingDescriptors().size();
22 pipelineColorBlendingModes.pAttachments = colorBlendingDescriptors.data();
23 pipelineColorBlendingModes.blendConstants[0] = blendCostantR;
24 pipelineColorBlendingModes.blendConstants[1] = blendCostantG;
25 pipelineColorBlendingModes.blendConstants[2] = blendCostantB;
26 pipelineColorBlendingModes.blendConstants[3] = blendCostantA;
27 }
28
29 const VkPipelineColorBlendStateCreateInfo& operator+() const {
30 return pipelineColorBlendingModes;
31 }
32
33private:
34 VkPipelineColorBlendStateCreateInfo pipelineColorBlendingModes;
35 std::vector<VkPipelineColorBlendAttachmentState> colorBlendingDescriptors;
36};
37
38#endif
A descriptor which unifies all the AttachmentColorBlendingMode of the same subpass into a structure w...
Definition: PipelineColorBlendingModes.h:13
const VkPipelineColorBlendStateCreateInfo & operator+() const
Definition: PipelineColorBlendingModes.h:29
PipelineColorBlendingModes(const RenderPassOptions::Subpass &subpass, float blendCostantR=0.0f, float blendCostantG=0.0f, float blendCostantB=0.0f, float blendCostantA=0.0f)
Definition: PipelineColorBlendingModes.h:15
A Subpass is a step of a RenderPass.
Definition: Subpass.h:28
std::vector< VkPipelineColorBlendAttachmentState > getColorBlendingDescriptors() const
Returns the VkPipelineColorBlendAttachmentState descriptors of the color attachments of this subpass.
Definition: Subpass.h:79
Definition: Attachment.h:11