static SpirvTypeBase() { Void = new TypeVoid(); Half = new TypeFloat(16); Float = new TypeFloat(32); Double = new TypeFloat(64); Bool = new TypeBool(); SByte = new TypeInt(8, true); Byte = new TypeInt(8, false); Short = new TypeInt(16, true); UShort = new TypeInt(16, false); Int = new TypeInt(32, true); UInt = new TypeInt(32, false); Vec2 = new TypeVector(Float, 2); Vec3 = new TypeVector(Float, 3); Vec4 = new TypeVector(Float, 4); Ivec2 = new TypeVector(Int, 2); Ivec3 = new TypeVector(Int, 3); Ivec4 = new TypeVector(Int, 4); Uvec2 = new TypeVector(UInt, 2); Uvec3 = new TypeVector(UInt, 3); Uvec4 = new TypeVector(UInt, 4); Bvec2 = new TypeVector(Bool, 2); Bvec3 = new TypeVector(Bool, 3); Bvec4 = new TypeVector(Bool, 4); Dvec2 = new TypeVector(Double, 2); Dvec3 = new TypeVector(Double, 3); Dvec4 = new TypeVector(Double, 4); Mat2Base = new TypeMatrixDeclaration(Vec2, 2); Mat3Base = new TypeMatrixDeclaration(Vec3, 3); Mat4Base = new TypeMatrixDeclaration(Vec4, 4); Mat2 = new TypeMatrixLayout(Mat2Base, MatrixOrientation.ColMajor, 16); Mat3 = new TypeMatrixLayout(Mat3Base, MatrixOrientation.ColMajor, 16); Mat4 = new TypeMatrixLayout(Mat4Base, MatrixOrientation.ColMajor, 16); }
public static SpirvTypeBase ResolveMatrix(TypeVector columnType, uint columnCount) { switch (columnType.VectorType) { case VectorType.Vec2: if (columnCount == 2) { return(Mat2); } break; case VectorType.Vec3: if (columnCount == 3) { return(Mat3); } break; case VectorType.Vec4: if (columnCount == 4) { return(Mat4); } break; } return(new TypeMatrixDeclaration((TypeVector)columnType, columnCount)); }
public TypeMatrixDeclaration(TypeVector columnType, uint columnCount) { _columnType = columnType; ColumnCount = columnCount; }