2
2
#include " nbl/application_templates/MonoAssetManagerAndBuiltinResourceApplication.hpp"
3
3
#include " app_resources/common.hlsl"
4
4
#include " nbl/builtin/hlsl/workgroup2/arithmetic_config.hlsl"
5
+ #include " nbl/builtin/hlsl/subgroup2/arithmetic_params.hlsl"
5
6
6
7
using namespace nbl ;
7
8
using namespace core ;
@@ -186,7 +187,7 @@ class Workgroup2ScanTestApp final : public application_templates::BasicMultiQueu
186
187
for (auto subgroupSize = MinSubgroupSize; subgroupSize <= MaxSubgroupSize; subgroupSize *= 2u )
187
188
{
188
189
const uint8_t subgroupSizeLog2 = hlsl::findMSB (subgroupSize);
189
- for (uint32_t workgroupSize = 64 ; workgroupSize <= MaxWorkgroupSize; workgroupSize *= 2u )
190
+ for (uint32_t workgroupSize = subgroupSize ; workgroupSize <= MaxWorkgroupSize; workgroupSize *= 2u )
190
191
{
191
192
// make sure renderdoc captures everything for debugging
192
193
m_api->startCapture ();
@@ -198,12 +199,12 @@ class Workgroup2ScanTestApp final : public application_templates::BasicMultiQueu
198
199
uint32_t itemsPerWG = workgroupSize * itemsPerInvocation;
199
200
m_logger->log (" Testing Items per Invocation %u" , ILogger::ELL_INFO, itemsPerInvocation);
200
201
bool passed = true ;
201
- // passed = runTest<emulatedReduction, false>(subgroupTestSource, elementCount, subgroupSizeLog2, workgroupSize, bool(useNative), itemsPerWG, itemsPerInvocation) && passed;
202
- // logTestOutcome(passed, itemsPerWG);
203
- // passed = runTest<emulatedScanInclusive, false>(subgroupTestSource, elementCount, subgroupSizeLog2, workgroupSize, bool(useNative), itemsPerWG, itemsPerInvocation) && passed;
204
- // logTestOutcome(passed, itemsPerWG);
205
- // passed = runTest<emulatedScanExclusive, false>(subgroupTestSource, elementCount, subgroupSizeLog2, workgroupSize, bool(useNative), itemsPerWG, itemsPerInvocation) && passed;
206
- // logTestOutcome(passed, itemsPerWG);
202
+ passed = runTest<emulatedReduction, false >(subgroupTestSource, elementCount, subgroupSizeLog2, workgroupSize, bool (useNative), itemsPerWG, itemsPerInvocation) && passed;
203
+ logTestOutcome (passed, itemsPerWG);
204
+ passed = runTest<emulatedScanInclusive, false >(subgroupTestSource, elementCount, subgroupSizeLog2, workgroupSize, bool (useNative), itemsPerWG, itemsPerInvocation) && passed;
205
+ logTestOutcome (passed, itemsPerWG);
206
+ passed = runTest<emulatedScanExclusive, false >(subgroupTestSource, elementCount, subgroupSizeLog2, workgroupSize, bool (useNative), itemsPerWG, itemsPerInvocation) && passed;
207
+ logTestOutcome (passed, itemsPerWG);
207
208
208
209
hlsl::workgroup2::SArithmeticConfiguration wgConfig;
209
210
wgConfig.init (hlsl::findMSB (workgroupSize), subgroupSizeLog2, itemsPerInvocation);
@@ -331,24 +332,25 @@ class Workgroup2ScanTestApp final : public application_templates::BasicMultiQueu
331
332
}
332
333
else
333
334
{
334
- const std::string definitions[4 ] = {
335
+ hlsl::subgroup2::SArithmeticParams sgParams;
336
+ sgParams.init (subgroupSizeLog2, itemsPerInvoc);
337
+
338
+ const std::string definitions[3 ] = {
335
339
" subgroup2::" + arith_name,
336
340
std::to_string (workgroupSize),
337
- std::to_string (itemsPerInvoc),
338
- std::to_string (subgroupSizeLog2)
341
+ sgParams.getParamTemplateStructString ()
339
342
};
340
343
341
- const IShaderCompiler::SMacroDefinition defines[5 ] = {
344
+ const IShaderCompiler::SMacroDefinition defines[4 ] = {
342
345
{ " OPERATION" , definitions[0 ] },
343
346
{ " WORKGROUP_SIZE" , definitions[1 ] },
344
- { " ITEMS_PER_INVOCATION" , definitions[2 ] },
345
- { " SUBGROUP_SIZE_LOG2" , definitions[3 ] },
347
+ { " SUBGROUP_CONFIG_T" , definitions[2 ] },
346
348
{ " TEST_NATIVE" , " 1" }
347
349
};
348
350
if (useNative)
349
- options.preprocessorOptions .extraDefines = { defines, defines + 5 };
350
- else
351
351
options.preprocessorOptions .extraDefines = { defines, defines + 4 };
352
+ else
353
+ options.preprocessorOptions .extraDefines = { defines, defines + 3 };
352
354
353
355
overriddenUnspecialized = compiler->compileToSPIRV ((const char *)source->getContent ()->getPointer (), options);
354
356
}
0 commit comments