Skip to content

Commit 1412b01

Browse files
committed
Renamed some parameters so they better convey intent
1 parent 83e0cbd commit 1412b01

File tree

1 file changed

+6
-6
lines changed
  • include/nbl/builtin/hlsl/workgroup

1 file changed

+6
-6
lines changed

include/nbl/builtin/hlsl/workgroup/fft.hlsl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ namespace impl
169169
template<uint16_t ElementsPerInvocationLog2, uint16_t WorkgroupSizeLog2>
170170
struct FFTIndexingUtils
171171
{
172-
// This function maps the index `idx` in the output array of a Nabla FFT to the index `freqIdx` in the DFT such that `DFT[freqIdx] = NablaFFT[idx]`
172+
// This function maps the index `outputIdx` in the output array of a Nabla FFT to the index `freqIdx` in the DFT such that `DFT[freqIdx] = NablaFFT[outputIdx]`
173173
// This is because Cooley-Tukey + subgroup operations end up spewing out the outputs in a weird order
174174
static uint32_t getDFTIndex(uint32_t outputIdx)
175175
{
@@ -184,15 +184,15 @@ struct FFTIndexingUtils
184184
}
185185

186186
// Mirrors an index about the Nyquist frequency in the DFT order
187-
static uint32_t getDFTMirrorIndex(uint32_t idx)
187+
static uint32_t getDFTMirrorIndex(uint32_t freqIdx)
188188
{
189-
return (FFTSize - idx) & (FFTSize - 1);
189+
return (FFTSize - freqIdx) & (FFTSize - 1);
190190
}
191191

192-
// Given an index `idx` of an element into the Nabla FFT, get the index into the Nabla FFT of the element corresponding to its negative frequency
193-
static uint32_t getNablaMirrorIndex(uint32_t idx)
192+
// Given an index `outputIdx` of an element into the Nabla FFT, get the index into the Nabla FFT of the element corresponding to its negative frequency
193+
static uint32_t getNablaMirrorIndex(uint32_t outputIdx)
194194
{
195-
return getNablaIndex(getDFTMirrorIndex(getDFTIndex(idx)));
195+
return getNablaIndex(getDFTMirrorIndex(getDFTIndex(outputIdx)));
196196
}
197197

198198
// When unpacking an FFT of two packed signals, given a `localElementIndex` representing a `globalElementIndex` you need its "mirror index" to unpack the value at

0 commit comments

Comments
 (0)