示例#1
0
        private static TextureType GetTextureType(TextureScalarType type)
        {
            switch (type)
            {
            case TextureScalarType.Texture1DLodZero:
                return(TextureType.Texture1D);

            case TextureScalarType.Texture2D:
            case TextureScalarType.Texture2DLodZero:
            case TextureScalarType.Texture2DLodLevel:
                return(TextureType.Texture2D);

            case TextureScalarType.Texture2DDepthCompare:
            case TextureScalarType.Texture2DLodLevelDepthCompare:
            case TextureScalarType.Texture2DLodZeroDepthCompare:
                return(TextureType.Texture2D | TextureType.Shadow);

            case TextureScalarType.Texture2DArray:
            case TextureScalarType.Texture2DArrayLodZero:
                return(TextureType.Texture2D | TextureType.Array);

            case TextureScalarType.Texture2DArrayLodZeroDepthCompare:
                return(TextureType.Texture2D | TextureType.Array | TextureType.Shadow);

            case TextureScalarType.Texture3D:
            case TextureScalarType.Texture3DLodZero:
                return(TextureType.Texture3D);

            case TextureScalarType.TextureCube:
            case TextureScalarType.TextureCubeLodLevel:
                return(TextureType.TextureCube);
            }

            throw new ArgumentException($"Invalid texture type \"{type}\".");
        }
示例#2
0
        private static TextureFlags GetTextureFlags(TextureScalarType type)
        {
            switch (type)
            {
            case TextureScalarType.Texture1DLodZero:
            case TextureScalarType.Texture2DLodZero:
            case TextureScalarType.Texture2DLodLevel:
            case TextureScalarType.Texture2DLodLevelDepthCompare:
            case TextureScalarType.Texture2DLodZeroDepthCompare:
            case TextureScalarType.Texture2DArrayLodZero:
            case TextureScalarType.Texture2DArrayLodZeroDepthCompare:
            case TextureScalarType.Texture3DLodZero:
            case TextureScalarType.TextureCubeLodLevel:
                return(TextureFlags.LodLevel);

            case TextureScalarType.Texture2D:
            case TextureScalarType.Texture2DDepthCompare:
            case TextureScalarType.Texture2DArray:
            case TextureScalarType.Texture3D:
            case TextureScalarType.TextureCube:
                return(TextureFlags.None);
            }

            throw new ArgumentException($"Invalid texture type \"{type}\".");
        }