HoviTron Video Pipeline
Public Member Functions | Data Fields | Protected Member Functions | Protected Attributes
VulkanRenderPassAbstract Class Referenceabstract

An abstract class that contains a common base of code for the class that inherit from it. More...

#include <VulkanRenderPassAbstract.h>

Inheritance diagram for VulkanRenderPassAbstract:
VulkanRenderPass

Public Member Functions

 VulkanRenderPassAbstract (VulkanContext *context, VulkanWrapper *wraps)
 
virtual void init (InputProvider *inputProvider)
 
virtual void cleanUp ()
 
virtual void updateBuffer (uint32_t currentImage, bool initAll, std::span< InputProvider::StreamFrameInfo > infos, int view)
 
virtual void recordCommandBuffer (vk::CommandBuffer &commandBuffer, int i, std::span< InputProvider::StreamFrameInfo > frameInfos, int view)
 
virtual bool isInitialized ()
 
virtual vk::Image getImageToBlit (int imageIndex)=0
 
virtual std::vector< vk::Format > getSupportedDepthFormats () const =0
 

Data Fields

std::vector< ImageStructdepthImages
 
vk::Extent2D renderingExtent
 
int inputImage = 1
 
vk::CommandPool commandPoolBuffer = nullptr
 
vk::Viewport viewport
 
vk::Rect2D scissor
 

Protected Member Functions

void createCommandPoolForBuffer ()
 
void createDepthResources ()
 

Protected Attributes

bool initialized = false
 
InputProviderinput = nullptr
 
VulkanContextcontext = nullptr
 
VulkanWrapperwrapper = nullptr
 
vk::Format depthFormat
 

Detailed Description

An abstract class that contains a common base of code for the class that inherit from it.

An abstract class that contains a common base of code to encapsulate vk::RenderPass objects.

Definition at line 73 of file VulkanRenderPassAbstract.h.

Constructor & Destructor Documentation

◆ VulkanRenderPassAbstract()

VulkanRenderPassAbstract::VulkanRenderPassAbstract ( VulkanContext context,
VulkanWrapper wraps 
)

Constructor

Definition at line 41 of file VulkanRenderPassAbstract.cpp.

42{
43 this->context = context;
44 this->wrapper = wraps;
45}

Member Function Documentation

◆ cleanUp()

void VulkanRenderPassAbstract::cleanUp ( )
virtual

Clean up

Reimplemented in VulkanRenderPass.

Definition at line 67 of file VulkanRenderPassAbstract.cpp.

68{
69 for (auto& im : depthImages) {
70 im.destroy(context->device);
71 }
72 depthImages.clear();
73
74 context->device.destroyCommandPool(commandPoolBuffer);
75}
vk::Device device
Definition: VulkanContext.h:87
std::vector< ImageStruct > depthImages

◆ createCommandPoolForBuffer()

void VulkanRenderPassAbstract::createCommandPoolForBuffer ( )
protected

Create the command pool for the buffer

Definition at line 115 of file VulkanRenderPassAbstract.cpp.

116{
117 // create a CommandPool to allocate a CommandBuffer from
119 vk::CommandPoolCreateInfo commandPoolInfo(vk::CommandPoolCreateFlagBits::eTransient, queueFamilyIndices.graphicsFamily.value());
120 commandPoolBuffer = context->device.createCommandPool(commandPoolInfo);
121}
vk::PhysicalDevice physicalDevice
Definition: VulkanContext.h:85
QueueFamilyIndices findQueueFamilies(vk::PhysicalDevice device)
Struct to encapsulate the indice of the queues families.
Definition: VulkanContext.h:38
std::optional< uint32_t > graphicsFamily
Definition: VulkanContext.h:40

◆ createDepthResources()

void VulkanRenderPassAbstract::createDepthResources ( )
protected

Create depth ressource

Definition at line 89 of file VulkanRenderPassAbstract.cpp.

90{
93 }
94 else {
96 }
97
99 depthImages.resize(attachmentSize);
100 for (int i = 0; i < (attachmentSize); i++) {
101
102 depthImages[i].createStruct(context, renderingExtent,depthFormat ,vk::ImageUsageFlagBits::eDepthStencilAttachment, vk::MemoryPropertyFlagBits::eDeviceLocal,
103 commandPoolBuffer, vk::ImageLayout::eDepthStencilAttachmentOptimal, vk::ImageAspectFlagBits::eDepth);
104 /*
105 createImage(context->device, context->physicalDevice, renderingExtent.width, renderingExtent.height, depthFormat,
106 vk::ImageTiling::eOptimal, vk::ImageUsageFlagBits::eDepthStencilAttachment, vk::MemoryPropertyFlagBits::eDeviceLocal, depthImage, depthImageMemory);
107 depthImageView = createImageView(context->device, depthImage, depthFormat, vk::ImageAspectFlagBits::eDepth);
108
109 transitionImageLayout(context, commandPoolBuffer, depthImage, depthFormat, vk::ImageLayout::eUndefined, vk::ImageLayout::eDepthStencilAttachmentOptimal);*/
110 }
111 //}
112
113}
vk::Format findDepthFormat()
bool isIndepFromWindowDimension()
bool isDepthOutputRecquired()
vk::Format getDepthSwapchainFormat(int view=0)
const bool multiviewSetup

◆ getImageToBlit()

virtual vk::Image VulkanRenderPassAbstract::getImageToBlit ( int  imageIndex)
pure virtual

Return the source image for the blit operation (the image that contains the result of this renderpass)

Implemented in VulkanRenderPass.

◆ getSupportedDepthFormats()

virtual std::vector< vk::Format > VulkanRenderPassAbstract::getSupportedDepthFormats ( ) const
pure virtual

Return the list of depth format supported by the application

Implemented in VulkanRenderPass.

◆ init()

void VulkanRenderPassAbstract::init ( InputProvider inputProvider)
virtual

Init the ressources

Reimplemented in VulkanRenderPass.

Definition at line 47 of file VulkanRenderPassAbstract.cpp.

47 {
48
50
51 //get streams Parameter and chose how many subpasses should be created
52
53 this->input = inputProvider;
54 auto streamsParams = inputProvider->enumerateStreamsParameters();
55
56 auto activation = wrapper->getCameraActivation();
57 inputImage = 0;
58 for (auto a : activation) {
59 if (a) { inputImage++; }
60 }
61
62 //inputImage = streamsParams.size();
63 std::cout << "Nb of Input view: " << streamsParams.size() << std::endl;
64 std::cout << "Nb of Activated camera: " << inputImage << std::endl;
65}
std::vector< bool > getCameraActivation()

◆ isInitialized()

bool VulkanRenderPassAbstract::isInitialized ( )
virtual

Return true if it is initialized

Reimplemented in VulkanRenderPass.

Definition at line 85 of file VulkanRenderPassAbstract.cpp.

◆ recordCommandBuffer()

void VulkanRenderPassAbstract::recordCommandBuffer ( vk::CommandBuffer &  commandBuffer,
int  i,
std::span< InputProvider::StreamFrameInfo frameInfos,
int  view 
)
virtual

Record command buffer with all instruction for this renderpass

Reimplemented in VulkanRenderPass.

Definition at line 81 of file VulkanRenderPassAbstract.cpp.

82{
83}

◆ updateBuffer()

void VulkanRenderPassAbstract::updateBuffer ( uint32_t  currentImage,
bool  initAll,
std::span< InputProvider::StreamFrameInfo infos,
int  view 
)
virtual

Clean up

Reimplemented in VulkanRenderPass.

Definition at line 77 of file VulkanRenderPassAbstract.cpp.

78{
79}

Field Documentation

◆ commandPoolBuffer

vk::CommandPool VulkanRenderPassAbstract::commandPoolBuffer = nullptr

Command pool for buffers

Definition at line 101 of file VulkanRenderPassAbstract.h.

◆ context

VulkanContext* VulkanRenderPassAbstract::context = nullptr
protected

Pointer to context

Definition at line 114 of file VulkanRenderPassAbstract.h.

◆ depthFormat

vk::Format VulkanRenderPassAbstract::depthFormat
protected

Depth format selected

Definition at line 119 of file VulkanRenderPassAbstract.h.

◆ depthImages

std::vector<ImageStruct> VulkanRenderPassAbstract::depthImages

Depth images

Definition at line 93 of file VulkanRenderPassAbstract.h.

◆ initialized

bool VulkanRenderPassAbstract::initialized = false
protected

True if initialized

Definition at line 109 of file VulkanRenderPassAbstract.h.

◆ input

InputProvider* VulkanRenderPassAbstract::input = nullptr
protected

pointer to the input provider

Definition at line 111 of file VulkanRenderPassAbstract.h.

◆ inputImage

int VulkanRenderPassAbstract::inputImage = 1

Number of input pair of image (color +depth) for the synthesis process.

Definition at line 98 of file VulkanRenderPassAbstract.h.

◆ renderingExtent

vk::Extent2D VulkanRenderPassAbstract::renderingExtent

The 2D extent used by this renderpass

Definition at line 96 of file VulkanRenderPassAbstract.h.

◆ scissor

vk::Rect2D VulkanRenderPassAbstract::scissor

Scissor

Definition at line 106 of file VulkanRenderPassAbstract.h.

◆ viewport

vk::Viewport VulkanRenderPassAbstract::viewport

Viewport of the application

Definition at line 104 of file VulkanRenderPassAbstract.h.

◆ wrapper

VulkanWrapper* VulkanRenderPassAbstract::wrapper = nullptr
protected

Pointer to wrapper

Definition at line 116 of file VulkanRenderPassAbstract.h.


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