Add missing guard to code that uses AMD extensions
authorDavid Neto <dneto@google.com>
Wed, 19 Oct 2016 14:16:29 +0000 (10:16 -0400)
committerDavid Neto <dneto@google.com>
Wed, 19 Oct 2016 14:17:25 +0000 (10:17 -0400)
Otherwise compilation fails when ENABLED_AMD_EXTENSIONS is off.

SPIRV/GlslangToSpv.cpp

index 49bb0a1..3e0ad4f 100755 (executable)
@@ -4133,10 +4133,12 @@ spv::Id TGlslangToSpvTraverser::createInvocationsOperation(glslang::TOperator op
         builder.addCapability(spv::CapabilitySubgroupBallotKHR);
     } else {
         builder.addCapability(spv::CapabilityGroups);
+#ifdef AMD_EXTENSIONS
         if (op == glslang::EOpMinInvocationsNonUniform ||
             op == glslang::EOpMaxInvocationsNonUniform ||
             op == glslang::EOpAddInvocationsNonUniform)
             builder.addExtension(spv::E_SPV_AMD_shader_ballot);
+#endif
 
         spvGroupOperands.push_back(builder.makeUintConstant(spv::ScopeSubgroup));
 #ifdef AMD_EXTENSIONS