![]() |
Raven Engine v0.1
|
Vulkan implementation of the Framebuffer abstraction. More...
#include <VulkanFramebuffer.h>
Public Member Functions | |
| VulkanFramebuffer (const FramebufferSpecification &spec) | |
| Constructs a VulkanFramebuffer based on the given specification. | |
| virtual | ~VulkanFramebuffer () |
| Destructor. Cleans up Vulkan framebuffer resources. | |
| void | Resize (u32 width, u32 height, bool forceRecreate=false) override |
| Resize the framebuffer dimensions. | |
| void | AddResizeCallback (const std::function< void(Ref< Framebuffer >)> &func) override |
| Registers a callback to be invoked when the framebuffer is resized. | |
| FramebufferSpecification & | GetSpecification () override |
| Returns a mutable reference to the framebuffer specification. | |
| const FramebufferSpecification & | GetSpecification () const override |
| Returns a const reference to the framebuffer specification. | |
| VkRenderPass | GetVulkanRenderPass () const |
| Returns the Vulkan render pass handle used by this framebuffer. | |
| VkFramebuffer | GetVulkanFramebuffer (u32 index=0) const |
| Retrieves the Vulkan framebuffer handle. | |
| void | Invalidate () |
| Recreates and updates the Vulkan framebuffer and related resources. | |
| Ref< Image2D > | GetDepthImage () const override |
| Returns the depth attachment image. | |
| Ref< Image2D > | GetImage (u32 index) const override |
| Returns the color attachment image at the specified index. | |
| usize | GetColorAttachmentCount () const override |
| Returns the number of color attachments. | |
| bool | HasDepthAttachment () override |
| Indicates whether the framebuffer has a depth attachment. | |
| const std::vector< VkClearValue > & | GetVulkanClearValues () const |
| Returns the Vulkan clear values associated with this framebuffer. | |
| void | Release () override |
| Releases Vulkan framebuffer and associated resources. | |
| Public Member Functions inherited from Raven::Framebuffer | |
| virtual | ~Framebuffer ()=default |
| Public Member Functions inherited from Raven::Castable< Framebuffer > | |
| T & | As () |
| Non-const version of As<T>(), for casting to a non-const target type. | |
Additional Inherited Members | |
| Static Public Member Functions inherited from Raven::Framebuffer | |
| static Ref< Framebuffer > | Create (const FramebufferSpecification &spec) |
| Factory method to create a framebuffer from specification. | |
Vulkan implementation of the Framebuffer abstraction.
Manages Vulkan framebuffers, render passes, and associated images. Supports swapchain-targeted and offscreen framebuffers with depth and color attachments.
| Raven::VulkanFramebuffer::VulkanFramebuffer | ( | const FramebufferSpecification & | spec | ) |
Constructs a VulkanFramebuffer based on the given specification.
| spec | FramebufferSpecification describing attachments and parameters. |
|
virtual |
Destructor. Cleans up Vulkan framebuffer resources.
|
overridevirtual |
Registers a callback to be invoked when the framebuffer is resized.
Callbacks receive a Ref to the resized framebuffer.
| func | Callback function to register. |
Implements Raven::Framebuffer.
|
inlineoverridevirtual |
Returns the number of color attachments.
For swapchain targets this is always 1.
Implements Raven::Framebuffer.
Returns the depth attachment image.
Implements Raven::Framebuffer.
Returns the color attachment image at the specified index.
| index | Attachment index. |
Implements Raven::Framebuffer.
|
inlineoverridevirtual |
Returns a const reference to the framebuffer specification.
Implements Raven::Framebuffer.
|
inlineoverridevirtual |
Returns a mutable reference to the framebuffer specification.
Implements Raven::Framebuffer.
|
inline |
Returns the Vulkan clear values associated with this framebuffer.
Useful for vkCmdBeginRenderPass clear operations.
|
inline |
Retrieves the Vulkan framebuffer handle.
Returns swapchain framebuffer if targeting a swapchain, otherwise the offscreen framebuffer.
| index | Index for swapchain framebuffer (default 0). |
|
inline |
Returns the Vulkan render pass handle used by this framebuffer.
|
inlineoverridevirtual |
Indicates whether the framebuffer has a depth attachment.
Implements Raven::Framebuffer.
| void Raven::VulkanFramebuffer::Invalidate | ( | ) |
Recreates and updates the Vulkan framebuffer and related resources.
Called after resizing or specification changes.
|
overridevirtual |
Releases Vulkan framebuffer and associated resources.
Implements Raven::Framebuffer.
|
overridevirtual |
Resize the framebuffer dimensions.
Optionally forces recreation of the underlying Vulkan resources even if size hasn't changed.
| width | New width of the framebuffer. |
| height | New height of the framebuffer. |
| forceRecreate | Force recreation even if size is unchanged. |
Implements Raven::Framebuffer.