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

GetDimensionSize() static private méthode

static private GetDimensionSize ( this type, int dimension ) : int
type this
dimension int
Résultat int
        internal static int GetDimensionSize(this IntrinsicNumericTypeSymbol type, int dimension)
        {
            switch (type.Kind)
            {
                case SymbolKind.IntrinsicMatrixType:
                    var matrixType = (IntrinsicMatrixTypeSymbol) type;
                    return dimension == 0 ? matrixType.Rows : matrixType.Cols;
                case SymbolKind.IntrinsicVectorType:
                    var vectorType = (IntrinsicVectorTypeSymbol) type;
                    return dimension == 0 ? vectorType.NumComponents : 1;
                case SymbolKind.IntrinsicScalarType:
                    return 1;
                default:
                    throw new InvalidOperationException();
            }
        }