|
Estella 0.113.0
A fast 2D and 3D game engine powered by WebAssembly and ECS
|
#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 |
Definition at line 53 of file SkinCache.hpp.
|
explicit |
Definition at line 94 of file SkinCache.cpp.
Referenced by SkinCache(), and operator=().
| esengine::SkinCache::~SkinCache | ( | ) |
Definition at line 96 of file SkinCache.cpp.
References esengine::Invalid.
|
delete |
References SkinCache().
| 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().
| 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.
| 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.
|
inline |
Definition at line 88 of file SkinCache.hpp.
Referenced by esengine::renderer_getSkinCacheStat().
|
inline |
Definition at line 96 of file SkinCache.hpp.
Referenced by esengine::renderer_getSkinCacheStat().
|
inline |
Definition at line 89 of file SkinCache.hpp.
Referenced by esengine::renderer_getSkinCacheStat().
|
inline |
Whether this frame scheduled anything to pose.
Definition at line 83 of file SkinCache.hpp.
|
inline |
A draw this frame read a posed copy instead of posing its mesh itself.
Definition at line 95 of file SkinCache.hpp.
References SkinCache().
|
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().
| void esengine::SkinCache::run | ( | ) |
Uploads this frame's poses and dispatches the kernel for each. Outside a render pass.
Definition at line 223 of file SkinCache.cpp.
References ES_LOG_ERROR, esengine::Invalid, esengine::Storage, esengine::GfxComputeBinding::storage(), esengine::GfxComputeBinding::storageRead(), esengine::GfxContent::transient(), esengine::GfxComputeBinding::uniform(), and esengine::WGSL.
| 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).
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.
|
inline |
Meshes this frame posed by the cache.
Definition at line 93 of file SkinCache.hpp.
Referenced by esengine::renderer_getSkinCacheStat().
|
inline |
Definition at line 60 of file SkinCache.hpp.
References settings().
|
inline |
Definition at line 61 of file SkinCache.hpp.
Referenced by setSettings().
| 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.