@@ -17,10 +17,6 @@ class NBL_API2 CComputeBlit : public core::IReferenceCounted
17
17
18
18
19
19
public:
20
- // This default is only for the blitting step (not alpha test or normalization steps) which always uses a 1D workgroup.
21
- // For the default values of alpha test and normalization steps, see getDefaultWorkgroupDims.
22
- static constexpr uint32_t DefaultBlitWorkgroupSize = 256u ;
23
-
24
20
struct dispatch_info_t
25
21
{
26
22
uint32_t wgCount[3 ];
@@ -164,10 +160,13 @@ class NBL_API2 CComputeBlit : public core::IReferenceCounted
164
160
const core::vectorSIMDu32& inExtent,
165
161
const core::vectorSIMDu32& outExtent,
166
162
const asset::IBlitUtilities::E_ALPHA_SEMANTIC alphaSemantic,
167
- const typename BlitUtilities::convolution_kernels_t & kernels,
168
- const uint32_t workgroupSize = DefaultBlitWorkgroupSize ,
163
+ const typename BlitUtilities::convolution_kernels_t & kernels,
164
+ const uint32_t workgroupSize = 0 ,
169
165
const uint32_t alphaBinCount = asset::IBlitUtilities::DefaultAlphaBinCount)
170
166
{
167
+ if (workgroupSize==0 )
168
+ workgroupSize = m_device->getPhysicalDevice ()->getLimits ().maxWorkgroupSize ;
169
+
171
170
const auto workgroupDims = getDefaultWorkgroupDims (imageType);
172
171
const auto paddedAlphaBinCount = getPaddedAlphaBinCount (workgroupDims, alphaBinCount);
173
172
@@ -242,7 +241,7 @@ class NBL_API2 CComputeBlit : public core::IReferenceCounted
242
241
const core::vectorSIMDu32& outExtent,
243
242
const asset::IBlitUtilities::E_ALPHA_SEMANTIC alphaSemantic,
244
243
const typename BlitUtilities::convolution_kernels_t & kernels,
245
- const uint32_t workgroupSize = DefaultBlitWorkgroupSize ,
244
+ const uint32_t workgroupSize = 256 ,
246
245
const uint32_t alphaBinCount = asset::IBlitUtilities::DefaultAlphaBinCount)
247
246
{
248
247
const auto paddedAlphaBinCount = getPaddedAlphaBinCount (core::vectorSIMDu32 (workgroupSize, 1 , 1 , 1 ), alphaBinCount);
@@ -425,7 +424,7 @@ class NBL_API2 CComputeBlit : public core::IReferenceCounted
425
424
const asset::E_FORMAT inImageFormat,
426
425
const asset::IImage::E_TYPE imageType,
427
426
const typename BlitUtilities::convolution_kernels_t & kernels,
428
- const uint32_t workgroupSize = DefaultBlitWorkgroupSize ,
427
+ const uint32_t workgroupSize = 256 ,
429
428
const uint32_t layersToBlit = 1 )
430
429
{
431
430
core::vectorSIMDu32 outputTexelsPerWG;
@@ -609,7 +608,7 @@ class NBL_API2 CComputeBlit : public core::IReferenceCounted
609
608
core::smart_refctd_ptr<video::IGPUBuffer> coverageAdjustmentScratchBuffer = nullptr ,
610
609
const float referenceAlpha = 0 .f,
611
610
const uint32_t alphaBinCount = asset::IBlitUtilities::DefaultAlphaBinCount,
612
- const uint32_t workgroupSize = DefaultBlitWorkgroupSize )
611
+ const uint32_t workgroupSize = 256 )
613
612
{
614
613
const core::vectorSIMDu32 outImageExtent (normalizationInImage->getCreationParameters ().extent .width , normalizationInImage->getCreationParameters ().extent .height , normalizationInImage->getCreationParameters ().extent .depth , 1u );
615
614
0 commit comments