Skip to content

Commit 8393729

Browse files
committed
more small changes
1 parent 2e902d0 commit 8393729

File tree

3 files changed

+7
-19
lines changed

3 files changed

+7
-19
lines changed

include/nbl/builtin/glsl/ext/FFT/default_compute_fft.comp

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,9 @@
77
#error "USE_SSBO_FOR_INPUT should be defined."
88
#endif
99

10-
#ifndef _NBL_GLSL_EXT_FFT_BLOCK_SIZE_X_DEFINED_
11-
#define _NBL_GLSL_EXT_FFT_BLOCK_SIZE_X_DEFINED_ 256
12-
#endif
13-
14-
#ifndef _NBL_GLSL_EXT_FFT_BLOCK_SIZE_Y_DEFINED_
15-
#define _NBL_GLSL_EXT_FFT_BLOCK_SIZE_Y_DEFINED_ 1
16-
#endif
17-
18-
#ifndef _NBL_GLSL_EXT_FFT_BLOCK_SIZE_Z_DEFINED_
19-
#define _NBL_GLSL_EXT_FFT_BLOCK_SIZE_Z_DEFINED_ 1
20-
#endif
21-
22-
#define _NBL_GLSL_WORKGROUP_SIZE_ (_NBL_GLSL_EXT_FFT_BLOCK_SIZE_X_DEFINED_*_NBL_GLSL_EXT_FFT_BLOCK_SIZE_Y_DEFINED_*_NBL_GLSL_EXT_FFT_BLOCK_SIZE_Z_DEFINED_)
10+
#define _NBL_GLSL_WORKGROUP_SIZE_ 256
2311

24-
layout(local_size_x=_NBL_GLSL_EXT_FFT_BLOCK_SIZE_X_DEFINED_, local_size_y=_NBL_GLSL_EXT_FFT_BLOCK_SIZE_Y_DEFINED_, local_size_z=_NBL_GLSL_EXT_FFT_BLOCK_SIZE_Z_DEFINED_) in;
12+
layout(local_size_x=_NBL_GLSL_WORKGROUP_SIZE_, local_size_y=1, local_size_z=1) in;
2513

2614

2715
#define _NBL_GLSL_EXT_FFT_GET_DATA_DEFINED_

include/nbl/ext/FFT/FFT.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class FFT : public core::TotalInterface
5757
assert(core::isPoT(paddedInputDimensions.width) && core::isPoT(paddedInputDimensions.height) && core::isPoT(paddedInputDimensions.depth));
5858
DispatchInfo_t ret = {};
5959

60-
ret.workGroupDims[0] = DEFAULT_WORK_GROUP_X_DIM;
60+
ret.workGroupDims[0] = DEFAULT_WORK_GROUP_SIZE;
6161
ret.workGroupDims[1] = 1;
6262
ret.workGroupDims[2] = 1;
6363

@@ -227,7 +227,7 @@ class FFT : public core::TotalInterface
227227
FFT() = delete;
228228
//~FFT() = delete;
229229

230-
_NBL_STATIC_INLINE_CONSTEXPR uint32_t DEFAULT_WORK_GROUP_X_DIM = 256u;
230+
_NBL_STATIC_INLINE_CONSTEXPR uint32_t DEFAULT_WORK_GROUP_SIZE = 256u;
231231

232232
static void defaultBarrier();
233233
};

src/nbl/ext/FFT/FFT.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,13 +116,13 @@ R"===(#version 430 core
116116

117117
const size_t extraSize = 32 + 32 + 32 + 32;
118118

119-
const uint32_t maxItemsPerThread = (maxPaddedDimensionSize - 1u) / (DEFAULT_WORK_GROUP_X_DIM) + 1u;
119+
const uint32_t maxItemsPerThread = (maxPaddedDimensionSize - 1u) / (DEFAULT_WORK_GROUP_SIZE) + 1u;
120120
const uint32_t useSSBO = (DataType::SSBO == inputType) ? 1 : 0;
121121
auto shader = core::make_smart_refctd_ptr<ICPUBuffer>(strlen(sourceFmt)+extraSize+1u);
122122
snprintf(
123123
reinterpret_cast<char*>(shader->getPointer()),shader->getSize(), sourceFmt,
124124
useSSBO,
125-
DEFAULT_WORK_GROUP_X_DIM,
125+
DEFAULT_WORK_GROUP_SIZE,
126126
maxPaddedDimensionSize,
127127
maxItemsPerThread
128128
);
@@ -271,7 +271,7 @@ void FFT::updateDescriptorSet_KernelNormalization(
271271
}
272272

273273
void FFT::dispatchKernelNormalization(video::IVideoDriver* driver, asset::VkExtent3D const & paddedDimension, uint32_t numChannels) {
274-
const uint32_t dispatchSizeX = core::ceil(float(paddedDimension.width * paddedDimension.height * paddedDimension.depth * numChannels) / DEFAULT_WORK_GROUP_X_DIM);
274+
const uint32_t dispatchSizeX = core::ceil(float(paddedDimension.width * paddedDimension.height * paddedDimension.depth * numChannels) / DEFAULT_WORK_GROUP_SIZE);
275275
driver->dispatch(dispatchSizeX, 1, 1);
276276
defaultBarrier();
277277
}

0 commit comments

Comments
 (0)