9 #ifndef TALVOS_RENDERPASS_H
10 #define TALVOS_RENDERPASS_H
14 #include "vulkan/vulkan_core.h"
28 : Dev(Dev), Width(Width), Height(Height), NumLayers(NumLayers),
29 Attachments(Attachments){};
75 : Attachments(Attachments), Subpasses(Subpasses){};
78 const VkAttachmentDescription &
getAttachment(uint32_t Index)
const;
101 : RP(RP), FB(FB), ClearValues(ClearValues),
Rendering(false){};
uint32_t getSubpassIndex() const
Returns the index of the current subpass.
const Subpass & getSubpass(uint32_t Index) const
Returns the subpass at index Index.
bool Rendering
Flag used to indicate whether the instance is currently rendering.
const Framebuffer & FB
The framebuffer associated with this render pass instance.
uint32_t DepthStencilAttachment
This structure describes the attachments used by a subpass.
Device & getDevice() const
Returns the device that this framebuffer is associated with.
RenderPass(const std::vector< VkAttachmentDescription > &Attachments, std::vector< Subpass > Subpasses)
Create a render pass from sets of attachment and subpass descriptions.
void beginSubpass()
Helper used to update render pass state when a new subpass is started.
std::vector< uint32_t > ResolveAttachments
void endSubpass()
Helper used to update render pass state when a subpass completes.
Framebuffer(Device &Dev, uint32_t Width, uint32_t Height, uint32_t NumLayers, const std::vector< ImageView * > &Attachments)
Create a framebuffer.
uint32_t getHeight() const
Returns the height of this framebuffer in pixels.
const Framebuffer & getFramebuffer() const
Returns the framebuffer associated with this render pass instance.
This class represents an instance of a render pass being used for drawing.
std::vector< uint32_t > InputAttachments
const RenderPass & RP
The render pass that this object instantiates.
This class represents a framebuffer that can be used for rendering.
uint32_t getWidth() const
Returns the width of this framebuffer in pixels.
uint32_t NumLayers
The numbers of layers in the framebuffer.
This class represents a Vulkan render pass.
A Device instance encapsulates properties and state for the virtual device.
void end()
Finalize the render pass state after completing all draw commands.
const std::vector< ImageView * > & getAttachments() const
Returns the list of attachments backing this framebuffer.
std::vector< ImageView * > Attachments
The framebuffer attachments.
const RenderPass & getRenderPass() const
Returns the render pass.
void begin()
Initialize the render pass state in preparation for draw commands.
RenderPassInstance(const RenderPass &RP, const Framebuffer &FB, const std::vector< VkClearValue > &ClearValues)
Create a render pass instance from a render pass and a framebuffer.
std::vector< uint32_t > ColorAttachments
std::vector< VkClearValue > ClearValues
The clear values used for this render pass instance.
uint32_t getNumLayers() const
Returns the number of layers in this framebuffer.
void nextSubpass()
Transition to the next subpass.
Device & Dev
The device this framebuffer belongs to.
std::vector< bool > AttachmentsInitialized
Flags denoting whether each attachment has been initialized yet.
uint32_t Height
The height of the framebuffer in pixels.
const std::vector< Subpass > Subpasses
The subpasses contained in this render pass.
uint32_t getNumAttachments() const
Returns the number of attachments in this render pass.
std::vector< uint32_t > PreserveAttachments
std::vector< VkAttachmentDescription > Attachments
The attachments used by this render pass.
const VkAttachmentDescription & getAttachment(uint32_t Index) const
Returns the attachment at index Index.
uint32_t SubpassIndex
The index of the current subpass.
uint32_t Width
The width of the framebuffer in pixels.