vOOlkan
An object oriented approach to Vulkan
AttachmentColorBlendingMode.h
Go to the documentation of this file.
1#ifndef VULKAN_ATTACHMENTCOLORBLENDINGMODE
2#define VULKAN_ATTACHMENTCOLORBLENDINGMODE
3
4#include <vulkan/vulkan.h>
5
6
7namespace Vulkan::PipelineOptions::RenderPassOptions { class AttachmentColorBlendingMode; enum class PredefinedColorBlendingModes; }
8
9
11 INVALID, STANDARD //TODO add other modes
12};
13
14
21public:
22
24 switch (predefinedMode) {
26 colorBlendingMode.colorWriteMask = VK_COLOR_COMPONENT_R_BIT | VK_COLOR_COMPONENT_G_BIT | VK_COLOR_COMPONENT_B_BIT | VK_COLOR_COMPONENT_A_BIT;
27 colorBlendingMode.blendEnable = VK_FALSE;
28 colorBlendingMode.srcColorBlendFactor = VK_BLEND_FACTOR_ONE;
29 colorBlendingMode.dstColorBlendFactor = VK_BLEND_FACTOR_ZERO;
30 colorBlendingMode.colorBlendOp = VK_BLEND_OP_ADD;
31 colorBlendingMode.srcAlphaBlendFactor = VK_BLEND_FACTOR_ONE;
32 colorBlendingMode.dstAlphaBlendFactor = VK_BLEND_FACTOR_ZERO;
33 colorBlendingMode.alphaBlendOp = VK_BLEND_OP_ADD;
34 break;
35 default:
36 colorBlendingMode.colorWriteMask = VK_COLOR_COMPONENT_FLAG_BITS_MAX_ENUM;
37 colorBlendingMode.blendEnable = VK_FALSE;
38 colorBlendingMode.srcColorBlendFactor = VK_BLEND_FACTOR_MAX_ENUM;
39 colorBlendingMode.dstColorBlendFactor = VK_BLEND_FACTOR_MAX_ENUM;
40 colorBlendingMode.colorBlendOp = VK_BLEND_OP_MAX_ENUM;
41 colorBlendingMode.srcAlphaBlendFactor = VK_BLEND_FACTOR_MAX_ENUM;
42 colorBlendingMode.dstAlphaBlendFactor = VK_BLEND_FACTOR_MAX_ENUM;
43 colorBlendingMode.alphaBlendOp = VK_BLEND_OP_MAX_ENUM;
44 }
45 }
46
47
48 AttachmentColorBlendingMode(VkPipelineColorBlendAttachmentState baseColorBlendingMode) : colorBlendingMode{ baseColorBlendingMode } {}
49
50
51 const VkPipelineColorBlendAttachmentState& operator+() const {
52 return colorBlendingMode;
53 }
54
55private:
56 VkPipelineColorBlendAttachmentState colorBlendingMode;
57};
58
59#endif
A AttachmentColorBlendingMode describes how a render Subpass will write to a color attachment.
Definition: AttachmentColorBlendingMode.h:20
const VkPipelineColorBlendAttachmentState & operator+() const
Definition: AttachmentColorBlendingMode.h:51
AttachmentColorBlendingMode(VkPipelineColorBlendAttachmentState baseColorBlendingMode)
Definition: AttachmentColorBlendingMode.h:48
AttachmentColorBlendingMode(PredefinedColorBlendingModes predefinedMode=PredefinedColorBlendingModes::INVALID)
Definition: AttachmentColorBlendingMode.h:23
PredefinedColorBlendingModes
Definition: AttachmentColorBlendingMode.h:10