예제 #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="GorgonStructuredView"/> class.
 /// </summary>
 /// <param name="buffer">The buffer to bind to the view.</param>
 /// <param name="startingElement">The starting element in the buffer to view.</param>
 /// <param name="elementCount">The number of elements in the buffer to view.</param>
 /// <param name="totalElementCount">The total number of elements in the buffer.</param>
 internal GorgonStructuredView(GorgonBuffer buffer,
                               int startingElement,
                               int elementCount,
                               int totalElementCount)
     : base(buffer, startingElement, elementCount, totalElementCount)
 {
 }
예제 #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="GorgonBufferViewCommon"/> class.
 /// </summary>
 /// <param name="buffer">The buffer to bind to the view.</param>
 /// <param name="startingElement">The starting element in the buffer to view.</param>
 /// <param name="elementCount">The number of elements in the buffer to view.</param>
 /// <param name="totalElementCount">The total number of elements in the buffer.</param>
 /// <exception cref="ArgumentNullException">Thrown when the <paramref name="buffer"/> parameter is <b>null</b>.</exception>
 protected GorgonBufferViewCommon(GorgonBuffer buffer, int startingElement, int elementCount, int totalElementCount)
     : base(buffer)
 {
     TotalElementCount = totalElementCount;
     StartElement      = startingElement;
     ElementCount      = elementCount;
     Buffer            = buffer;
 }
예제 #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="GorgonBufferView"/> class.
 /// </summary>
 /// <param name="buffer">The buffer to bind to the view.</param>
 /// <param name="format">The format of the view into the buffer.</param>
 /// <param name="formatInfo">The information about the format being used.</param>
 /// <param name="startingElement">The starting element in the buffer to view.</param>
 /// <param name="elementCount">The number of elements in the buffer to view.</param>
 /// <param name="totalElementCount">The total number of elements in the buffer.</param>
 /// <exception cref="ArgumentNullException">Thrown when the <paramref name="buffer"/>, or the <paramref name="formatInfo"/> parameter is <b>null</b>.</exception>
 internal GorgonBufferView(GorgonBuffer buffer,
                           BufferFormat format,
                           GorgonFormatInfo formatInfo,
                           int startingElement,
                           int elementCount,
                           int totalElementCount)
     : base(buffer, startingElement, elementCount, totalElementCount)
 {
     FormatInformation = formatInfo ?? throw new ArgumentNullException(nameof(formatInfo));
     Format            = format;
 }
예제 #4
0
        /// <summary>
        /// Function to retrieve a copy of this buffer as a staging resource.
        /// </summary>
        /// <returns>The staging buffer to retrieve.</returns>
        public GorgonBuffer GetStaging()
        {
            var buffer = new GorgonBuffer(Graphics,
                                          new GorgonBufferInfo(_info, $"{Name}_Staging")
            {
                Binding = BufferBinding.None,
                Usage   = ResourceUsage.Staging
            });

            CopyTo(buffer);

            return(buffer);
        }
예제 #5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="GorgonRawView"/> class.
 /// </summary>
 /// <param name="buffer">The buffer to bind to the view.</param>
 /// <param name="elementType">The type of the elements stored within the buffer.</param>
 /// <param name="startingElement">The starting element in the buffer to view.</param>
 /// <param name="elementCount">The number of elements in the buffer to view.</param>
 /// <param name="totalElementCount">The total number of elements in the buffer.</param>
 internal GorgonRawView(GorgonBuffer buffer,
                        RawBufferElementType elementType,
                        int startingElement,
                        int elementCount,
                        int totalElementCount)
     : base(buffer, startingElement, elementCount, totalElementCount) => ElementType = elementType;