Estella 0.113.0
A fast 2D and 3D game engine powered by WebAssembly and ECS
Loading...
Searching...
No Matches
esengine::SkinCache Class Reference

#include <SkinCache.hpp>

Public Member Functions

 SkinCache (GfxDevice &device)
 ~SkinCache ()
 SkinCache (const SkinCache &)=delete
SkinCache & operator= (const SkinCache &)=delete
void setSettings (const SkinCacheSettings &settings)
const SkinCacheSettings & settings () const
bool active () const
bool wants (SkinCacheUsage usage) const
void beginFrame (u64 frame)
BufferHandle schedule (Entity entity, const Mesh &mesh, const glm::mat4 *pose, u32 joints)
 Schedules entity's skin for this frame, posed by pose (one matrix a joint: joint world times inverse bind).
BufferHandle bufferFor (Entity entity) const
bool hasWork () const
void run ()
u64 bytesUsed () const
u32 entryCount () const
u32 refusedThisFrame () const
u32 scheduledThisFrame () const
void noteDraw ()
u32 drawsThisFrame () const

Detailed Description

Definition at line 53 of file SkinCache.hpp.

Constructor & Destructor Documentation

◆ SkinCache() [1/2]

esengine::SkinCache::SkinCache ( GfxDevice & device)
explicit

Definition at line 94 of file SkinCache.cpp.

Referenced by SkinCache(), and operator=().

◆ ~SkinCache()

esengine::SkinCache::~SkinCache ( )

Definition at line 96 of file SkinCache.cpp.

References esengine::Invalid.

◆ SkinCache() [2/2]

esengine::SkinCache::SkinCache ( const SkinCache & )
delete

References SkinCache().

Member Function Documentation

◆ active()

bool esengine::SkinCache::active ( ) const

Whether anything can go through it: the project turned it on and the device computes.

Definition at line 101 of file SkinCache.cpp.

Referenced by esengine::renderer_getSkinCacheStat(), schedule(), and wants().

◆ beginFrame()

void esengine::SkinCache::beginFrame ( u64 frame)

Opens a frame's schedule. An entry no frame has asked for in a while is released.

Definition at line 110 of file SkinCache.cpp.

◆ bufferFor()

BufferHandle esengine::SkinCache::bufferFor ( Entity entity) const

The buffer entity's draws read this frame; Invalid when it was not scheduled this frame.

Definition at line 218 of file SkinCache.cpp.

References esengine::Invalid, and esengine::Entity::raw.

◆ bytesUsed()

u64 esengine::SkinCache::bytesUsed ( ) const
inline

Definition at line 88 of file SkinCache.hpp.

Referenced by esengine::renderer_getSkinCacheStat().

◆ drawsThisFrame()

u32 esengine::SkinCache::drawsThisFrame ( ) const
inline

Definition at line 96 of file SkinCache.hpp.

Referenced by esengine::renderer_getSkinCacheStat().

◆ entryCount()

u32 esengine::SkinCache::entryCount ( ) const
inline

Definition at line 89 of file SkinCache.hpp.

Referenced by esengine::renderer_getSkinCacheStat().

◆ hasWork()

bool esengine::SkinCache::hasWork ( ) const
inline

Whether this frame scheduled anything to pose.

Definition at line 83 of file SkinCache.hpp.

◆ noteDraw()

void esengine::SkinCache::noteDraw ( )
inline

A draw this frame read a posed copy instead of posing its mesh itself.

Definition at line 95 of file SkinCache.hpp.

◆ operator=()

SkinCache & esengine::SkinCache::operator= ( const SkinCache & )
delete

References SkinCache().

◆ refusedThisFrame()

u32 esengine::SkinCache::refusedThisFrame ( ) const
inline

Meshes this frame that wanted the cache and were refused by the budget.

Definition at line 91 of file SkinCache.hpp.

Referenced by esengine::renderer_getSkinCacheStat().

◆ run()

void esengine::SkinCache::run ( )

◆ schedule()

BufferHandle esengine::SkinCache::schedule ( Entity entity,
const Mesh & mesh,
const glm::mat4 * pose,
u32 joints )

Schedules entity's skin for this frame, posed by pose (one matrix a joint: joint world times inverse bind).

Returns
The buffer its draws read this frame, or Invalid where it is posed in the vertex stage instead: the cache is not active, the mesh carries no source, or it would take the cache past its budget.

Definition at line 183 of file SkinCache.cpp.

References active(), esengine::Invalid, esengine::Mesh::isMorphable(), esengine::MeshSkinLayout::joints, esengine::MeshSkinLayout::position, esengine::Entity::raw, esengine::Mesh::revision, esengine::Mesh::skinLayout, esengine::Mesh::skinSource, esengine::MeshSkinLayout::stride, esengine::Mesh::vertexCount, and esengine::MeshSkinLayout::weights.

◆ scheduledThisFrame()

u32 esengine::SkinCache::scheduledThisFrame ( ) const
inline

Meshes this frame posed by the cache.

Definition at line 93 of file SkinCache.hpp.

Referenced by esengine::renderer_getSkinCacheStat().

◆ setSettings()

void esengine::SkinCache::setSettings ( const SkinCacheSettings & settings)
inline

Definition at line 60 of file SkinCache.hpp.

References settings().

◆ settings()

const SkinCacheSettings & esengine::SkinCache::settings ( ) const
inline

Definition at line 61 of file SkinCache.hpp.

Referenced by setSettings().

◆ wants()

bool esengine::SkinCache::wants ( SkinCacheUsage usage) const

Whether a mesh whose MeshSkin says usage goes through it, by the settings.

Definition at line 105 of file SkinCache.cpp.

References active(), esengine::Disabled, esengine::Enabled, and esengine::Inclusive.


The documentation for this class was generated from the following files:
  • /home/runner/work/estella/estella/src/esengine/renderer/frame/SkinCache.hpp
  • /home/runner/work/estella/estella/src/esengine/renderer/frame/SkinCache.cpp