Unravel Engine C++ Reference
Loading...
Searching...
No Matches
eviction.h File Reference
#include "evictable.h"
#include "graphics.h"
#include <memory>
#include <vector>

Go to the source code of this file.

Classes

struct  gfx::eviction::budget_state
 
struct  gfx::eviction::config
 Configuration for a single eviction pass. More...
 
struct  gfx::eviction::stats
 Cumulative and last-pass statistics reported by the eviction system. More...
 

Namespaces

namespace  gfx
 
namespace  gfx::eviction
 

Typedefs

using gfx::eviction::backing_buffer = std::shared_ptr<std::vector<std::uint8_t>>
 

Enumerations

enum class  gfx::eviction::init_status : std::uint8_t { gfx::eviction::ok , gfx::eviction::unnecessary , gfx::eviction::unsupported , gfx::eviction::failed }
 Result of init. Determines whether the system tracks resources at all. More...
 
enum class  gfx::eviction::strategy : std::uint8_t { gfx::eviction::lru , gfx::eviction::lfu , gfx::eviction::largest_first , gfx::eviction::age_ttl }
 Selection policy used by a sweep to choose eviction victims. More...
 
enum class  gfx::eviction::reclaim_result : std::uint8_t { gfx::eviction::headroom , gfx::eviction::reclaimed , gfx::eviction::insufficient }
 
enum class  gfx::eviction::reclaim_kind : std::uint8_t { gfx::eviction::evictable , gfx::eviction::immediate }
 Controls whether reclaim_for pumps the GPU command buffer after evicting. More...
 

Functions

auto gfx::eviction::make_backing (const void *data, std::uint32_t size) -> backing_buffer
 
void gfx::eviction::release_backing_ref (void *, void *user_data)
 
auto gfx::eviction::make_backing_ref (const backing_buffer &backing) -> const memory_view *
 
constexpr auto gfx::eviction::to_string (reclaim_result r) -> const char *
 Human-readable name for reclaim_result (for diagnostics / logging).
 
auto gfx::eviction::init (const config &cfg) -> init_status
 
auto gfx::eviction::is_supported () -> bool
 
void gfx::eviction::shutdown ()
 
auto gfx::eviction::evict (const config &cfg) -> stats
 
auto gfx::eviction::evict () -> stats
 Run a single eviction pass using the config supplied to init.
 
auto gfx::eviction::evict_bytes (std::uint64_t free_bytes, strategy strat, std::uint32_t min_age_frames, std::uint32_t max_evictions) -> stats
 
auto gfx::eviction::evict_all () -> stats
 
auto gfx::eviction::reclaim_for (std::uint64_t bytes, reclaim_kind kind) -> reclaim_result
 
auto gfx::eviction::would_allocation_fit (std::uint64_t bytes) -> bool
 
auto gfx::eviction::restore_all () -> stats
 
void gfx::eviction::set_budget (const budget_state &budget, std::uint64_t used_bytes)
 
auto gfx::eviction::current_budget () -> budget_state
 
auto gfx::eviction::peek_queued_bytes () -> std::uint64_t
 
auto gfx::eviction::peek_pending_release_bytes () -> std::uint64_t
 
auto gfx::eviction::peek_external_queued_bytes () -> std::uint64_t
 
void gfx::eviction::note_pending_allocation (std::uint64_t bytes)
 
void gfx::eviction::clear_queued_allocations ()
 
auto gfx::eviction::get_stats () -> stats
 Snapshot the current statistics.
 
void gfx::eviction::set_frame (std::uint64_t frame)
 Set the global frame counter (call once per presented frame).
 
void gfx::eviction::advance_frame ()
 Advance the global frame counter by one.
 
auto gfx::eviction::debug_consume_memory (std::uint64_t bytes) -> std::uint64_t
 
auto gfx::eviction::debug_simulate_budget (std::uint64_t target_free_bytes) -> std::uint64_t
 
void gfx::eviction::debug_release_memory ()
 
auto gfx::eviction::debug_consumed_bytes () -> std::uint64_t
 Total bytes currently reserved by debug_consume_memory.
 
void gfx::eviction::register_resource (ievictable *resource)
 Begin tracking a resource (assumed resident). Called from handle_impl::make_evictable.
 
void gfx::eviction::register_evicted_resource (ievictable *resource)
 
void gfx::eviction::unregister_resource (ievictable *resource)
 Stop tracking a resource. Called from handle_impl's destructor.
 
void gfx::eviction::restore_resource (ievictable *resource)