Skip to content

Commit 2e52107

Browse files
committed
FFT readme update
1 parent 0f8bcac commit 2e52107

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

include/nbl/builtin/hlsl/fft/README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,31 @@ Furthermore, you must define the method `uint32_t3 nbl::hlsl::glsl::gl_WorkGroup
2929
## Utils
3030

3131
### Figuring out the storage required for an FFT
32+
We provide the functions
33+
```cpp
34+
uint64_t fft::getOutputBufferSize(
35+
uint32_t numChannels,
36+
vector<uint32_t, N> inputDimensions,
37+
uint16_t passIx,
38+
vector<uint16_t, N> axisPassOrder = _static_cast<vector<uint16_t, N> >(uint16_t4(0, 1, 2, 3)),
39+
bool realFFT = false,
40+
bool halfFloats = false);
41+
42+
uint64_t getOutputBufferSizeConvolution(
43+
uint32_t numChannels,
44+
vector<uint32_t, N> inputDimensions,
45+
vector<uint32_t, N> kernelDimensions,
46+
uint16_t passIx,
47+
vector<uint16_t, N> axisPassOrder = _static_cast<vector<uint16_t, N> >(uint16_t4(0, 1, 2, 3)),
48+
bool realFFT = false,
49+
bool halfFloats = false
50+
)
51+
```
52+
which yield the size (in bytes) required to store the result of an FFT of a signal with `numChannels` channels of size `inputDImensions` after running the FFT along the axis `axisPassOrder[passIx]` (if you don't
53+
provide this order it's assumed to be `xyzw`). It furthermore takes an argument `realFFT` which if true means you are doing an FFT on a real signal AND you want to store the output of the FFT along the first axis
54+
in a compact manner (knowing that FFTs of real signals are conjugate-symmetric). By default it assumes your complex numbers have `float32_t` scalars, `halfFloats` set to true means you're using `float16_t` scalars.
55+
56+
`getOutputBufferSizeConvolution` furthermore takes a `kernelDimensions` argument. When convolving a signal against a kernel, the FFT has some extra padding to consider, so these methods are different.
3257

3358
### Figuring out compile-time parameters
3459
We provide a

0 commit comments

Comments
 (0)