Loading...
Searching...
No Matches
Gfx::GfxContext Class Reference
Inheritance diagram for Gfx::GfxContext:

Public Types

using NodePtr = std::unique_ptr< score::gfx::Node >
 

Public Member Functions

 GfxContext (const score::DocumentContext &ctx)
 
int32_t register_node (NodePtr node)
 
int32_t register_preview_node (NodePtr node)
 
void connect_preview_node (EdgeSpec e)
 
void disconnect_preview_node (EdgeSpec e)
 
void unregister_node (int32_t idx)
 
void unregister_preview_node (int32_t idx)
 
void destroyOutput (score::gfx::OutputNode *node)
 
void recompute_edges ()
 
void recompute_graph ()
 
void recompute_connections ()
 
void recomputeTimers ()
 
void recomputeGraphTopology ()
 
void incrementalEdgeUpdate (const ossia::flat_set< EdgeSpec > &old_edges, const ossia::flat_set< EdgeSpec > &cur_edges)
 
void update_inputs ()
 
void updateGraph ()
 
void renderFrames (int frames)
 Render exactly frames times, synchronously, and return.
 
double stepRate () const noexcept
 Step used by renderFrames(), in frames per second.
 
void setStepRate (double fps) noexcept
 
void send_message (score::gfx::Message &&msg) noexcept
 
AssetTableassets () noexcept
 Session-wide content-hash decode cache.
 
const AssetTableassets () const noexcept
 

Friends

class GfxExecutionAction
 

Member Function Documentation

◆ assets()

AssetTable & Gfx::GfxContext::assets ( )
inlinenoexcept

Session-wide content-hash decode cache.

Shared across all RenderLists in this GfxContext. Loaders stage decoded bytes here on their worker thread; downstream consumers (texture upload, mesh VB/IB assembly) acquire by content hash, avoiding re-decoding the same source asset across multiple outputs or reloads. See Gfx/AssetTable.hpp.

◆ renderFrames()

void Gfx::GfxContext::renderFrames ( int  frames)

Render exactly frames times, synchronously, and return.

The normal path renders off wall-clock timers, so "how many frames have I drawn" depends on how long the caller happened to wait and how fast the machine is – a harness that sleeps and then grabs gets a different frame on a Raspberry Pi than on a workstation, and an animated shader gives a different image every run.

Stepping instead makes frame N mean the same thing everywhere, which is what lets a rendered frame be compared against a stored reference at all.

Each step also hands every process node a synthetic token of frame / stepRate(), so TIME, TIMEDELTA, FRAMEINDEX and PROGRESS follow the counter rather than whatever the transport last delivered. Without it an animated shader keeps reading the execution clock and frame N is a different picture every run.

Still on the execution clock: whatever a node takes from the transport itself rather than from its process UBO – video decode position, automation – so a graph built on those is only as reproducible as that clock is.


The documentation for this class was generated from the following files: