@@ -99,13 +99,13 @@ uint nbl_glsl_ext_FFT_calculateTwiddlePower(in uint threadId, in uint iteration,
99
99
return (threadId & suffixMask) << shiftSuffix;
100
100
}
101
101
102
- vec2 nbl_glsl_ext_FFT_twiddle(in uint threadId, in uint iteration, in uint logTwoN, in uint N)
102
+ nbl_glsl_complex nbl_glsl_ext_FFT_twiddle(in uint threadId, in uint iteration, in uint logTwoN, in uint N)
103
103
{
104
104
uint k = nbl_glsl_ext_FFT_calculateTwiddlePower(threadId, iteration, logTwoN);
105
105
return nbl_glsl_expImaginary(- 1 * 2 * nbl_glsl_PI * k / N);
106
106
}
107
107
108
- vec2 nbl_gnbl_glsl_ext_FFT_twiddleInverse (in uint threadId, in uint iteration, in uint logTwoN, in uint N)
108
+ nbl_glsl_complex nbl_glsl_ext_FFT_twiddleInverse (in uint threadId, in uint iteration, in uint logTwoN, in uint N)
109
109
{
110
110
return nbl_glsl_complex_conjugate(nbl_glsl_ext_FFT_twiddle(threadId, iteration, logTwoN, N));
111
111
}
@@ -148,8 +148,8 @@ void nbl_glsl_ext_FFT()
148
148
uint leadingZeroes = nbl_glsl_ext_FFT_clz(dataLength) + 1u;
149
149
uint logTwo = 32u - leadingZeroes;
150
150
151
- vec2 current_values[_NBL_GLSL_EXT_FFT_MAX_ITEMS_PER_THREAD];
152
- vec2 shuffled_values[_NBL_GLSL_EXT_FFT_MAX_ITEMS_PER_THREAD];
151
+ nbl_glsl_complex current_values[_NBL_GLSL_EXT_FFT_MAX_ITEMS_PER_THREAD];
152
+ nbl_glsl_complex shuffled_values[_NBL_GLSL_EXT_FFT_MAX_ITEMS_PER_THREAD];
153
153
154
154
// Load Initial Values into Local Mem (bit reversed indices)
155
155
for (uint t = 0u; t < num_virtual_threads; t++ )
@@ -200,18 +200,18 @@ void nbl_glsl_ext_FFT()
200
200
for (uint t = 0u; t < num_virtual_threads; t++ )
201
201
{
202
202
uint tid = thread_offset + t * _NBL_GLSL_EXT_FFT_BLOCK_SIZE_X_DEFINED_;
203
- vec2 shuffled_value = shuffled_values[t];
203
+ nbl_glsl_complex shuffled_value = shuffled_values[t];
204
204
205
- vec2 nbl_glsl_ext_FFT_twiddle = (0u == pc.is_inverse)
205
+ nbl_glsl_complex twiddle = (0u == pc.is_inverse)
206
206
? nbl_glsl_ext_FFT_twiddle(tid, i, logTwo, dataLength)
207
- : nbl_gnbl_glsl_ext_FFT_twiddleInverse (tid, i, logTwo, dataLength);
207
+ : nbl_glsl_ext_FFT_twiddleInverse (tid, i, logTwo, dataLength);
208
208
209
- vec2 this_value = current_values[t];
209
+ nbl_glsl_complex this_value = current_values[t];
210
210
211
211
if (0u < uint (tid & mask)) {
212
- current_values[t] = shuffled_value + nbl_glsl_complex_mul(nbl_glsl_ext_FFT_twiddle , this_value);
212
+ current_values[t] = shuffled_value + nbl_glsl_complex_mul(twiddle , this_value);
213
213
} else {
214
- current_values[t] = this_value + nbl_glsl_complex_mul(nbl_glsl_ext_FFT_twiddle , shuffled_value);
214
+ current_values[t] = this_value + nbl_glsl_complex_mul(twiddle , shuffled_value);
215
215
}
216
216
}
217
217
}
@@ -220,7 +220,7 @@ void nbl_glsl_ext_FFT()
220
220
{
221
221
uint tid = thread_offset + t * _NBL_GLSL_EXT_FFT_BLOCK_SIZE_X_DEFINED_;
222
222
uvec3 coords = nbl_glsl_ext_FFT_getCoordinates(tid);
223
- vec2 complex_value = (0u == pc.is_inverse)
223
+ nbl_glsl_complex complex_value = (0u == pc.is_inverse)
224
224
? current_values[t]
225
225
: current_values[t] / dataLength;
226
226
0 commit comments