Base type for all types.
Inheritance: Xenko.Core.Shaders.Ast.Node, IAttributes, ITypeInferencer, IQualifiers
Exemplo n.º 1
0
 public static bool HasDimensions(TypeBase typeDeclaration)
 {
     return (typeDeclaration is ScalarType) || (typeDeclaration is VectorType) || (typeDeclaration is MatrixType);
 }
Exemplo n.º 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ArrayType"/> class.
 /// </summary>
 /// <param name="type">The type.</param>
 /// <param name="dimensions">The dimensions.</param>
 public ArrayType(TypeBase type, params Expression[] dimensions) : base("$array")
 {
     Type       = type;
     Dimensions = new List <Expression>();
     Dimensions.AddRange(dimensions);
 }
Exemplo n.º 3
0
 public static TypeBase GetBaseType(TypeBase type)
 {
     if (type is MatrixType) return ((MatrixType)type).Type;
     if (type is VectorType) return ((VectorType)type).Type;
     return type;
 }
Exemplo n.º 4
0
 /// <summary>
 /// Determines whether the specified type is an integer.
 /// </summary>
 /// <param name="type">The type.</param>
 /// <returns>
 ///   <c>true</c> if the specified type is an integer; otherwise, <c>false</c>.
 /// </returns>
 public static bool IsInteger(TypeBase type)
 {
     return(type == Int || type == UInt);
 }
Exemplo n.º 5
0
 /// <summary>
 /// Determines whether the specified type is a float/half/double.
 /// </summary>
 /// <param name="type">The type.</param>
 /// <returns>
 ///   <c>true</c> if the specified type is float/half/double; otherwise, <c>false</c>.
 /// </returns>
 public static bool IsFloat(TypeBase type)
 {
     return(type == Float || type == Double || type == Half);
 }
Exemplo n.º 6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Parameter"/> class.
 /// </summary>
 /// <param name="type">The type.</param>
 /// <param name="name">The name.</param>
 /// <param name="initialValue">The initial value.</param>
 public Parameter(TypeBase type, string name = null, Expression initialValue = null)
     : base(type, name, initialValue)
 {
 }
Exemplo n.º 7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TypeName"/> class.
 /// </summary>
 /// <param name="typeBase">The type base.</param>
 public TypeName(TypeBase typeBase)
     : base(typeBase.Name)
 {
     TypeInference.TargetType = typeBase;
 }
Exemplo n.º 8
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MethodDefinition"/> class.
 /// </summary>
 /// <param name="returntype">The returntype.</param>
 /// <param name="name">The name.</param>
 public MethodDefinition(TypeBase returntype, string name) : this()
 {
     ReturnType  = returntype;
     Name        = new Identifier(name);
     declaration = this;
 }