HoviTron Video Pipeline
Public Member Functions | Data Fields
ImageStruct Struct Reference

Struct that aims to facilitate the creation of image, their view and memory. More...

#include <VulkanRenderPassAbstract.h>

Public Member Functions

void destroy (vk::Device &device)
 
void createStruct (VulkanContext *context, vk::Extent2D &renderingExtent, vk::Format format, vk::ImageUsageFlags imageUsage, vk::MemoryPropertyFlags memoryProperty, vk::CommandPool &commandPool, vk::ImageLayout finalLayout, vk::ImageAspectFlags imageAspect=vk::ImageAspectFlagBits::eColor)
 

Data Fields

vk::Image image
 
vk::DeviceMemory memory
 
vk::ImageView imageView
 
std::string name
 

Detailed Description

Struct that aims to facilitate the creation of image, their view and memory.

Struct that aims to facilitate the creation of image, their view and memory.

Definition at line 40 of file VulkanRenderPassAbstract.h.

Member Function Documentation

◆ createStruct()

void ImageStruct::createStruct ( VulkanContext context,
vk::Extent2D &  renderingExtent,
vk::Format  format,
vk::ImageUsageFlags  imageUsage,
vk::MemoryPropertyFlags  memoryProperty,
vk::CommandPool &  commandPool,
vk::ImageLayout  finalLayout,
vk::ImageAspectFlags  imageAspect = vk::ImageAspectFlagBits::eColor 
)
inline

Create the image view, the image and the associated memory and put the image in the layout requested

Definition at line 59 of file VulkanRenderPassAbstract.h.

60 {
61 createImage(context->device, context->physicalDevice, renderingExtent.width, renderingExtent.height, format,
62 vk::ImageTiling::eOptimal, imageUsage, memoryProperty, image, memory);
63 imageView = createImageView(context->device, image, format, imageAspect);
64 transitionImageLayout(context, commandPool, image, format, vk::ImageLayout::eUndefined, finalLayout);
65 }
vk::PhysicalDevice physicalDevice
Definition: VulkanContext.h:85
vk::Device device
Definition: VulkanContext.h:87
vk::ImageView imageView
vk::DeviceMemory memory

◆ destroy()

void ImageStruct::destroy ( vk::Device &  device)
inline

Destroy the image view, the image and their associated memory

Definition at line 53 of file VulkanRenderPassAbstract.h.

53 {
54 device.destroyImageView(imageView);
55 device.destroyImage(image);
56 device.freeMemory(memory);
57 };

Field Documentation

◆ image

vk::Image ImageStruct::image

The vk::Image

Definition at line 42 of file VulkanRenderPassAbstract.h.

◆ imageView

vk::ImageView ImageStruct::imageView

The view associated to the image

Definition at line 46 of file VulkanRenderPassAbstract.h.

◆ memory

vk::DeviceMemory ImageStruct::memory

The memory associated to the image

Definition at line 44 of file VulkanRenderPassAbstract.h.

◆ name

std::string ImageStruct::name

Definition at line 50 of file VulkanRenderPassAbstract.h.


The documentation for this struct was generated from the following file: