4 using System.Globalization;
5 using SiliconStudio.Shaders.Ast;
7 namespace SiliconStudio.Shaders.Convertor
16 public static Tuple<TypeBase, int, int>
GetType(
string type)
19 if (type.StartsWith(
"matrix"))
21 var dimStr = type.Substring(
"matrix".Length);
22 if (dimStr.Length == 0)
24 return new Tuple<TypeBase, int, int>(
new MatrixType(), 4, 4);
27 return new Tuple<TypeBase, int, int>(
new MatrixType(), int.Parse(dimStr[0].ToString()), int.Parse(dimStr[2].ToString()));
32 if (type.StartsWith(
"float"))
35 declaration = ScalarType.Float;
37 else if (type.StartsWith(
"int"))
40 declaration = ScalarType.Int;
42 else if (type.StartsWith(
"half"))
47 else if (type.StartsWith(
"uint"))
50 declaration = ScalarType.UInt;
52 else if (type.StartsWith(
"bool"))
55 declaration = ScalarType.Bool;
57 else if (type.StartsWith(
"double"))
60 declaration = ScalarType.Double;
68 return new Tuple<TypeBase, int, int>(declaration, int.Parse(type.Substring(prefix.Length, 1)), 0);
static Tuple< TypeBase, int, int > GetType(string type)
Gets the type.
SiliconStudio.Paradox.Games.Mathematics.Half Half