Ejemplo n.º 1
0
        private SemanticAttribute CreateAttribute(object categorizedAttribute, TTypeElement element)
        {
            SemanticAttribute attribute = XNew.New <SemanticAttribute>();

            attribute.RuntimeMapping = categorizedAttribute;

            return(attribute);
        }
        public virtual void TranslatePostfix(ShaderTranslationContext sc, MethodInfo info, MethodDeclarationSyntax syntax, MappedEntryPoint ep)
        {
            SemanticAttribute attSemantic = info.GetCustomAttribute <SemanticAttribute>();

            if (attSemantic != null)
            {
                TranslateSemantic(sc, attSemantic);
            }
        }
        private void TranslateSemantic(ShaderTranslationContext sc, SemanticAttribute attribute)
        {
            string semanticName = attribute.Semantic.ToString().ToUpper();

            sc.Source.Append($" : {semanticName}");

            if (attribute.Slot >= 0)
            {
                sc.Source.Append(attribute.Slot.ToString());
            }
        }