1
- #ifndef USE_SSBO_FOR_INPUT
2
- #error "USE_SSBO_FOR_INPUT should be defined."
3
- #endif
4
-
5
1
#ifndef _NBL_GLSL_WORKGROUP_SIZE_
6
2
#define _NBL_GLSL_WORKGROUP_SIZE_ 256
7
3
#endif
@@ -26,14 +22,11 @@ layout(local_size_x=_NBL_GLSL_WORKGROUP_SIZE_, local_size_y=1, local_size_z=1) i
26
22
#ifndef _NBL_GLSL_EXT_FFT_INPUT_DESCRIPTOR_DEFINED_
27
23
#define _NBL_GLSL_EXT_FFT_INPUT_DESCRIPTOR_DEFINED_
28
24
29
- #if USE_SSBO_FOR_INPUT > 0
25
+
30
26
layout(set=_NBL_GLSL_EXT_FFT_INPUT_SET_DEFINED_, binding=_NBL_GLSL_EXT_FFT_INPUT_BINDING_DEFINED_) readonly restrict buffer InputBuffer
31
27
{
32
28
nbl_glsl_complex inData[];
33
29
};
34
- #else
35
- layout(set=_NBL_GLSL_EXT_FFT_INPUT_SET_DEFINED_, binding=_NBL_GLSL_EXT_FFT_INPUT_BINDING_DEFINED_) uniform sampler2D inputImage;
36
- #endif
37
30
38
31
#endif
39
32
@@ -71,16 +64,9 @@ layout(push_constant) uniform PushConstants
71
64
nbl_glsl_complex nbl_glsl_ext_FFT_getData(in uvec3 coordinate, in uint channel)
72
65
{
73
66
nbl_glsl_complex retValue = nbl_glsl_complex(0, 0);
74
- #if USE_SSBO_FOR_INPUT > 0
75
67
uvec3 dimension = nbl_glsl_ext_FFT_Parameters_t_getDimensions();
76
68
uint index = channel * (dimension.x * dimension.y * dimension.z) + coordinate.z * (dimension.x * dimension.y) + coordinate.y * (dimension.x) + coordinate.x;
77
69
retValue = inData[index];
78
- #else
79
- ivec2 inputImageSize = textureSize(inputImage, 0);
80
- vec2 normalizedCoords = (vec2(coordinate.xy) + vec2(0.5f)) / vec2(inputImageSize);
81
- vec4 texelValue= textureLod(inputImage, normalizedCoords, 0);
82
- retValue = nbl_glsl_complex(texelValue[channel], 0.0f);
83
- #endif
84
70
return retValue;
85
71
}
86
72
@@ -93,7 +79,6 @@ void nbl_glsl_ext_FFT_setData(in uvec3 coordinate, in uint channel, in nbl_glsl_
93
79
94
80
nbl_glsl_complex nbl_glsl_ext_FFT_getPaddedData(in uvec3 coordinate, in uint channel)
95
81
{
96
- #if USE_SSBO_FOR_INPUT > 0
97
82
uvec3 max_coord = nbl_glsl_ext_FFT_Parameters_t_getDimensions() - uvec3(1u);
98
83
uvec3 clamped_coord = min(coordinate, max_coord);
99
84
@@ -106,16 +91,11 @@ nbl_glsl_complex nbl_glsl_ext_FFT_getPaddedData(in uvec3 coordinate, in uint cha
106
91
}
107
92
108
93
return nbl_glsl_ext_FFT_getData(clamped_coord, channel);
109
- #else
110
- return nbl_glsl_ext_FFT_getData(coordinate, channel);
111
- #endif
112
94
}
113
95
114
96
void main()
115
97
{
116
98
const uint numChannels = nbl_glsl_ext_FFT_Parameters_t_getNumChannels();
117
99
for(uint ch = 0u; ch < numChannels; ++ch)
118
- {
119
100
nbl_glsl_ext_FFT(nbl_glsl_ext_FFT_Parameters_t_getIsInverse(), ch);
120
- }
121
101
}
0 commit comments