2
2
#define _NBL_GLSL_WORKGROUP_SIZE_ 256
3
3
#endif
4
4
layout(local_size_x=_NBL_GLSL_WORKGROUP_SIZE_, local_size_y=1, local_size_z=1) in;
5
-
6
- #define _NBL_GLSL_EXT_FFT_GET_PARAMETERS_DEFINED_
7
- #define _NBL_GLSL_EXT_FFT_SET_DATA_DEFINED_
8
- #define _NBL_GLSL_EXT_FFT_GET_PADDED_DATA_DEFINED_
9
- #include "nbl/builtin/glsl/ext/FFT/fft.glsl"
10
5
11
- // Input Descriptor
12
6
7
+ #include <nbl/builtin/glsl/math/complex.glsl>
8
+
9
+
10
+ // Input Descriptor
13
11
#ifndef _NBL_GLSL_EXT_FFT_INPUT_SET_DEFINED_
14
12
#define _NBL_GLSL_EXT_FFT_INPUT_SET_DEFINED_ 0
15
13
#endif
@@ -26,11 +24,9 @@ layout(set=_NBL_GLSL_EXT_FFT_INPUT_SET_DEFINED_, binding=_NBL_GLSL_EXT_FFT_INPUT
26
24
{
27
25
nbl_glsl_complex inData[];
28
26
};
29
-
30
27
#endif
31
28
32
29
// Output Descriptor
33
-
34
30
#ifndef _NBL_GLSL_EXT_FFT_OUTPUT_SET_DEFINED_
35
31
#define _NBL_GLSL_EXT_FFT_OUTPUT_SET_DEFINED_ 0
36
32
#endif
@@ -47,27 +43,37 @@ layout(set=_NBL_GLSL_EXT_FFT_OUTPUT_SET_DEFINED_, binding=_NBL_GLSL_EXT_FFT_OUTP
47
43
};
48
44
#endif
49
45
50
- // Get/Set Data Function
51
46
47
+ #include <nbl/builtin/glsl/ext/FFT/parameters.glsl>
48
+
49
+
50
+ #ifndef _NBL_GLSL_EXT_FFT_PUSH_CONSTANTS_DEFINED_
52
51
layout(push_constant) uniform PushConstants
53
52
{
54
53
layout (offset = 0) nbl_glsl_ext_FFT_Parameters_t params;
55
54
} pc;
55
+ #define _NBL_GLSL_EXT_FFT_PUSH_CONSTANTS_DEFINED_
56
+ #endif
56
57
58
+ #ifndef _NBL_GLSL_EXT_FFT_GET_PARAMETERS_DEFINED_
57
59
nbl_glsl_ext_FFT_Parameters_t nbl_glsl_ext_FFT_getParameters()
58
60
{
59
- nbl_glsl_ext_FFT_Parameters_t ret;
60
- ret = pc.params;
61
- return ret;
61
+ return pc.params;
62
62
}
63
+ #define _NBL_GLSL_EXT_FFT_GET_PARAMETERS_DEFINED_
64
+ #endif
63
65
66
+ #ifndef _NBL_GLSL_EXT_FFT_SET_DATA_DEFINED_
64
67
void nbl_glsl_ext_FFT_setData(in uvec3 coordinate, in uint channel, in nbl_glsl_complex complex_value)
65
68
{
66
69
uvec3 dimension = nbl_glsl_ext_FFT_Parameters_t_getPaddedDimensions();
67
70
uint index = channel * (dimension.x * dimension.y * dimension.z) + coordinate.z * (dimension.x * dimension.y) + coordinate.y * (dimension.x) + coordinate.x;
68
71
outData[index] = complex_value;
69
72
}
73
+ #define _NBL_GLSL_EXT_FFT_SET_DATA_DEFINED_
74
+ #endif
70
75
76
+ #ifndef _NBL_GLSL_EXT_FFT_GET_PADDED_DATA_DEFINED_
71
77
nbl_glsl_complex nbl_glsl_ext_FFT_getPaddedData(in uvec3 coordinate, in uint channel)
72
78
{
73
79
uvec3 max_coord = nbl_glsl_ext_FFT_Parameters_t_getDimensions() - uvec3(1u);
@@ -85,10 +91,19 @@ nbl_glsl_complex nbl_glsl_ext_FFT_getPaddedData(in uvec3 coordinate, in uint cha
85
91
uint index = channel * (dimension.x * dimension.y * dimension.z) + clamped_coord.z * (dimension.x * dimension.y) + clamped_coord.y * (dimension.x) + clamped_coord.x;
86
92
return inData[index];
87
93
}
94
+ #define _NBL_GLSL_EXT_FFT_GET_PADDED_DATA_DEFINED_
95
+ #endif
96
+
97
+
98
+ #include "nbl/builtin/glsl/ext/FFT/fft.glsl"
99
+
88
100
101
+ #ifndef _NBL_GLSL_EXT_FFT_MAIN_DEFINED_
102
+ #define _NBL_GLSL_EXT_FFT_MAIN_DEFINED_
89
103
void main()
90
104
{
91
105
const uint numChannels = nbl_glsl_ext_FFT_Parameters_t_getNumChannels();
92
106
for(uint ch = 0u; ch < numChannels; ++ch)
93
107
nbl_glsl_ext_FFT(nbl_glsl_ext_FFT_Parameters_t_getIsInverse(), ch);
94
- }
108
+ }
109
+ #endif
0 commit comments