HoviTron Video Pipeline
BuffersControllerBlending.h
Go to the documentation of this file.
1/* ----------------------
2* Copyright 2023 Université Libre de Bruxelles(ULB), Universidad Politécnica de Madrid(UPM), CREAL, Deutsches Zentrum für Luft - und Raumfahrt(DLR)
3
4* Licensed under the Apache License, Version 2.0 (the "License");
5* you may not use this file except in compliance with the License.
6* You may obtain a copy of the License at < http://www.apache.org/licenses/LICENSE-2.0>
7
8* Unless required by applicable law or agreed to in writing, software
9* distributed under the License is distributed on an "AS IS" BASIS,
10* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11* See the License for the specific language governing permissionsand
12* limitations under the License.
13---------------------- */
14
15/*****************************************************************/
22#pragma once
24
27class VulkanWrapper;
28
35 alignas(4) float blendingFactor = 5.0;
36 alignas(4) float ZNearHeadset = 0.1001;
37 alignas(4) float ZFarHeadset = 10.01;
38 alignas(4) float ZFar = 1;
39 alignas(4) float maxMul = 10;
40 alignas(4) float scaleFactor = 1.0;
41 alignas(4) float inputDistance = 1.0;
42};
43
52public:
56 void init() override;
57
59 void bindBuffers(vk::CommandBuffer& commandBuffer, int index, InputProvider::StreamFrameInfo & frameInfo, int view) override;
61 void updateAllUniformBuffer(uint32_t currentImage, int view) override;
63 void updateUniformBuffer(uint32_t currentImage, int view) override;
65 void cleanUp() override;
67 vk::VertexInputBindingDescription getBindingDescription() override;
69 std::vector<vk::VertexInputAttributeDescription> getAttributeDescription() override;
71 void update(std::span<InputProvider::StreamFrameInfo> infos, int view) override;
72
74 static inline std::vector<uint32_t> indices;
76 uint32_t getIndiceCount() override;
77
78private:
79
81 void createVertexBuffer() override;
83 void createIndexBuffer() override;
85 void createUniformBuffer(int size) override;
87 void createDescriptorPool() override;
89 void createDescriptorSets() override;
90
92 inline static uint32_t indiceCount = 0;
94 BlendingParameters blendingParam;
96 int attachmentCount = 1;
97
99 VulkanPipelineBlending * pipeline = nullptr;
101 VulkanWrapper* wrapper = nullptr;
103 vk::DescriptorPool descriptorPool;
105 std::vector<vk::DescriptorSet> descriptorSets;
106
108 std::vector<vk::Buffer> uniformBuffers;
110 std::vector<vk::DeviceMemory> uniformBuffersMemory;
111
113 static inline vk::Buffer vertexBuffer;
115 static inline vk::DeviceMemory vertexBufferMemory;
117 static inline vk::Buffer indexBuffer;
119 static inline vk::DeviceMemory indexBufferMemory;
120};
Abstract class that contains common functionnalities to manage the buffer for synthesis and blending ...
Class that manages ressources for the blending pipeline.
void updateAllUniformBuffer(uint32_t currentImage, int view) override
void update(std::span< InputProvider::StreamFrameInfo > infos, int view) override
void bindBuffers(vk::CommandBuffer &commandBuffer, int index, InputProvider::StreamFrameInfo &frameInfo, int view) override
vk::VertexInputBindingDescription getBindingDescription() override
void updateUniformBuffer(uint32_t currentImage, int view) override
std::vector< vk::VertexInputAttributeDescription > getAttributeDescription() override
static std::vector< uint32_t > indices
abstract class for the management of the buffers, descriptors, ...
VulkanRenderPass * renderpass
class that manages tasks related to Vulkan context (Vulkan Instance, Vulkan Physical device,...
Definition: VulkanContext.h:59
Class that manages a graphics pipeline for the blending.
Class that manage the renderPass containing the synthesis and blending steps.
Class that manages the classes related to Vulkan code and act as a wrapper around them.
Definition: VulkanWrapper.h:66
Struct that contains value to be sent to the fragment shader of the blending pipeline.