core::data::framebuffer::attachment class final

describes a single rendertarget in a framebuffer.

all data contained within this object is not guaranteed to be loaded, this includes the UID of the core::gfx::texture. You should take caution when calling methods that manipulate the contained resources for this reason.

types

classes

description
describes how the rendertarget should be loaded, stored, it's sample count, and what transition layouts it should go through.

constructors, destructors, conversion operators

attachment
constructs an attachment based on the given texture and values.
public

member-functions

texture
returns the UID assigned to this render attachment.
const public
clear_value
returns the clear value assigned to this attachment.
const public
vkDescription
returns a vk::AttachmentDescription based on the internal settings. This is a passthrough method to the core::data::framebuffer::attachment::description instance.
const public
shared
signifies if this specific attachment duplicated when the framebuffer's image count is larger than 1.
const public

Function documentation

core::data::framebuffer::attachment::attachment(const UID& texture, const vk::ClearValue& clear_col, vk::AttachmentDescription descr, bool shared = false)

Brief

constructs an attachment based on the given texture and values.

Details

Parameters
texture in a UID pointing to a valid (known or constructed), core::gfx::texture object.
clear_col in the clear value to assign to this render texture.
descr in the attachment description that will be used to construct the core::data::framebuffer::attachment::description.
shared in value indicating if this render attachment is shared within this framebuffer (see core::data::framebuffer::attachment::shared() for more info).

const UID& core::data::framebuffer::attachment::texture() const

Brief

returns the UID assigned to this render attachment.

Details

Returns the UID assigned to this render attachment.

const vk::ClearValue& core::data::framebuffer::attachment::clear_value() const

Brief

returns the clear value assigned to this attachment.

Returns the clear value assigned to this attachment.

vk::AttachmentDescription core::data::framebuffer::attachment::vkDescription() const

Brief

returns a vk::AttachmentDescription based on the internal settings. This is a passthrough method to the core::data::framebuffer::attachment::description instance.

Returns a vk::AttachmentDescription based on the internal settings.

bool core::data::framebuffer::attachment::shared() const

Brief

signifies if this specific attachment duplicated when the framebuffer's image count is larger than 1.

Details

Sometimes you don't need a render attachment to have a unique instance per framebuffer entry (for example depth testing/texture in a double buffer scenario). in this case you can set this render attachment to be "shared", a flag that will tell the implementation that rather than creating a new instance for when the framebuffer count is larger than 1, it should instead reuse the current one.

Returns true if this attachment is duplicated (true) or not (false).