diff options
Diffstat (limited to 'source/slang/parameter-binding.cpp')
| -rw-r--r-- | source/slang/parameter-binding.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/source/slang/parameter-binding.cpp b/source/slang/parameter-binding.cpp index 4fbec5652..fed838e6b 100644 --- a/source/slang/parameter-binding.cpp +++ b/source/slang/parameter-binding.cpp @@ -1190,6 +1190,27 @@ static RefPtr<TypeLayout> processEntryPointParameter( EntryPointParameterState const& state, RefPtr<VarLayout> varLayout) { + // If there is an available semantic name and index, + // then we should apply it to this parameter unconditionally + // (that is, not just if it is a leaf parameter). + auto optSemanticName = state.optSemanticName; + if (optSemanticName && varLayout) + { + // Always store semantics in upper-case for + // reflection information, since they are + // supposed to be case-insensitive and + // upper-case is the dominant convention. + String semanticName = *optSemanticName; + String sn = semanticName.ToUpper(); + + auto semanticIndex = *state.ioSemanticIndex; + + varLayout->semanticName = sn; + varLayout->semanticIndex = semanticIndex; + varLayout->flags |= VarLayoutFlag::HasSemantic; + } + + // Scalar and vector types are treated as outputs directly if(auto basicType = type->As<BasicExpressionType>()) { |
