Example #1
0
        /// <summary>
        /// Writes the specified qualifier.
        /// </summary>
        /// <param name="qualifiers">
        /// The qualifier.
        /// </param>
        /// <param name="writePreQualifiers">
        /// if set to <c>true</c> [write pre qualifiers].
        /// </param>
        /// <returns>
        /// This instance
        /// </returns>
        public ShaderWriter Write(Qualifier qualifiers, bool writePreQualifiers)
        {
            if (qualifiers == Qualifier.None) return this;

            foreach (var genericQualifier in qualifiers.Values)
            {
                var qualifier = (Qualifier)genericQualifier;

                if (qualifier == Qualifier.None || qualifier.IsPost == writePreQualifiers) 
                    continue;

                if (qualifier.IsPost) 
                    Write(" ");

                VisitDynamic(qualifier);

                if (!qualifier.IsPost) 
                    Write(" ");
            }

            return this;
        }
 /// <inheritdoc/>
 public override void Visit(Qualifier qualifier)
 {
     Write(qualifier.Key.ToString());
 }
Example #3
0
 public virtual void Visit(Qualifier qualifier)
 {
     // Each qualifier should have a custom visit instead of using this default one.
     Write(qualifier.Key.ToString());
 }
 private static Ast.Parameter GenericParam(string paramName, TypeBase type, Qualifier qualifier)
 {
     return new Ast.Parameter() { Name = new Identifier(paramName), Type = type, Qualifiers = qualifier };
 }