ShaderTools.Hlsl.Symbols.TypeFacts.GetNumericTypeWithScalarType C# (CSharp) Méthode

GetNumericTypeWithScalarType() static private méthode

static private GetNumericTypeWithScalarType ( this type, ScalarType scalarType ) : IntrinsicNumericTypeSymbol
type this
scalarType ScalarType
Résultat 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();
            }
        }