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

What readying a set of renderables' programs found. Counts, not JSON: this crosses no boundary and pays for no encoding. More...

#include <RenderTypePlugin.hpp>

Public Member Functions

bool addKey (u32 variant)
 Whether this key is already in the set; adds it if not.
void addMaterialKey (u64 key)
u64 requirementDigest () const
 A stable name for the SET of program requirements described here.
RenderPrewarmResult & operator+= (const RenderPrewarmResult &other)

Static Public Member Functions

static u64 materialKey (u32 materialId, bool normals, bool skinned, bool envMapped, bool lightmapped, bool tangents=false)
 What a material program is asked for, as one comparable value.

Public Attributes

u32 asks = 0
u32 compiles = 0
u32 uniqueKeys = 0
u32 materialAsks = 0
u32 materialCompiles = 0
std::array< u64, MESH_VARIANTS/64 > keys {}
std::vector< u64 > materialKeys

Detailed Description

What readying a set of renderables' programs found. Counts, not JSON: this crosses no boundary and pays for no encoding.

Definition at line 207 of file RenderTypePlugin.hpp.

Member Function Documentation

◆ addKey()

bool esengine::RenderPrewarmResult::addKey ( u32 variant)
inline

Whether this key is already in the set; adds it if not.

Definition at line 219 of file RenderTypePlugin.hpp.

References keys.

Referenced by esengine::MeshPlugin::prewarmFacts().

◆ addMaterialKey()

void esengine::RenderPrewarmResult::addMaterialKey ( u64 key)
inline

Definition at line 238 of file RenderTypePlugin.hpp.

References materialKeys.

Referenced by operator+=(), and esengine::MeshPlugin::prewarmFacts().

◆ materialKey()

u64 esengine::RenderPrewarmResult::materialKey ( u32 materialId,
bool normals,
bool skinned,
bool envMapped,
bool lightmapped,
bool tangents = false )
inlinestatic

What a material program is asked for, as one comparable value.

Definition at line 232 of file RenderTypePlugin.hpp.

Referenced by esengine::MeshPlugin::prewarmFacts().

◆ operator+=()

RenderPrewarmResult & esengine::RenderPrewarmResult::operator+= ( const RenderPrewarmResult & other)
inline

◆ requirementDigest()

u64 esengine::RenderPrewarmResult::requirementDigest ( ) const
inline

A stable name for the SET of program requirements described here.

Order-independent and duplicate-insensitive, because the question is which programs are needed and not how often each was asked for. Two derivations of the same content therefore agree, and a requirement arriving or leaving is what changes the answer.

Definition at line 252 of file RenderTypePlugin.hpp.

References esengine::hash::fnv1aBytes(), keys, esengine::hash::kFnv64Offset, and materialKeys.

Referenced by esengine::engine_prepareMeshPrograms().

Member Data Documentation

◆ asks

u32 esengine::RenderPrewarmResult::asks = 0

◆ compiles

u32 esengine::RenderPrewarmResult::compiles = 0

◆ keys

std::array<u64, MESH_VARIANTS / 64> esengine::RenderPrewarmResult::keys {}

Which keys, not how many: an equality claim needs the set. One bit per MESH_VARIANTS, so it is two words rather than one.

Definition at line 216 of file RenderTypePlugin.hpp.

Referenced by addKey(), operator+=(), and requirementDigest().

◆ materialAsks

u32 esengine::RenderPrewarmResult::materialAsks = 0

◆ materialCompiles

u32 esengine::RenderPrewarmResult::materialCompiles = 0

◆ materialKeys

std::vector<u64> esengine::RenderPrewarmResult::materialKeys

The material programs the content needs, by identity rather than count. A material world whose shading changed must not digest the same as the one before it, and materialAsks alone cannot say that.

Definition at line 229 of file RenderTypePlugin.hpp.

Referenced by addMaterialKey(), operator+=(), and requirementDigest().

◆ uniqueKeys

u32 esengine::RenderPrewarmResult::uniqueKeys = 0

Distinct variant keys the content needed — the dimension of the answer.

Definition at line 211 of file RenderTypePlugin.hpp.

Referenced by operator+=(), and esengine::MeshPlugin::prewarmFacts().


The documentation for this struct was generated from the following file: