|
Estella 0.113.0
A fast 2D and 3D game engine powered by WebAssembly and ECS
|
#include <PerDrawBlocks.hpp>
Classes | |
| struct | Range |
| Where one draw's block was staged; a default one binds the zero block. More... | |
Public Member Functions | |
| void | init (GfxDevice &device, u32 blockSize) |
Claims the pool for blocks of blockSize bytes, plus the zero one. | |
| void | shutdown () |
| Releases every page and the zero block while the device is alive. | |
| void | beginFrame () |
| Hands every range back. Called once per FRAME — see the file note. | |
| Range | stage (const void *bytes, u32 size) |
Copies size bytes of bytes into a range of this frame's, to reach the GPU at the next upload(); a block it cannot hold stages nothing. | |
| void | upload () |
| Sends what was staged since the last upload, one write per page. | |
| void | bind (u32 slot, Range range) const |
Binds range to slot — the zero block for a range staging refused. | |
| void | bindZero (u32 slot) const |
| Binds what a draw with nothing to say reads: zeroed once and never written, so "none" is an object rather than an erasure. | |
| u32 | used () const |
| Ranges this frame has handed out — a per-frame cost, for the profile. | |
Definition at line 29 of file PerDrawBlocks.hpp.
|
inline |
Hands every range back. Called once per FRAME — see the file note.
Definition at line 67 of file PerDrawBlocks.hpp.
Binds range to slot — the zero block for a range staging refused.
Definition at line 117 of file PerDrawBlocks.hpp.
References bindZero(), esengine::PerDrawBlocks::Range::offset, and esengine::PerDrawBlocks::Range::page.
Referenced by esengine::DrawList::execute().
|
inline |
Binds what a draw with nothing to say reads: zeroed once and never written, so "none" is an object rather than an erasure.
Definition at line 128 of file PerDrawBlocks.hpp.
Referenced by bind().
Claims the pool for blocks of blockSize bytes, plus the zero one.
Definition at line 38 of file PerDrawBlocks.hpp.
References esengine::GfxDevice::createBuffer(), esengine::GfxContent::retained(), shutdown(), and esengine::Uniform.
|
inline |
Releases every page and the zero block while the device is alive.
Definition at line 53 of file PerDrawBlocks.hpp.
References esengine::Invalid.
Referenced by init().
Copies size bytes of bytes into a range of this frame's, to reach the GPU at the next upload(); a block it cannot hold stages nothing.
The next range starts after the bytes staged: a draw reads only what it was given, so the rest of its binding may be the next draw's. Grows rather than wraps, which would share a range.
Definition at line 81 of file PerDrawBlocks.hpp.
References esengine::GfxContent::transient(), and esengine::Uniform.
|
inline |
Sends what was staged since the last upload, one write per page.
Definition at line 106 of file PerDrawBlocks.hpp.
|
inline |
Ranges this frame has handed out — a per-frame cost, for the profile.
Definition at line 133 of file PerDrawBlocks.hpp.