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

◆ fft_spec()

Portal::Graphics::ShaderSpec MayaFlux::Yantra::FftContext::fft_spec ( uint32_t points,
Portal::Graphics::SpectrumOutput output,
uint32_t descriptors = 0 )
inlinestaticnodiscard

The spec of the template instance this context drives.

Definition at line 182 of file FftContext.hpp.

184 {
186 auto assemble = Portal::Graphics::ShaderSpec::Assemble {};
188 .points(points)
189 .spectrum(output)
190 .descriptors(descriptors)
191 .ssbo("values", BindingDirection::Input, Kakshya::GpuDataFormat::VEC2_U32)
192 .ssbo("twiddle", BindingDirection::Input, Kakshya::GpuDataFormat::VEC2_U32)
193 .ssbo("window", BindingDirection::Input, Kakshya::GpuDataFormat::VEC2_U32)
194 .ssbo("result", BindingDirection::Output, Kakshya::GpuDataFormat::VEC2_U32);
196 assemble.ssbo("weights", BindingDirection::Input, Kakshya::GpuDataFormat::VEC2_U32);
197 }
198 return assemble
199 .pc("length", Kakshya::GpuDataFormat::UINT32)
200 .pc("stride", Kakshya::GpuDataFormat::UINT32)
201 .pc("offset", Kakshya::GpuDataFormat::UINT32)
202 .pc("scale_lo", Kakshya::GpuDataFormat::UINT32)
203 .pc("scale_hi", Kakshya::GpuDataFormat::UINT32)
204 .workgroup(std::max<uint32_t>(std::min<uint32_t>(points / 2, 256U), 1U))
205 .build();
206 }
uint32_t descriptors() const noexcept
Rows of weights of a projecting context, zero otherwise.
uint32_t points() const noexcept
ShaderExecutionContext & output(size_t byte_size, GpuBufferBinding::ElementType type=GpuBufferBinding::ElementType::FLOAT32)
Add an OUTPUT binding, inferring the next available binding index.
@ VEC2_U32
glm::uvec2: a 64-bit value as low word (x) and high word (y), not a sampled image format
@ FFT
Radix 2 FFT of word-pair doubles, one workgroup per window, points a power of two up to 2048.
@ Projection
descriptors values per window: row r of a weights binding, one weight per power bin,...
BindingDirection
Data flow direction for a shader binding slot.

References MayaFlux::Portal::Graphics::ShaderSpec::Assemble::build(), MayaFlux::Portal::Graphics::ShaderSpec::Assemble::descriptors(), descriptors(), MayaFlux::Portal::Graphics::FFT, MayaFlux::Yantra::ShaderExecutionContext< InputType, OutputType >::output(), MayaFlux::Portal::Graphics::ShaderSpec::Assemble::pc(), MayaFlux::Portal::Graphics::ShaderSpec::Assemble::points(), points(), MayaFlux::Portal::Graphics::Projection, MayaFlux::Portal::Graphics::ShaderSpec::Assemble::spectrum(), MayaFlux::Portal::Graphics::ShaderSpec::Assemble::ssbo(), MayaFlux::Portal::Graphics::ShaderSpec::Assemble::tmpl(), MayaFlux::Kakshya::UINT32, MayaFlux::Kakshya::VEC2_U32, and MayaFlux::Portal::Graphics::ShaderSpec::Assemble::workgroup().

Referenced by FftContext(), and FftContext().

Here is the call graph for this function:
Here is the caller graph for this function: