ShaderTools.Hlsl.Symbols.TypeFacts.GetNumericTypeWithScalarType C# (CSharp) Method

GetNumericTypeWithScalarType() static private method

static private GetNumericTypeWithScalarType ( this type, ScalarType scalarType ) : IntrinsicNumericTypeSymbol
type this
scalarType ScalarType
return IntrinsicNumericTypeSymbol
        internal static IntrinsicNumericTypeSymbol GetNumericTypeWithScalarType(this IntrinsicNumericTypeSymbol type, ScalarType scalarType)
        {
            switch (type.Kind)
            {
                case SymbolKind.IntrinsicMatrixType:
                    var matrixType = (IntrinsicMatrixTypeSymbol) type;
                    return IntrinsicTypes.GetMatrixType(scalarType, matrixType.Rows, matrixType.Cols);
                case SymbolKind.IntrinsicScalarType:
                    return IntrinsicTypes.GetScalarType(scalarType);
                case SymbolKind.IntrinsicVectorType:
                    return IntrinsicTypes.GetVectorType(scalarType, ((IntrinsicVectorTypeSymbol) type).NumComponents);
                default:
                    throw new ArgumentOutOfRangeException();
            }
        }