Lines Matching full:spec
109 AtomicCounterTest (Context& context, const char* name, const char* description, const TestSpec& spec);
124 static string generateShaderSource (const TestSpec& spec);
128 static bool checkPath (const vector<deUint32>& increments, const vector<deUint32>& decrements, int initialValue, const TestSpec& spec);
154 AtomicCounterTest::AtomicCounterTest (Context& context, const char* name, const char* description, const TestSpec& spec)
156 , m_spec (spec)
172 string AtomicCounterTest::generateShaderSource (const TestSpec& spec)
183 switch (spec.bindingType)
195 switch (spec.offsetType)
208 DE_ASSERT(spec.atomicCounterCount > 2);
215 src << "offset=" << (4 * spec.atomicCounterCount/2);
241 if ((spec.operations & OPERATION_GET) != 0 && spec.operations != OPERATION_GET)
242 src << " uint preGet[" << spec.threadCount * spec.atomicCounterCount * spec.callCount << "];\n";
244 if ((spec.operations & OPERATION_INC) != 0)
245 src << " uint increment[" << spec.threadCount * spec.atomicCounterCount * spec.callCount << "];\n";
247 if ((spec.operations & OPERATION_DEC) != 0)
248 src << " uint decrement[" << spec.threadCount * spec.atomicCounterCount * spec.callCount << "];\n";
250 if ((spec.operations & OPERATION_GET) != 0 && spec.operations != OPERATION_GET)
251 src << " uint postGet[" << spec.threadCount * spec.atomicCounterCount * spec.callCount << "];\n";
253 if (spec.operations == OPERATION_GET)
254 src << " uint get[" << spec.threadCount * spec.atomicCounterCount * spec.callCount << "];\n";
258 for (int counterNdx = 0; counterNdx < spec.atomicCounterCount; counterNdx++)
262 if (spec.offsetType == OFFSETTYPE_RESET_DEFAULT && counterNdx == spec.atomicCounterCount/2)
265 switch (spec.bindingType)
285 switch (spec.offsetType)
339 src << "offset=" << (spec.atomicCounterCount - counterNdx - 1) * 4 << ") uniform atomic_uint counter" << (spec.atomicCounterCount - counterNdx - 1) << ";\n";
344 DE_ASSERT(spec.atomicCounterCount > 2);
346 if (counterNdx + 1 == spec.atomicCounterCount)
375 if (counterNdx + 1 == spec.atomicCounterCount)
398 if (counterNdx < spec.atomicCounterCount/2)
399 src << "uniform atomic_uint counter" << (counterNdx + spec.atomicCounterCount/2) << ";\n";
401 src << "uniform atomic_uint counter" << (counterNdx - spec.atomicCounterCount/2) << ";\n";
415 if (spec.callCount > 1)
416 src << "\tfor (uint i = 0u; i < " << spec.callCount << "u; i++)\n";
422 if (spec.callCount > 1)
423 src << " * "<< spec.callCount << "u";
425 if (spec.callCount > 1)
430 if (spec.atomicCounterCount > 1)
431 src << " * " << spec.atomicCounterCount << "u";
435 for (int counterNdx = 0; counterNdx < spec.atomicCounterCount; counterNdx++)
437 if ((spec.operations & OPERATION_GET) != 0 && spec.operations != OPERATION_GET)
440 if (spec.useBranches && ((spec.operations & (OPERATION_INC|OPERATION_DEC)) == (OPERATION_INC|OPERATION_DEC)))
443 << "\t\tif (((gl_GlobalInvocationID.x" << (spec.callCount > 1 ? " + i" : "") << ") % 2u) == 0u)\n"
456 if ((spec.operations & OPERATION_INC) != 0)
458 if (spec.useBranches)
461 << "\t\tif (((gl_GlobalInvocationID.x" << (spec.callCount > 1 ? " + i" : "") << ") % 2u) == 0u)\n"
475 if ((spec.operations & OPERATION_DEC) != 0)
477 if (spec.useBranches)
480 << "\t\tif (((gl_GlobalInvocationID.x" << (spec.callCount > 1 ? " + i" : "") << ") % 2u) == 0u)\n"
495 if ((spec.operations & OPERATION_GET) != 0 && spec.operations != OPERATION_GET)
498 if ((spec.operations == OPERATION_GET) != 0)
500 if (spec.useBranches)
503 << "\t\tif (((gl_GlobalInvocationID.x" << (spec.callCount > 1 ? " + i" : "") << ") % 2u) == 0u)\n"
712 bool AtomicCounterTest::checkPath (const vector<deUint32>& increments, const vector<deUint32>& decrements, int initialValue, const TestSpec& spec)
714 const deUint32 lastValue = initialValue + (spec.useBranches ? spec.threadCount*spec.callCount - spec.threadCount*spec.callCount/2 : 0) - (spec.useBranches ? spec.threadCount*spec.callCount/2 : 0);
1050 string specToTestName (const AtomicCounterTest::TestSpec& spec)
1054 stream << spec.atomicCounterCount << (spec.atomicCounterCount == 1 ? "_counter" : "_counters");
1055 stream << "_" << spec.callCount << (spec.callCount == 1 ? "_call" : "_calls");
1056 stream << "_" << spec.threadCount << (spec.threadCount == 1 ? "_thread" : "_threads");
1061 string specToTestDescription (const AtomicCounterTest::TestSpec& spec)
1069 if ((spec.operations & AtomicCounterTest::OPERATION_GET) != 0)
1075 if ((spec.operations & AtomicCounterTest::OPERATION_INC) != 0)
1084 if ((spec.operations & AtomicCounterTest::OPERATION_DEC) != 0)
1095 if (spec.useBranches)
1098 stream << spec.atomicCounterCount << " atomic counters, " << spec.callCount << " calls and " << spec.threadCount << " threads.";
1359 AtomicCounterTest::TestSpec spec;
1361 spec.atomicCounterCount = counterCount;
1362 spec.operations = operation;
1363 spec.callCount = callCount;
1364 spec.useBranches = useBranch;
1365 spec.threadCount = threadCount;
1366 spec.bindingType = AtomicCounterTest::BINDINGTYPE_BASIC;
1367 spec.offsetType = AtomicCounterTest::OFFSETTYPE_NONE;
1369 operationGroup->addChild(new AtomicCounterTest(m_context, specToTestName(spec).c_str(), specToTestDescription(spec).c_str(), spec));
1437 AtomicCounterTest::TestSpec spec;
1439 spec.atomicCounterCount = counterCount;
1440 spec.operations = operation;
1441 spec.callCount = callCount;
1442 spec.useBranches = false;
1443 spec.threadCount = threadCount;
1444 spec.bindingType = AtomicCounterTest::BINDINGTYPE_BASIC;
1445 spec.offsetType = offsetType;
1447 operationGroup->addChild(new AtomicCounterTest(m_context, specToTestName(spec).c_str(), specToTestDescription(spec).c_str(), spec));
1460 AtomicCounterTest::TestSpec spec;
1462 spec.atomicCounterCount = 1;
1463 spec.operations = AtomicCounterTest::OPERATION_INC;
1464 spec.callCount = 1;
1465 spec.useBranches = false;
1466 spec.threadCount = 1;
1467 spec.bindingType = AtomicCounterTest::BINDINGTYPE_INVALID;
1468 spec.offsetType = AtomicCounterTest::OFFSETTYPE_NONE;
1470 invalidGroup->addChild(new AtomicCounterTest(m_context, "invalid_binding", "Test layout qualifiers with invalid binding.", spec));
1474 AtomicCounterTest::TestSpec spec;
1476 spec.atomicCounterCount = 1;
1477 spec.operations = AtomicCounterTest::OPERATION_INC;
1478 spec.callCount = 1;
1479 spec.useBranches = false;
1480 spec.threadCount = 1;
1481 spec.bindingType = AtomicCounterTest::BINDINGTYPE_INVALID_DEFAULT;
1482 spec.offsetType = AtomicCounterTest::OFFSETTYPE_NONE;
1484 invalidGroup->addChild(new AtomicCounterTest(m_context, "invalid_default_binding", "Test layout qualifiers with invalid default binding.", spec));
1488 AtomicCounterTest::TestSpec spec;
1490 spec.atomicCounterCount = 1;
1491 spec.operations = AtomicCounterTest::OPERATION_INC;
1492 spec.callCount = 1;
1493 spec.useBranches = false;
1494 spec.threadCount = 1;
1495 spec.bindingType = AtomicCounterTest::BINDINGTYPE_BASIC;
1496 spec.offsetType = AtomicCounterTest::OFFSETTYPE_INVALID;
1498 invalidGroup->addChild(new AtomicCounterTest(m_context, "invalid_offset_align", "Test layout qualifiers with invalid alignment offset.", spec));
1502 AtomicCounterTest::TestSpec spec;
1504 spec.atomicCounterCount = 2;
1505 spec.operations = AtomicCounterTest::OPERATION_INC;
1506 spec.callCount = 1;
1507 spec.useBranches = false;
1508 spec.threadCount = 1;
1509 spec.bindingType = AtomicCounterTest::BINDINGTYPE_BASIC;
1510 spec.offsetType = AtomicCounterTest::OFFSETTYPE_INVALID_OVERLAPPING;
1512 invalidGroup->addChild(new AtomicCounterTest(m_context, "invalid_offset_overlap", "Test layout qualifiers with invalid overlapping offset.", spec));
1516 AtomicCounterTest::TestSpec spec;
1518 spec.atomicCounterCount = 1;
1519 spec.operations = AtomicCounterTest::OPERATION_INC;
1520 spec.callCount = 1;
1521 spec.useBranches = false;
1522 spec.threadCount = 1;
1523 spec.bindingType = AtomicCounterTest::BINDINGTYPE_BASIC;
1524 spec.offsetType = AtomicCounterTest::OFFSETTYPE_INVALID_DEFAULT;
1526 invalidGroup->addChild(new AtomicCounterTest(m_context, "invalid_default_offset", "Test layout qualifiers with invalid default offset.", spec));