The one max-block-overrun contract shared by every format adapter. More...
Go to the source code of this file.
Namespaces | |
| namespace | pulp |
| namespace | pulp::format |
| What the product grants a device: the quota table indexed by capability tier and live thermal state. | |
Functions | |
| constexpr int | pulp::format::clamp_block_to_prepared_max (int requested, int prepared_max) noexcept |
| Clamp a requested per-block frame count to the prepared maximum. | |
The one max-block-overrun contract shared by every format adapter.
A Processor and all of its scratch buffers are sized once, off the audio thread, to a prepared maximum block size (CLAP clap_activate, VST3 setupProcessing, AU v3 allocateRenderResources, AAX's first prepare). A well-behaved host never renders more frames than that maximum, so the only thing this contract governs is the pathological overrun.
The push-based adapters (CLAP, VST3) get a fixed prepared maximum from the host at activate/setup time and handle an overrun the same, defensible way: clamp the processed region to that maximum and zero-fill the un-processable tail [prepared_max, requested) on each main output channel, so the host reads clean silence past the prepared max rather than uninitialised memory or a DSP state corrupted by a scratch overrun. They share clamp_block_to_prepared_max below.
Two adapters intentionally differ because their host ABI does:
This header owns the clamp decision (the pure, testable part); each clamping adapter still zero-fills its own host-buffer layout (f32/f64, planar/ interleaved) inline right after it resolves its output pointers.