Ejemplo n.º 1
0
        /// <summary>Initializes a new instance of the <see cref="GraphicsMemoryBlockRegion" /> struct.</summary>
        /// <param name="block">The block which contains the region.</param>
        /// <param name="size">The size of the region, in bytes.</param>
        /// <param name="offset">The offset of the region, in bytes.</param>
        /// <param name="alignment">The alignment of the region, in bytes.</param>
        /// <param name="kind">The region kind.</param>
        /// <exception cref="ArgumentNullException"><paramref name="block" /> is <c>null</c>.</exception>
        /// <exception cref="ArgumentOutOfRangeException"><paramref name="size" /> is <c>zero</c>.</exception>
        /// <exception cref="ArgumentOutOfRangeException"><paramref name="alignment" /> is <c>zero</c>.</exception>
        public GraphicsMemoryBlockRegion(GraphicsMemoryBlock block, ulong size, ulong offset, ulong alignment, GraphicsMemoryBlockRegionKind kind)
        {
            ThrowIfNull(block, nameof(block));
            ThrowIfZero(size, nameof(size));
            ThrowIfZero(alignment, nameof(alignment));

            _size      = size;
            _offset    = offset;
            _alignment = alignment;
            _block     = block;
            _kind      = kind;
        }
 /// <summary>Initializes an instance of the <see cref="IMetadata" /> interface.</summary>
 /// <param name="block">The block for which the metadata tracks allocated or free regions.</param>
 /// <param name="size">The size of the memory block, in bytes.</param>
 /// <param name="marginSize">The minimum size of free regions to keep on either side of an allocated region, in bytes.</param>
 /// <param name="minimumFreeRegionSizeToRegister">The minimum size of a free region for it to be registered as available, in bytes.</param>
 /// <exception cref="ArgumentNullException"><paramref name="block" /> is <c>null</c>.</exception>
 /// <exception cref="ArgumentOutOfRangeException"><paramref name="size" /> is zero.</exception>
 void Initialize(GraphicsMemoryBlock block, ulong size, ulong marginSize, ulong minimumFreeRegionSizeToRegister);