MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ stage()

void MayaFlux::Yantra::FftContext::stage ( std::span< const double > interleaved,
const SegmentGeometry & geometry,
std::span< const double > window = {} )
inline

Stage input, window and geometry for the next dispatch without running it.

Follow with dispatch_async and collect_result, then decode_primary.

Definition at line 153 of file FftContext.hpp.

153 {})
154 {
155 m_windows = geometry.count;
156
157 std::vector<double> coefficients(m_points, window.empty() ? 1.0 : 0.0);
158 std::copy_n(window.begin(), std::min<size_t>(window.size(), m_points), coefficients.begin());
159
160 stage_words(0, interleaved);
162 stage_words(2, coefficients);
163 if (m_projection) {
165 }
167 set_output_size(result_binding, static_cast<size_t>(geometry.count) * values_per_window() * sizeof(uint64_t));
168 }
169
170 const auto scale_bits = std::bit_cast<uint64_t>(m_scale);
171 push(Push {
172 .length = geometry.length,
173 .stride = geometry.stride,
174 .offset = geometry.offset,
175 .scale_lo = static_cast<uint32_t>(scale_bits & 0xFFFFFFFFU),
176 .scale_hi = static_cast<uint32_t>(scale_bits >> 32U) });
177 }
std::vector< double > m_weights
static constexpr uint32_t result_binding
The binding that holds the result of a dispatch.
std::vector< double > m_twiddle
size_t values_per_window() const noexcept
Doubles in the result of one window.
std::optional< SharedBufferInfo > shared_buffer_info(uint32_t set, size_t binding_index) const
What the shared buffer at (set, binding_index) declares, or nothing when absent.
void set_output_size(size_t index, size_t byte_size)
Declare the byte capacity of an output binding independently of input data.
ShaderExecutionContext & push(const T &data)
Set push constants from a trivially copyable struct or value.
void stage_words(uint32_t binding, std::span< const double > values, size_t padded_count=0, bool complement=false)
Encode values and stage them as the data of a binding.