|
Estella 0.113.0
A fast 2D and 3D game engine powered by WebAssembly and ECS
|
#include <MeshArena.hpp>
Classes | |
| struct | Slot |
| struct | Binding |
Public Member Functions | |
| void | init (GfxDevice &device) |
| void | shutdown () |
| bool | place (const VertexLayoutDesc &layout, GfxContent content, ConstSpan< u8 > vertexBytes, u32 stride, ConstSpan< u32 > indices, Slot &slot, Binding &binding) |
| Places a mesh: its vertices copied into a page of its shape, its indices rebased onto the page's. | |
| void | free (const Slot &slot) |
| u32 | pageCount () const |
| u64 | pageBytes () const |
Static Public Member Functions | |
| static bool | sameLayout (const VertexLayoutDesc &a, const VertexLayoutDesc &b) |
Static Public Attributes | |
| static constexpr u32 | kFirstPageBytes = 1u << 20 |
| static constexpr u32 | kMaxPageBytes = 32u << 20 |
Definition at line 33 of file MeshArena.hpp.
|
inline |
Gives a placed mesh's ranges back; a page left empty is deleted.
Definition at line 128 of file MeshArena.hpp.
References esengine::resource::MeshArena::Slot::firstIndex, esengine::resource::MeshArena::Slot::firstVertex, esengine::resource::MeshArena::Slot::indexCount, esengine::resource::MeshArena::Slot::page, and esengine::resource::MeshArena::Slot::vertexCount.
|
inline |
Definition at line 56 of file MeshArena.hpp.
|
inline |
Definition at line 144 of file MeshArena.hpp.
|
inline |
Pages standing, for a profiler: how many and the bytes they hold on the GPU.
Definition at line 139 of file MeshArena.hpp.
|
inline |
Places a mesh: its vertices copied into a page of its shape, its indices rebased onto the page's.
Definition at line 70 of file MeshArena.hpp.
References esengine::resource::MeshArena::Slot::firstIndex, esengine::resource::MeshArena::Slot::firstVertex, esengine::resource::MeshArena::Binding::indexBuffer, esengine::resource::MeshArena::Slot::indexCount, kFirstPageBytes, kMaxPageBytes, esengine::resource::MeshArena::Binding::layout, esengine::resource::MeshArena::Slot::page, sameLayout(), esengine::resource::MeshArena::Binding::vertexBuffer, and esengine::resource::MeshArena::Slot::vertexCount.
|
inlinestatic |
Definition at line 150 of file MeshArena.hpp.
References esengine::VertexLayoutDesc::attributeCount, esengine::VertexLayoutDesc::attributes, esengine::GfxVertexAttribute::bufferSlot, esengine::GfxVertexAttribute::components, esengine::VertexLayoutDesc::instanceStep, esengine::GfxVertexAttribute::location, esengine::MAX_VERTEX_BUFFER_SLOTS, esengine::GfxVertexAttribute::normalized, esengine::GfxVertexAttribute::offset, esengine::VertexLayoutDesc::strides, and esengine::GfxVertexAttribute::type.
Referenced by place().
|
inline |
Deletes every page. The meshes in them are gone already, or are about to be.
Definition at line 59 of file MeshArena.hpp.
|
staticconstexpr |
The first page of a shape holds this much, and each one after it twice the last, up to kMaxPageBytes: a game with one small model does not pay for a page sized for a city.
Definition at line 53 of file MeshArena.hpp.
Referenced by place().
|
staticconstexpr |
Definition at line 54 of file MeshArena.hpp.
Referenced by place().