60 using Sink = std::function<void(uint32_t seq,
const float* out_planar,
bool ok)>;
72 const float* ir,
int ir_len);
79 bool submit(uint32_t seq,
const float* in_planar,
int frames,
80 std::chrono::microseconds deadline);
90 bool device_lost()
const {
return gpu_ !=
nullptr && gpu_->device_lost(); }
91 uint32_t
fft_size()
const {
return fft_size_; }
92 uint32_t
depth()
const {
return depth_; }
104 enum class SlotState : uint8_t { Free, InFlight, Ready, Bad };
107 SlotState
state = SlotState::Free;
109 std::vector<float> in_pad;
110 std::vector<float> time;
119 std::vector<Slot> slots;
120 std::vector<uint32_t> pending;
130 std::shared_ptr<State> state_;
131 render::GpuCompute* gpu_ =
nullptr;
134 uint32_t channels_ = 0;
136 uint32_t sample_rate_ = 0;
137 uint32_t fft_size_ = 0;
138 bool prepared_ =
false;
140 std::vector<float> ir_spec_;
141 std::vector<std::vector<float>> carry_;
142 std::vector<float> out_;
WebGpuConvolver & operator=(const WebGpuConvolver &)=delete
WebGpuConvolver(uint32_t depth=kDefaultDepth)
bool prepared() const
Definition web_gpu_convolver.hpp:87
WebGpuConvolver(const WebGpuConvolver &)=delete
uint64_t resolves() const
maps that landed with a usable payload
uint32_t in_flight() const
uint32_t depth() const
Definition web_gpu_convolver.hpp:92
uint32_t collect(const Sink &sink)
Harvest.
uint32_t fft_size() const
Definition web_gpu_convolver.hpp:91
bool prepare(render::GpuCompute *gpu, int sample_rate, int block, int channels, const float *ir, int ir_len)
Allocate scratch, transform the IR on the CPU, and upload the resident IR spectrum.
uint64_t expired() const
deadline passed before the map resolved
uint64_t failed() const
map error, device loss, or non-finite payload
bool submit(uint32_t seq, const float *in_planar, int frames, std::chrono::microseconds deadline)
Issue one block.
bool device_lost() const
Device loss is normal browser behavior, not an init failure: the owner is expected to re-acquire a de...
Definition web_gpu_convolver.hpp:90
std::function< void(uint32_t seq, const float *out_planar, bool ok)> Sink
Called once per finished block, in submission order.
Definition web_gpu_convolver.hpp:60
static constexpr uint32_t kDefaultDepth
Blocks that may be in flight at once.
Definition web_gpu_convolver.hpp:54
GPU compute pipeline for non-rendering workloads (e.g.
Definition gpu_compute.hpp:48
Definition flow_pans.hpp:19
SequencerStateChannel is the audio-safe transport for a plugin's structured NON-parameter state: the ...
Definition audio_device_manager.hpp:48