summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
Diffstat (limited to 'source')
-rw-r--r--source/slang/slang-parameter-binding.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/source/slang/slang-parameter-binding.cpp b/source/slang/slang-parameter-binding.cpp
index 06d2b1f34..89e633857 100644
--- a/source/slang/slang-parameter-binding.cpp
+++ b/source/slang/slang-parameter-binding.cpp
@@ -2554,6 +2554,16 @@ static RefPtr<TypeLayout> processEntryPointVaryingParameter(
globalGenericParamDecl.getDecl());
}
}
+ else if (auto enumDeclRef = declRef.as<EnumDecl>())
+ {
+ // We handle an enumeration type as its tag type for varying parameters.
+ // This allows enums to be used in vertex output/input similar to their
+ // underlying integer types.
+ //
+ auto tagType = enumDeclRef.getDecl()->tagType;
+ SLANG_ASSERT(tagType);
+ return processEntryPointVaryingParameter(context, tagType, state, varLayout);
+ }
else if (auto associatedTypeParam = declRef.as<AssocTypeDecl>())
{
RefPtr<TypeLayout> assocTypeLayout = new TypeLayout();