25 #include <unordered_map>
56 FFT(
unsigned Nx,
unsigned Ny,
75 FFT(
unsigned Nx,
unsigned Ny,
unsigned radix,
unsigned p,
77 std::shared_ptr<ProgramCache> cache,
const FFTOptions &options);
106 unsigned warmup_iterations,
unsigned iterations,
unsigned dispatches_per_iteration,
170 texture.samplers[0] = sampler0;
171 texture.samplers[1] = sampler1;
191 std::shared_ptr<ProgramCache>
cache;
static void store_shader_string(const char *path, const std::string &source)
void process(GLuint output, GLuint input, GLuint input_aux=0)
Process the FFT.
static std::string load_shader_string(const char *path)
GLenum GLuint GLintptr offset
unsigned get_dimension_y() const
Returns Ny.
unsigned get_dimension_x() const
Returns Nx.
void set_input_aux_buffer_range(GLintptr offset, GLsizei size)
Set binding range for input_aux.
unsigned get_num_passes() const
Returns number of passes (glDispatchCompute) in a process() call.
GLuint build_program(const Parameters ¶ms)
FFT(unsigned Nx, unsigned Ny, Type type, Direction direction, Target input_target, Target output_target, std::shared_ptr< ProgramCache > cache, const FFTOptions &options, const FFTWisdom &wisdom=FFTWisdom())
Creates a full FFT.
void set_output_buffer_range(GLintptr offset, GLsizei size)
Set binding range for output.
GLuint compile_compute_shader(const char *src)
GLsizei GLsizei GLchar * source
double bench(GLuint output, GLuint input, unsigned warmup_iterations, unsigned iterations, unsigned dispatches_per_iteration, double max_time=std::numeric_limits< double >::max())
Run process() multiple times, timing the results.
Options for FFT implementation. Defaults for performance as conservative.
struct GLFFT::FFT::@1::@2 input
void set_input_buffer_range(GLintptr offset, GLsizei size)
Set binding range for input.
void set_texture_offset_scale(float offset_x, float offset_y, float scale_x, float scale_y)
Sets offset and scale parameters for normalized texel coordinates when sampling textures.
float max(float x, float y)
struct GLFFT::FFT::@1::@2 output
GLuint get_program(const Parameters ¶ms)
GLenum GLuint GLintptr GLsizeiptr size
void set_samplers(GLuint sampler0, GLuint sampler1=0)
Set samplers for input textures.
struct GLFFT::FFT::@1::@2 input_aux
double get_cost() const
Returns cost for a process() call. Only used for debugging.
typedef GLuint(GL_APIENTRYP PFNGLGETDEBUGMESSAGELOGKHRPROC)(GLuint count
std::vector< Pass > passes
struct GLFFT::FFT::@0 texture
struct GLFFT::FFT::@1 ssbo
std::shared_ptr< ProgramCache > cache