HoviTron Video Pipeline
Public Member Functions
VulkanPipelineBlending Class Reference

Class that manages a graphics pipeline for the blending. More...

#include <VulkanPipelineBlending.h>

Inheritance diagram for VulkanPipelineBlending:
VulkanPipelineAbsract

Public Member Functions

 VulkanPipelineBlending (VulkanContext *context, VulkanRenderPass *renderPass, VulkanWrapper *wraps, int inputCameraId)
 
void init () override
 
void cleanUp () override
 
void createDescriptorSetLayout () override
 
- Public Member Functions inherited from VulkanPipelineAbsract
virtual void init ()=0
 
virtual void cleanUp ()=0
 
void cmdBufferBindBuffer (vk::CommandBuffer &cmdBuffer, int index, InputProvider::StreamFrameInfo &frameInfo, int view)
 
void updateAllBuffer (uint32_t currentImage, int view)
 
void updateBuffer (uint32_t currentImage, int view)
 
virtual void createDescriptorSetLayout ()=0
 
uint32_t getIndexNumber ()
 

Additional Inherited Members

- Data Fields inherited from VulkanPipelineAbsract
vk::Pipeline pipeline
 
vk::DescriptorSetLayout descriptorSetLayout
 
vk::PipelineLayout pipelineLayout
 
- Protected Member Functions inherited from VulkanPipelineAbsract
virtual void createGraphicsPipeline ()=0
 
vk::ShaderModule createShaderModule (const Shader &shader)
 
void createPipeline (std::vector< vk::PipelineShaderStageCreateInfo > &arr)
 
- Protected Attributes inherited from VulkanPipelineAbsract
VulkanContextcontext = nullptr
 
VulkanRenderPassrenderPass = nullptr
 
VulkanWrapperwrapper = nullptr
 
std::unique_ptr< BuffersControllerbufferController
 
int subPass = 0
 
int inputId = 0
 
int colorAttachmentNb = 0
 
bool depthTest = true
 
bool depthWrite = true
 

Detailed Description

Class that manages a graphics pipeline for the blending.

Class that manages a graphics pipeline for the blending. The management of the buffers linked to it are delegated in a BuffersControllerWarping object. It has the responsability to select the correct shader depending of the camera id.

Definition at line 34 of file VulkanPipelineBlending.h.

Constructor & Destructor Documentation

◆ VulkanPipelineBlending()

VulkanPipelineBlending::VulkanPipelineBlending ( VulkanContext context,
VulkanRenderPass renderPass,
VulkanWrapper wraps,
int  inputCameraId 
)

Constructor

Definition at line 23 of file VulkanPipelineBlending.cpp.

24{
25 this->context = context;
26 this->renderPass = renderPass;
27 this->wrapper = wraps;
28 this->depthWrite = false;
29
30 this->subPass = 2 * inputCameraId + 1;
31 this->inputId = inputCameraId;
32
33 this->bufferController = std::make_unique<BufferControllerBlending>(context, renderPass, this, wraps, inputCameraId);
34
35 if (inputCameraId == this->renderPass->inputImage - 1) {
36 this->colorAttachmentNb = 1;
38 this->depthWrite = true;
39 }
40 }
41 else {
43 this->colorAttachmentNb = 3;
44 }
45 else {
46 this->colorAttachmentNb = 2; //outputAttachement
47 }
48 }
49
50
51
52 this->depthTest = false;
53
54}
std::unique_ptr< BuffersController > bufferController
VulkanRenderPass * renderPass
bool isDepthOutputRecquired()

Member Function Documentation

◆ cleanUp()

void VulkanPipelineBlending::cleanUp ( )
overridevirtual

Clean up

Implements VulkanPipelineAbsract.

Definition at line 63 of file VulkanPipelineBlending.cpp.

64{
65 bufferController->cleanUp();
67 context->device.destroyPipeline(pipeline);
68 context->device.destroyPipelineLayout(pipelineLayout);
69}
vk::Device device
Definition: VulkanContext.h:87
vk::DescriptorSetLayout descriptorSetLayout
vk::PipelineLayout pipelineLayout

◆ createDescriptorSetLayout()

void VulkanPipelineBlending::createDescriptorSetLayout ( )
overridevirtual

Create descriptor set layout

Implements VulkanPipelineAbsract.

Definition at line 71 of file VulkanPipelineBlending.cpp.

72{
73 vk::DescriptorSetLayoutBinding uboLayoutBinding(
74 1, //binding
75 vk::DescriptorType::eUniformBuffer, //descriptor type
76 1, //descriptorCount
77 vk::ShaderStageFlagBits::eFragment, //stageFlags
78 nullptr //pimmutable sampler
79 );
80 vk::DescriptorSetLayoutBinding accu_imageLayoutBinding(
81 2, //binding
82 vk::DescriptorType::eInputAttachment, //descriptor type
83 1, //descriptorCount
84 vk::ShaderStageFlagBits::eFragment, //stageFlags
85 nullptr //pimmutable sampler
86 );
87 //input AttachementDescriptor
88 vk::DescriptorSetLayoutBinding new_imageLayoutBinding(
89 3, //binding
90 vk::DescriptorType::eInputAttachment, //descriptor type
91 1, //descriptorCount
92 vk::ShaderStageFlagBits::eFragment, //stageFlags
93 nullptr //pimmutable sampler
94 );
95 vk::DescriptorSetLayoutBinding accu_qualityLayoutBinding(
96 4, //binding
97 vk::DescriptorType::eInputAttachment, //descriptor type
98 1, //descriptorCount
99 vk::ShaderStageFlagBits::eFragment, //stageFlags
100 nullptr //pimmutable sampler
101 );
102 vk::DescriptorSetLayoutBinding new_triangle_qualityLayoutBinding(
103 5, //binding
104 vk::DescriptorType::eInputAttachment, //descriptor type
105 1, //descriptorCount
106 vk::ShaderStageFlagBits::eFragment, //stageFlags
107 nullptr //pimmutable sampler
108 );
109 vk::DescriptorSetLayoutBinding new_depthLayoutBinding(
110 6, //binding
111 vk::DescriptorType::eInputAttachment, //descriptor type
112 1, //descriptorCount
113 vk::ShaderStageFlagBits::eFragment, //stageFlags
114 nullptr //pimmutable sampler
115 );
116
117
118
119
120 std::vector<vk::DescriptorSetLayoutBinding> bindings = { uboLayoutBinding, new_imageLayoutBinding,new_triangle_qualityLayoutBinding, new_depthLayoutBinding,
121 accu_imageLayoutBinding, accu_qualityLayoutBinding};
122
124 vk::DescriptorSetLayoutBinding accu_depthLayoutBinding(
125 7, //binding
126 vk::DescriptorType::eInputAttachment, //descriptor type
127 1, //descriptorCount
128 vk::ShaderStageFlagBits::eFragment, //stageFlags
129 nullptr //pimmutable sampler
130 );
131 bindings.push_back(accu_depthLayoutBinding);
132 }
133
134 vk::DescriptorSetLayoutCreateInfo layoutInfo(vk::DescriptorSetLayoutCreateFlags(), static_cast<uint32_t>(bindings.size()), bindings.data());
135
136 descriptorSetLayout = context->device.createDescriptorSetLayout(layoutInfo);
137}

◆ init()

void VulkanPipelineBlending::init ( )
overridevirtual

Initialization

Implements VulkanPipelineAbsract.

Definition at line 56 of file VulkanPipelineBlending.cpp.

57{
59 createGraphicsPipeline();
60 bufferController->init();
61}
void createDescriptorSetLayout() override

The documentation for this class was generated from the following files: