Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
motion_cost.hpp File Reference

Motion cost attribution — correlates render-pass cost and dirty area with the motion traces that were emitting samples on the same frame. More...

#include <pulp/view/motion.hpp>
#include <cstdint>
#include <functional>
#include <memory>
#include <string>
#include <vector>

Go to the source code of this file.

Classes

struct  pulp::view::motion::CostSample
 Per-frame cost attribution sample. More...
struct  pulp::view::motion::RenderCostSnapshot
 Snapshot of render-layer cost for the current frame. More...
class  pulp::view::motion::CostAttributor
 Process-wide cost attribution stream. More...

Namespaces

namespace  pulp
namespace  pulp::view
 Hover-cursor tracking for platform window hosts.
namespace  pulp::view::motion

Typedefs

using pulp::view::motion::CostProbe = std::function<RenderCostSnapshot()>

Functions

CostAttributor::CostSink pulp::view::motion::make_cost_sink (std::string path)
 Sink that appends each CostSample as a JSONL line to path.
CostAttributor::CostSink pulp::view::motion::make_cost_buffer_sink (std::vector< CostSample > *buffer)
 Sink that appends each CostSample to a caller-owned buffer.
std::string pulp::view::motion::serialize_cost_sample (const CostSample &s)
 Serialize one CostSample as a single JSON line (without trailing newline).
std::vector< CostSample > pulp::view::motion::load_cost_stream (const std::string &path)
 Parse a JSONL CostSample stream from path.

Variables

constexpr int pulp::view::motion::kCostSchemaVersion = 1

Detailed Description

Motion cost attribution — correlates render-pass cost and dirty area with the motion traces that were emitting samples on the same frame.

Off by default. When enabled, the CostAttributor subscribes to the bound FrameClock and the Coordinator's sink fan-out, snapshots which trace_ids emitted any event during a frame, and emits one CostSample per frame.

Render-pass and dirty-rect stats come from RenderPassManager / DirtyTracker via a caller-supplied CostProbe. Both are thin subsystems; the probe is intentionally defensive — when a probe isn't wired the cost stream still produces samples with zeroed render fields so trace_id attribution remains useful on its own.

The cost stream is a separate JSONL file (*.motion-cost.jsonl) with its own version header. It does NOT extend the kFixtureSchemaVersion event stream.