Estella 0.113.0
A fast 2D and 3D game engine powered by WebAssembly and ECS
Loading...
Searching...
No Matches
PerDrawBlocks.hpp File Reference

A uniform range per draw, so two draws never write into one block. More...

#include "../../core/Types.hpp"
#include "./GfxDevice.hpp"
#include <algorithm>
#include <cstring>
#include <vector>
Include dependency graph for PerDrawBlocks.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  esengine::PerDrawBlocks
struct  esengine::PerDrawBlocks::Range
 Where one draw's block was staged; a default one binds the zero block. More...
struct  esengine::PerDrawBlockSet
 The uniform blocks a draw rewrites immediately before it. More...

Namespaces

namespace  esengine

Detailed Description

A uniform range per draw, so two draws never write into one block.

A queue write lands where the pass is SUBMITTED, not where it was called, so a block shared between two draws is read by both with what the last wrote. Ranges are handed out per FRAME and not per pass: one submission stands behind a frame's several passes.

The ranges are carved from a few large pages rather than a buffer each, and a pass stages all of its draws' blocks before it uploads them once per page: creating a buffer costs the GPU process far more than writing one, and a first frame of eight thousand draws once spent half a minute creating them.

Definition in file PerDrawBlocks.hpp.