Skip to content

Commit 9e6a998

Browse files
idea... support multi-channel FFT to reuse twiddle factors and reduce data-reads and writes
1 parent bc34515 commit 9e6a998

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

examples_tests/49.ComputeFFT/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ R"===(#version 430 core
4444

4545
const size_t extraSize = 4u+8u+8u+128u;
4646

47-
constexpr uint32_t DEFAULT_WORK_GROUP_SIZE = 256u;
47+
constexpr uint32_t DEFAULT_WORK_GROUP_SIZE = FFTClass::DEFAULT_WORK_GROUP_SIZE;
4848
auto shader = core::make_smart_refctd_ptr<ICPUBuffer>(strlen(sourceFmt)+extraSize+1u);
4949
snprintf(
5050
reinterpret_cast<char*>(shader->getPointer()),shader->getSize(), sourceFmt,

include/nbl/builtin/glsl/ext/FFT/default_compute_fft.comp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ void nbl_glsl_ext_FFT_setData(in uvec3 coordinate, in uint channel, in nbl_glsl_
7171
#define _NBL_GLSL_EXT_FFT_SET_DATA_DEFINED_
7272
#endif
7373

74+
// TODO: pad by using shared memory to broadcast copies of the input around (up to 49% VRAM read gains) ?
7475
bool nbl_glsl_ext_FFT_wrap_coord(inout ivec3 coordinate)
7576
{
7677
const ivec3 dimensions = ivec3(nbl_glsl_ext_FFT_Parameters_t_getDimensions());

include/nbl/builtin/glsl/ext/FFT/fft.glsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ ivec3 nbl_glsl_ext_FFT_getPaddedCoordinates(in uint tidx, in uint log2FFTSize, i
5252
#include "nbl/builtin/glsl/workgroup/fft.glsl"
5353

5454

55-
nbl_glsl_complex nbl_glsl_ext_FFT_impl_values[(_NBL_GLSL_EXT_FFT_MAX_DIM_SIZE_-1u)/_NBL_GLSL_WORKGROUP_SIZE_+1u];
55+
nbl_glsl_complex nbl_glsl_ext_FFT_impl_values[(_NBL_GLSL_EXT_FFT_MAX_DIM_SIZE_-1u)/_NBL_GLSL_WORKGROUP_SIZE_+1u]; // TODO: hardcoded channel count, multichannel FFT (shared twiddles), maybe even precompute twiddles into a LUT!?
5656

5757
void nbl_glsl_ext_FFT_loop(in bool is_inverse, in uint virtual_thread_count, in uint step)
5858
{

0 commit comments

Comments
 (0)