Merge pull request #679 from ashwinkolhe/akolhe_spv_khr_subgroup_vote
Implement SPV_KHR_subgroup_vote
This commit is contained in:
@@ -4148,6 +4148,11 @@ spv::Id TGlslangToSpvTraverser::createInvocationsOperation(glslang::TOperator op
|
||||
op == glslang::EOpReadInvocation) {
|
||||
builder.addExtension(spv::E_SPV_KHR_shader_ballot);
|
||||
builder.addCapability(spv::CapabilitySubgroupBallotKHR);
|
||||
} else if (op == glslang::EOpAnyInvocation ||
|
||||
op == glslang::EOpAllInvocations ||
|
||||
op == glslang::EOpAllInvocationsEqual) {
|
||||
builder.addExtension(spv::E_SPV_KHR_subgroup_vote);
|
||||
builder.addCapability(spv::CapabilitySubgroupVoteKHR);
|
||||
} else {
|
||||
builder.addCapability(spv::CapabilityGroups);
|
||||
#ifdef AMD_EXTENSIONS
|
||||
@@ -4202,20 +4207,14 @@ spv::Id TGlslangToSpvTraverser::createInvocationsOperation(glslang::TOperator op
|
||||
|
||||
switch (op) {
|
||||
case glslang::EOpAnyInvocation:
|
||||
opCode = spv::OpGroupAny;
|
||||
opCode = spv::OpSubgroupAnyKHR;
|
||||
break;
|
||||
case glslang::EOpAllInvocations:
|
||||
opCode = spv::OpGroupAll;
|
||||
opCode = spv::OpSubgroupAllKHR;
|
||||
break;
|
||||
case glslang::EOpAllInvocationsEqual:
|
||||
{
|
||||
spv::Id groupAll = builder.createOp(spv::OpGroupAll, typeId, spvGroupOperands);
|
||||
spv::Id groupAny = builder.createOp(spv::OpGroupAny, typeId, spvGroupOperands);
|
||||
|
||||
return builder.createBinOp(spv::OpLogicalOr, typeId, groupAll,
|
||||
builder.createUnaryOp(spv::OpLogicalNot, typeId, groupAny));
|
||||
}
|
||||
|
||||
opCode = spv::OpSubgroupAllEqualKHR;
|
||||
break;
|
||||
case glslang::EOpReadInvocation:
|
||||
opCode = spv::OpSubgroupReadInvocationKHR;
|
||||
if (builder.isVectorType(typeId))
|
||||
|
||||
Reference in New Issue
Block a user