core::data::framebuffer_t class final

container class that describes the data to create a set of rendertargets.

types

classes

attachment
describes a single rendertarget in a framebuffer.

constructors, destructors, conversion operators

framebuffer_t
basic constructor that sets up the rough outlines of an instance
public noexcept

member-functions

add
adds a core::data::framebuffer_t::attachment to the current framebuffer.
public
remove
removes the attachment that is using this psl::UID for its texture.
public
set
sets the sampler associated with this framebuffer
public
attachments
gets all attachments currently assigned to this framebuffer.
const public
framebuffers
returns the framebuffer count (layers).
const public
sampler
returns the sampler associated with this framebuffer (if it has been set).
const public
width
returns the width of the framebuffer object.
const public
height
returns the height of the framebuffer object.
const public

Function documentation

core::data::framebuffer_t::framebuffer_t(core::resource::cache_t& cache, const core::resource::metadata& metaData, psl::meta::file* metaFile, uint32_t width, uint32_t height, uint32_t layers = 1u) noexcept

Brief

basic constructor that sets up the rough outlines of an instance

Details

Parameters
cache in signifies in which cache I will be constructed in.
metaData in the metadata that is assigned to this object
metaFile in the metafile associated with this instance
width in the width in pixels of this framebuffer.
height in the height in pixels of this framebuffer.
layers in the amount of layers this framebuffer will have (often referred to as the framebuffer count in the documentation).

const psl::UID& core::data::framebuffer_t::add(uint32_t width, uint32_t height, uint32_t layerCount, core::gfx::image::usage usage, core::gfx::clear_value clearValue, core::gfx::attachment descr)

Brief

adds a core::data::framebuffer_t::attachment to the current framebuffer.

Details

Parameters
width in the width of the attachment in pixels.
height in the height of the attachment in pixels.
layerCount in the depth layers of the attachment.
usage in signifies how the image will be used.
clearValue in the value to clear the image with at the start of rendering.
descr in how the image load op's etc... will be handled.

bool core::data::framebuffer_t::remove(const psl::UID& uid)

Brief

removes the attachment that is using this psl::UID for its texture.

Parameters
uid in the psl::UID to search for
Returns true in case it found and removed atleast one attachment with the given UID.

void core::data::framebuffer_t::set(core::resource::handle<core::gfx::sampler_t> sampler)

Brief

sets the sampler associated with this framebuffer

Details

Parameters
sampler in a valid sampler resource

const std::vector<attachment>& core::data::framebuffer_t::attachments() const

Brief

gets all attachments currently assigned to this framebuffer.

Returns all attachments currently assigned to this framebuffer.

uint32_t core::data::framebuffer_t::framebuffers() const

Brief

returns the framebuffer count (layers).

Returns the framebuffer count (layers).

std::optional<psl::UID> core::data::framebuffer_t::sampler() const

Brief

returns the sampler associated with this framebuffer (if it has been set).

Returns the sampler associated with this framebuffer (if it has been set).