Vulkan Engine 0.0
A simple Vulkan engine demo
|
Attachment for a render pass. More...
#include <attachment.hpp>
Public Member Functions | |
Attachment (EngineDevice &device, VkFormat format, uint32_t width, uint32_t height, VkImageUsageFlags usage, VkImageAspectFlags aspect_mask, VkImageLayout final_layout, VkImageLayout att_layout, uint32_t att_index, bool reduce_size) | |
Initializes the Attachment object, given all the required metadata. More... | |
~Attachment () | |
void | set_size (uint32_t w, uint32_t h) |
In case the viewport size changes during runtime (IE: resizing the game window), this method can be used to set its new size without needing to manually destroy and re-create the object. More... | |
VkSampler & | get_sampler () |
VkImage & | get_image () |
VkImageView & | get_image_view () |
uint32_t | get_index () const |
VkAttachmentReference & | get_reference () |
VkAttachmentDescription & | get_description () |
Attachment (const Attachment &)=delete | |
Attachment & | operator= (const Attachment &)=delete |
Attachment (Attachment &&)=delete | |
Attachment & | operator= (Attachment &&)=delete |
Attachment for a render pass.
This class is responsible for managing the Vulkan image and image view, as well as its allocation and any other metadata required to define a render pass attachment. In case the resulting image needs to be read, it can also generate an appropriate sampler.
|
inline |
Initializes the Attachment object, given all the required metadata.
Some parameters are set to sane defaults that never need to change so they're not required in the constructor.
width | width of the viewport |
height | height of the viewport |
reduce_size | some render passes need an attachment half the size of the regular viewport size. In this case, the full width and height of the viewport are passed to this constructor, and this flag is set to true. This makes the code more consistent. |
|
inline |
|
delete |
|
delete |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
delete |
|
delete |
|
inline |
In case the viewport size changes during runtime (IE: resizing the game window), this method can be used to set its new size without needing to manually destroy and re-create the object.
Instead this method will take care of it.