Unravel Engine C++ Reference
Loading...
Searching...
No Matches
gfx::frame_buffer Struct Reference

#include <frame_buffer.h>

Inheritance diagram for gfx::frame_buffer:
gfx::handle_impl< frame_buffer, frame_buffer_handle > gfx::ievictable

Public Member Functions

 frame_buffer ()=default
 
 frame_buffer (std::uint16_t _width, std::uint16_t _height, texture_format _format, std::uint32_t _texture_flags=BGFX_SAMPLER_U_CLAMP|BGFX_SAMPLER_V_CLAMP)
 
 frame_buffer (const std::vector< texture::ptr > &textures)
 
 frame_buffer (const std::vector< fbo_attachment > &textures)
 
 frame_buffer (void *_nwh, std::uint16_t _width, std::uint16_t _height, texture_format _format=texture_format::Count, texture_format _depth_format=texture_format::Count)
 
void populate (const std::vector< texture::ptr > &textures)
 
void populate (const std::vector< fbo_attachment > &textures)
 
auto get_size () const -> usize32_t
 
auto get_attachment (std::uint32_t index=0) const -> const fbo_attachment &
 
auto get_attachments () const -> const std::vector< fbo_attachment > &
 
auto get_texture (std::uint32_t index=0) const -> const gfx::texture::ptr &
 
auto get_attachment_count () const -> size_t
 
- Public Member Functions inherited from gfx::handle_impl< frame_buffer, frame_buffer_handle >
 handle_impl ()=default
 
 handle_impl (const handle_impl &)=delete
 
 handle_impl (handle_impl &&)=delete
 
auto operator= (const handle_impl &) -> handle_impl &=delete
 
auto operator= (handle_impl &&) -> handle_impl &=delete
 
 ~handle_impl () override
 
void dispose ()
 
auto is_valid () const -> bool
 
auto native_handle () const -> frame_buffer_handle
 
void set_name (const hpp::string_view &_name)
 
auto on_evict () -> std::uint64_t override
 Release the GPU handle. Returns the number of GPU bytes freed. Must be idempotent.
 
auto on_restore () -> bool override
 Recreate the GPU handle from the CPU backing. Returns true on success.
 
auto gpu_size () const -> std::uint64_t override
 Approximate GPU footprint of the resource in bytes.
 
- Public Member Functions inherited from gfx::ievictable
 ievictable ()=default
 
 ievictable (const ievictable &)=delete
 
auto operator= (const ievictable &) -> ievictable &=delete
 
 ievictable (ievictable &&)=delete
 
auto operator= (ievictable &&) -> ievictable &=delete
 
virtual ~ievictable ()=default
 
auto get_evict_class () const -> evict_class
 
auto get_evict_state () const -> evict_state
 
auto get_last_use_frame () const -> std::uint64_t
 
auto get_use_count () const -> std::uint64_t
 
void touch () const noexcept
 

Additional Inherited Members

- Public Types inherited from gfx::handle_impl< frame_buffer, frame_buffer_handle >
using ptr
 
using uptr
 
using weak_ptr
 
using handle_type_t
 
using base_type
 
- Static Public Member Functions inherited from gfx::handle_impl< frame_buffer, frame_buffer_handle >
static auto invalid_handle () -> frame_buffer_handle
 
- Protected Member Functions inherited from gfx::handle_impl< frame_buffer, frame_buffer_handle >
auto fallback_handle () const -> frame_buffer_handle
 
auto get_fallback_handle () const -> frame_buffer_handle
 
void make_evictable (std::uint64_t gpu_bytes, std::function< bool(frame_buffer &)> restore_fn, evict_class cls=evict_class::evictable)
 
void make_evictable_deferred (std::uint64_t gpu_bytes, std::function< bool(frame_buffer &)> restore_fn, evict_class cls=evict_class::evictable)
 
- Protected Attributes inherited from gfx::handle_impl< frame_buffer, frame_buffer_handle >
frame_buffer_handle handle_
 
std::function< bool(frame_buffer &)> restore_fn_
 
std::uint64_t gpu_size_
 
- Protected Attributes inherited from gfx::ievictable
std::uint64_t last_use_frame_ {0}
 Frame the resource was last used on (heuristic, written from touch).
 
std::uint64_t use_count_ {0}
 Number of times the resource was used (heuristic, written from touch).
 
evict_state evict_state_ {evict_state::resident}
 Current residency state. Written by the owning resource during evict/restore.
 
evict_class evict_class_ {evict_class::non_evictable}
 Eligibility class. Set once when the resource opts into eviction.
 

Detailed Description

Definition at line 22 of file frame_buffer.h.

Constructor & Destructor Documentation

◆ frame_buffer() [1/5]

gfx::frame_buffer::frame_buffer ( )
default

◆ frame_buffer() [2/5]

gfx::frame_buffer::frame_buffer ( std::uint16_t _width,
std::uint16_t _height,
texture_format _format,
std::uint32_t _texture_flags = BGFX_SAMPLER_U_CLAMP | BGFX_SAMPLER_V_CLAMP )

Definition at line 8 of file frame_buffer.cpp.

◆ frame_buffer() [3/5]

gfx::frame_buffer::frame_buffer ( const std::vector< texture::ptr > & textures)

Definition at line 18 of file frame_buffer.cpp.

◆ frame_buffer() [4/5]

gfx::frame_buffer::frame_buffer ( const std::vector< fbo_attachment > & textures)

Definition at line 23 of file frame_buffer.cpp.

◆ frame_buffer() [5/5]

gfx::frame_buffer::frame_buffer ( void * _nwh,
std::uint16_t _width,
std::uint16_t _height,
texture_format _format = texture_format::Count,
texture_format _depth_format = texture_format::Count )

Member Function Documentation

◆ get_attachment()

auto gfx::frame_buffer::get_attachment ( std::uint32_t index = 0) const -> const fbo_attachment&
nodiscard

Definition at line 80 of file frame_buffer.cpp.

◆ get_attachment_count()

auto gfx::frame_buffer::get_attachment_count ( ) const -> size_t
nodiscard

Definition at line 96 of file frame_buffer.cpp.

◆ get_attachments()

auto gfx::frame_buffer::get_attachments ( ) const -> const std::vector<fbo_attachment>&
nodiscard

Definition at line 85 of file frame_buffer.cpp.

◆ get_size()

auto gfx::frame_buffer::get_size ( ) const -> usize32_t
nodiscard

Definition at line 75 of file frame_buffer.cpp.

◆ get_texture()

auto gfx::frame_buffer::get_texture ( std::uint32_t index = 0) const -> const gfx::texture::ptr&
nodiscard

Definition at line 91 of file frame_buffer.cpp.

◆ populate() [1/2]

void gfx::frame_buffer::populate ( const std::vector< fbo_attachment > & textures)

Definition at line 54 of file frame_buffer.cpp.

◆ populate() [2/2]

void gfx::frame_buffer::populate ( const std::vector< texture::ptr > & textures)

Definition at line 39 of file frame_buffer.cpp.


The documentation for this struct was generated from the following files: