Merge pull request #521 from yavn/frag-shader-primitive-id-capability

SPV: PrimitiveId in frag shader will emit OpCapability
This commit is contained in:
John Kessenich
2016-10-01 11:38:18 -06:00
committed by GitHub
3 changed files with 21 additions and 3 deletions

View File

@@ -499,11 +499,17 @@ spv::BuiltIn TGlslangToSpvTraverser::TranslateBuiltInDecoration(glslang::TBuiltI
case glslang::EbvInstanceIndex: return spv::BuiltInInstanceIndex;
case glslang::EbvBaseVertex:
case glslang::EbvBaseInstance:
case glslang::EbvDrawId:
// TODO: Add SPIR-V builtin ID.
logger->missingFunctionality("shader draw parameters");
return spv::BuiltInMax;
case glslang::EbvPrimitiveId: return spv::BuiltInPrimitiveId;
case glslang::EbvPrimitiveId:
if (glslangIntermediate->getStage() == EShLangFragment)
builder.addCapability(spv::CapabilityGeometry);
return spv::BuiltInPrimitiveId;
case glslang::EbvInvocationId: return spv::BuiltInInvocationId;
case glslang::EbvTessLevelInner: return spv::BuiltInTessLevelInner;
case glslang::EbvTessLevelOuter: return spv::BuiltInTessLevelOuter;