![]() |
HoviTron Video Pipeline
|
Class that manages the classes related to Vulkan code and act as a wrapper around them. More...
#include <VulkanWrapper.h>
Public Types | |
using | RenderPassType = VulkanRenderpass |
Public Member Functions | |
VulkanWrapper (WindowAbstract *window, PipelineMode pmode) | |
void | init () |
void | endInit (InputProvider *input, StartingPosition startingPt=StartingPosition::Average) |
void | start () |
void | cleanUp () |
void | recreateSwapChain () |
void | updateSpaceTransform (glm::vec3 translation, glm::vec3 rotation) |
void | updateSpaceTransform (glm::vec3 translation, glm::vec3 rotation, glm::vec4 fov, int view) |
void | waitIdle () |
void | createImageCall (uint32_t width, uint32_t height, vk::Format format, vk::ImageTiling tiling, vk::ImageUsageFlags usage, vk::MemoryPropertyFlags properties, vk::Image &image, vk::DeviceMemory &imageMemory) |
void | createBufferCall (vk::DeviceSize size, vk::BufferUsageFlags usage, vk::MemoryPropertyFlags properties, vk::Buffer &buffer, vk::DeviceMemory &bufferMemory) |
void | copyMemory (VkDeviceSize &size, vk::DeviceMemory &memory, unsigned char *dataToCopy) |
void | destroyImageAndMemory (std::vector< vk::Image > &vectorImage, std::vector< vk::DeviceMemory > &vectorMemory) |
void | destroyBufferAndMemory (std::vector< vk::Buffer > &vectorBuffer, std::vector< vk::DeviceMemory > &vectorMemory) |
bool | isDepthOutputRecquired () |
void | setBlendingFactor (float blendingfactor) |
void | setTriangleThreshold (float triangleThreshold) |
bool | isUsingDifferentViewSize () |
VulkanContext * | getContext () |
vk::Extent2D | getSwapchainExtend (int view=0) |
vk::Extent2D | getRenderOutputExtent () |
std::vector< vk::Format > | getRenderPassSupportedDepthFormats () const |
vk::Format | getSwapchainFormat (int view=0) |
vk::Format | getDepthSwapchainFormat (int view=0) |
vk::ImageLayout | getLayoutAfterRenderpass () |
int | getAttachmentSize () |
int | getViewNumber () |
void | setAverageInputPosition (std::vector< InputProvider::StreamFrameInfo > &frameInfo) |
void | addDeltaToStartingPoint (glm::vec3 dPos, glm::vec3 dRot) |
void | setCorrectionRotation (int camId, glm::vec3 rotationCorrection) |
void | setCorrectionTranslation (int camId, glm::vec3 translationCorrection) |
void | setCorrectionFocal (int camId, glm::vec2 focals) |
void | setCorrectionPrincipalPt (int camId, glm::vec2 principalPt) |
void | setScaleFactor (float scaleFactor) |
const std::vector< glm::vec3 > | getCorrectionVectorRotation () |
const std::vector< InputProvider::StreamFrameInfo > | getFramesInfo (int view) |
void | saveConfigurationsToDisk () |
void | loadConfigurationsFromDisk () |
std::vector< bool > | getCameraActivation () |
void | toggleCamera (int i) |
void | setCameraActivation (std::vector< bool > activation) |
Data Fields | |
bool | framebufferResized = false |
const vk::Format | internalColorAttachmentFormat = vk::Format::eR8G8B8A8Unorm |
const vk::Format | internal1DAttachmentFormat = vk::Format::eR32Sfloat |
const vk::Format | qualityAttachmentFormat = vk::Format::eR32Sfloat |
const bool | multiviewSetup |
bool | requireAverageInputPosition = true |
VulkanContext | context |
RenderingParameters | params |
Class that manages the classes related to Vulkan code and act as a wrapper around them.
Class that manages the classes related to Vulkan code and act as a wrapper around them. It manages the creation of the VulkanContext class, the RenderingParameter, the Vulkan RenderPass, ect ...
Definition at line 66 of file VulkanWrapper.h.
using VulkanWrapper::RenderPassType = VulkanRenderpass |
Definition at line 216 of file VulkanWrapper.h.
VulkanWrapper::VulkanWrapper | ( | WindowAbstract * | window, |
PipelineMode | pmode | ||
) |
Create the VulkanWrapper object
Definition at line 43 of file VulkanWrapper.cpp.
void VulkanWrapper::addDeltaToStartingPoint | ( | glm::vec3 | dPos, |
glm::vec3 | dRot | ||
) |
Add an offset to the stored by the virtual parameters
Definition at line 480 of file VulkanWrapper.cpp.
void VulkanWrapper::cleanUp | ( | ) |
Start to cleanup ressources. The classes of the project have to be destroyed in a certain order
Definition at line 270 of file VulkanWrapper.cpp.
void VulkanWrapper::copyMemory | ( | VkDeviceSize & | size, |
vk::DeviceMemory & | memory, | ||
unsigned char * | dataToCopy | ||
) |
Copy the data to the requested device memory location
Definition at line 328 of file VulkanWrapper.cpp.
void VulkanWrapper::createBufferCall | ( | vk::DeviceSize | size, |
vk::BufferUsageFlags | usage, | ||
vk::MemoryPropertyFlags | properties, | ||
vk::Buffer & | buffer, | ||
vk::DeviceMemory & | bufferMemory | ||
) |
Create a vk::Buffer with the requested characteristics
Definition at line 324 of file VulkanWrapper.cpp.
void VulkanWrapper::createImageCall | ( | uint32_t | width, |
uint32_t | height, | ||
vk::Format | format, | ||
vk::ImageTiling | tiling, | ||
vk::ImageUsageFlags | usage, | ||
vk::MemoryPropertyFlags | properties, | ||
vk::Image & | image, | ||
vk::DeviceMemory & | imageMemory | ||
) |
Create a vk::Image with the requested characteristics
Definition at line 320 of file VulkanWrapper.cpp.
void VulkanWrapper::destroyBufferAndMemory | ( | std::vector< vk::Buffer > & | vectorBuffer, |
std::vector< vk::DeviceMemory > & | vectorMemory | ||
) |
Destroy the buffer and their associated buffer mamory
Definition at line 348 of file VulkanWrapper.cpp.
void VulkanWrapper::destroyImageAndMemory | ( | std::vector< vk::Image > & | vectorImage, |
std::vector< vk::DeviceMemory > & | vectorMemory | ||
) |
Destroy the images and their associated memory
Definition at line 336 of file VulkanWrapper.cpp.
void VulkanWrapper::endInit | ( | InputProvider * | input, |
StartingPosition | startingPt = StartingPosition::Average |
||
) |
Continue the initialisation process once the InputProvider has been created.
Definition at line 98 of file VulkanWrapper.cpp.
int VulkanWrapper::getAttachmentSize | ( | ) |
Get the number of attachment required by view by getting it from the window. Usually it's the size of the number of images in the swapchain. (or max of this if there is multiple swapchain)
Definition at line 447 of file VulkanWrapper.cpp.
std::vector< bool > VulkanWrapper::getCameraActivation | ( | ) |
Return which input cameras are activated
Definition at line 209 of file VulkanWrapper.cpp.
VulkanContext * VulkanWrapper::getContext | ( | ) |
Return the VulkanContext class
Definition at line 394 of file VulkanWrapper.cpp.
const std::vector< glm::vec3 > VulkanWrapper::getCorrectionVectorRotation | ( | ) |
Return the vector related to rotation
Definition at line 539 of file VulkanWrapper.cpp.
vk::Format VulkanWrapper::getDepthSwapchainFormat | ( | int | view = 0 | ) |
Return the format selected by the swapchain for depth
Definition at line 433 of file VulkanWrapper.cpp.
const std::vector< InputProvider::StreamFrameInfo > VulkanWrapper::getFramesInfo | ( | int | view | ) |
Retrieve the information from the InputProvider to render a new frame for the requested view
Definition at line 544 of file VulkanWrapper.cpp.
vk::ImageLayout VulkanWrapper::getLayoutAfterRenderpass | ( | ) |
Return the image layout where the image should be at the end of the rendering operation. In the case of WindowGLFW, it will be vk::ImageLayout::ePresentSrcKHR When used with an headset, it will be vk::ImageLayout::eColorAttachmentOptimal
Definition at line 438 of file VulkanWrapper.cpp.
vk::Extent2D VulkanWrapper::getRenderOutputExtent | ( | ) |
Return the size of theresult of the rendering
Definition at line 404 of file VulkanWrapper.cpp.
std::vector< vk::Format > VulkanWrapper::getRenderPassSupportedDepthFormats | ( | ) | const |
return the list of the depth format supported for the selected renderpass
Definition at line 94 of file VulkanWrapper.cpp.
vk::Extent2D VulkanWrapper::getSwapchainExtend | ( | int | view = 0 | ) |
Return the size of the swapchain for the requested view
Definition at line 399 of file VulkanWrapper.cpp.
vk::Format VulkanWrapper::getSwapchainFormat | ( | int | view = 0 | ) |
Return the format selected by the swapchain
Definition at line 428 of file VulkanWrapper.cpp.
int VulkanWrapper::getViewNumber | ( | ) |
Return the number of view required by the systems. Usually only one view when displayed on the screen, 2 for a stereographic headset and 4 if a certain openxr extension has been activated.
Definition at line 452 of file VulkanWrapper.cpp.
void VulkanWrapper::init | ( | ) |
Do the first step of the initialisation process of the VulkanWrapper. Start the initialization of the Window, Create the VulkanContext object, create the RenderingParameters class.
Definition at line 64 of file VulkanWrapper.cpp.
bool VulkanWrapper::isDepthOutputRecquired | ( | ) |
Return true if the depth has to be given as a result of the rendering
Definition at line 360 of file VulkanWrapper.cpp.
bool VulkanWrapper::isUsingDifferentViewSize | ( | ) |
Return true if view of different size are used
Definition at line 376 of file VulkanWrapper.cpp.
void VulkanWrapper::loadConfigurationsFromDisk | ( | ) |
Load the corrections to be applied on input from a json file
Definition at line 182 of file VulkanWrapper.cpp.
void VulkanWrapper::recreateSwapChain | ( | ) |
This function is called when the swapchain has to be recreated (mainly when the window size change)
Definition at line 289 of file VulkanWrapper.cpp.
void VulkanWrapper::saveConfigurationsToDisk | ( | ) |
Save the corrections to be applied on input in a json file
Definition at line 136 of file VulkanWrapper.cpp.
void VulkanWrapper::setAverageInputPosition | ( | std::vector< InputProvider::StreamFrameInfo > & | frameInfo | ) |
Calculate the position at the middle of the input camera array
Definition at line 457 of file VulkanWrapper.cpp.
void VulkanWrapper::setBlendingFactor | ( | float | blendingfactor | ) |
void VulkanWrapper::setCameraActivation | ( | std::vector< bool > | activation | ) |
Set which camera are activated
Definition at line 238 of file VulkanWrapper.cpp.
void VulkanWrapper::setCorrectionFocal | ( | int | camId, |
glm::vec2 | focals | ||
) |
Store an offset to be applied on the focal of one of the input camera
Definition at line 513 of file VulkanWrapper.cpp.
void VulkanWrapper::setCorrectionPrincipalPt | ( | int | camId, |
glm::vec2 | principalPt | ||
) |
Store an offset to be applied on the principal point of one of the input camera
Definition at line 523 of file VulkanWrapper.cpp.
void VulkanWrapper::setCorrectionRotation | ( | int | camId, |
glm::vec3 | rotationCorrection | ||
) |
Store an offset to be applied on the rotation of one of the input camera
Definition at line 493 of file VulkanWrapper.cpp.
void VulkanWrapper::setCorrectionTranslation | ( | int | camId, |
glm::vec3 | translationCorrection | ||
) |
Store an offset to be applied on the translation of one of the input camera
Definition at line 503 of file VulkanWrapper.cpp.
void VulkanWrapper::setScaleFactor | ( | float | scaleFactor | ) |
Set the scene at a certain scale
Definition at line 533 of file VulkanWrapper.cpp.
void VulkanWrapper::setTriangleThreshold | ( | float | triangleThreshold | ) |
Set the triangle threshold
Definition at line 370 of file VulkanWrapper.cpp.
void VulkanWrapper::start | ( | ) |
Call the mainloop function that is part of the WindowAbstract class
Definition at line 263 of file VulkanWrapper.cpp.
void VulkanWrapper::toggleCamera | ( | int | i | ) |
Activate/desactivate the specified input camera
Definition at line 214 of file VulkanWrapper.cpp.
void VulkanWrapper::updateSpaceTransform | ( | glm::vec3 | translation, |
glm::vec3 | rotation | ||
) |
Update the translation and rotation of the virtual view
Definition at line 310 of file VulkanWrapper.cpp.
void VulkanWrapper::updateSpaceTransform | ( | glm::vec3 | translation, |
glm::vec3 | rotation, | ||
glm::vec4 | fov, | ||
int | view | ||
) |
Update the translation, rotation as well as the field of view of the specified virtual view
Definition at line 603 of file VulkanWrapper.cpp.
void VulkanWrapper::waitIdle | ( | ) |
Wait for the device to be idle
Definition at line 317 of file VulkanWrapper.cpp.
VulkanContext VulkanWrapper::context |
Reference to the class that manges object and info related to vulkan context
Definition at line 194 of file VulkanWrapper.h.
bool VulkanWrapper::framebufferResized = false |
Put the true if the framebuffer was resized
Definition at line 177 of file VulkanWrapper.h.
const vk::Format VulkanWrapper::internal1DAttachmentFormat = vk::Format::eR32Sfloat |
Format for the attachment in 1D used internally (usually for the pseudo depth attachment)
Definition at line 182 of file VulkanWrapper.h.
const vk::Format VulkanWrapper::internalColorAttachmentFormat = vk::Format::eR8G8B8A8Unorm |
Format for the attachment in color used internally
Definition at line 180 of file VulkanWrapper.h.
const bool VulkanWrapper::multiviewSetup |
Usually at true when openxr is used
Definition at line 189 of file VulkanWrapper.h.
RenderingParameters VulkanWrapper::params |
Refrence to the class that manage the virtual parameters
Definition at line 197 of file VulkanWrapper.h.
const vk::Format VulkanWrapper::qualityAttachmentFormat = vk::Format::eR32Sfloat |
Format for the quality attachment in color used internally
Definition at line 184 of file VulkanWrapper.h.
bool VulkanWrapper::requireAverageInputPosition = true |
true if the avarage position has to be calculated
Definition at line 191 of file VulkanWrapper.h.