55 [[nodiscard]]
virtual auto gpu_size() const ->
std::uint64_t = 0;
98 std::uint32_t evict_slot_{UINT32_MAX};
100 std::uint64_t evict_frame_{0};
ievictable(ievictable &&)=delete
virtual auto gpu_size() const -> std::uint64_t=0
Approximate GPU footprint of the resource in bytes.
auto operator=(const ievictable &) -> ievictable &=delete
auto get_evict_class() const -> evict_class
virtual auto on_restore() -> bool=0
Recreate the GPU handle from the CPU backing. Returns true on success.
evict_class evict_class_
Eligibility class. Set once when the resource opts into eviction.
std::uint64_t last_use_frame_
Frame the resource was last used on (heuristic, written from touch).
virtual auto on_evict() -> std::uint64_t=0
Release the GPU handle. Returns the number of GPU bytes freed. Must be idempotent.
void touch() const noexcept
evict_state evict_state_
Current residency state. Written by the owning resource during evict/restore.
std::uint64_t use_count_
Number of times the resource was used (heuristic, written from touch).
ievictable(const ievictable &)=delete
auto operator=(ievictable &&) -> ievictable &=delete
auto get_evict_state() const -> evict_state
auto get_use_count() const -> std::uint64_t
virtual ~ievictable()=default
auto get_last_use_frame() const -> std::uint64_t
std::uint64_t g_eviction_frame
evict_class
Eviction eligibility of a tracked resource.
@ non_evictable
No CPU backing (render targets, uniforms, ...). Never registered.
@ evictable
May be evicted by a sweep.
evict_state
Residency state of a GPU resource tracked by the eviction system.
@ evicted
GPU handle was destroyed; a CPU-side backing is retained for restore.
@ resident
GPU handle is live and usable.
Hash specialization for batch_key to enable use in std::unordered_map.