bdy << "{\n";
bdy << " if (index > 63)\n";
bdy << " return false;\n";
- bdy << " uint64_t mask = uint64_t(1 << index);\n";
+ bdy << " uint64_t mask = 1ul << index;\n";
bdy << " if (bool((value & mask)) == true)\n";
bdy << " return true;\n";
bdy << " return false;\n";
void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef)
{
- const string extensionHeader = (caseDef.extShaderSubGroupBallotTests ? "#extension GL_ARB_shader_ballot: enable\n#extension GL_KHR_shader_subgroup_basic: enable\n" : "#extension GL_KHR_shader_subgroup_ballot: enable\n");
+ const string extensionHeader = (caseDef.extShaderSubGroupBallotTests ?
+ "#extension GL_ARB_shader_ballot: enable\n"
+ "#extension GL_ARB_gpu_shader_int64: enable\n"
+ "#extension GL_KHR_shader_subgroup_basic: enable\n"
+ :
+ "#extension GL_KHR_shader_subgroup_ballot: enable\n");
if (VK_SHADER_STAGE_COMPUTE_BIT == caseDef.shaderStage)
{
<< " tempResult |= sharedMemoryBallot(true) == " << (caseDef.extShaderSubGroupBallotTests ? "ballotARB" : "subgroupBallot") << "(true) ? 0x1 : 0;\n"
<< " bool bData = data[gl_SubgroupInvocationID] != 0;\n"
<< " tempResult |= sharedMemoryBallot(bData) == " << (caseDef.extShaderSubGroupBallotTests ? "ballotARB" : "subgroupBallot") << "(bData) ? 0x2 : 0;\n"
- << " tempResult |= " << (caseDef.extShaderSubGroupBallotTests ? "uint(0) == ballotARB" : "uvec4(0) == subgroupBallot") << "(false) ? 0x4 : 0;\n"
+ << " tempResult |= " << (caseDef.extShaderSubGroupBallotTests ? "uint64_t(0) == ballotARB" : "uvec4(0) == subgroupBallot") << "(false) ? 0x4 : 0;\n"
<< " result[offset] = tempResult;\n"
<< "}\n";
}
else
{
- const string cmpStr = (caseDef.extShaderSubGroupBallotTests ? "uint(0) == ballotARB" : "uvec4(0) == subgroupBallot");
+ const string cmpStr = (caseDef.extShaderSubGroupBallotTests ? "uint64_t(0) == ballotARB" : "uvec4(0) == subgroupBallot");
const string testSrc =
" uint tempResult = 0;\n"
" tempResult |= !bool(" + cmpStr + "(true)) ? 0x1 : 0;\n"
std::string vkt::subgroups::getSharedMemoryBallotHelperARB()
{
return "shared uvec4 superSecretComputeShaderHelper[gl_WorkGroupSize.x * gl_WorkGroupSize.y * gl_WorkGroupSize.z];\n"
- "uint sharedMemoryBallot(bool vote)\n"
+ "uint64_t sharedMemoryBallot(bool vote)\n"
"{\n"
" uint groupOffset = gl_SubgroupID;\n"
" // One invocation in the group 0's the whole group's data\n"
" }\n"
" }\n"
" subgroupMemoryBarrierShared();\n"
- " return superSecretComputeShaderHelper[groupOffset].x;\n"
+ " return packUint2x32(superSecretComputeShaderHelper[groupOffset].xy);\n"
"}\n";
}