/// <inheritdoc/>
        public override void GetData(Span <T> span, int offset, int count)
        {
            using Buffer <T> transferBuffer = new Buffer <T>(GraphicsDevice, count, count * ElementSizeInBytes, BufferType.Transfer);
            using CommandList copyCommandList = new CommandList(GraphicsDevice, CommandListType.Copy);

            copyCommandList.CopyBufferRegion(this, offset * ElementSizeInBytes, transferBuffer, 0, count * ElementSizeInBytes);
            copyCommandList.Flush();

            transferBuffer.Map(0);
            MemoryHelper.Copy(transferBuffer.MappedResource, 0, span, 0, count);
            transferBuffer.Unmap(0);
        }
        /// <inheritdoc/>
        public override void SetData(ReadOnlySpan <T> span, int offset, int count)
        {
            using Buffer <T> transferBuffer = new Buffer <T>(GraphicsDevice, count, count * ElementSizeInBytes, BufferType.Transfer);

            using (MappedResource resource = transferBuffer.MapResource())
            {
                MemoryHelper.Copy(span, resource.Pointer, 0, count);
            }

            using CommandList copyCommandList = new CommandList(GraphicsDevice, CommandListType.Copy);

            copyCommandList.CopyBufferRegion(transferBuffer, 0, this, offset * ElementSizeInBytes, count * ElementSizeInBytes);
            copyCommandList.ExecuteAndWaitForCompletion();
        }
        /// <inheritdoc/>
        public override void SetData(HlslBuffer <T> buffer)
        {
            if (!buffer.IsPaddingPresent)
            {
                // Directly copy the input buffer
                using CommandList copyCommandList = new CommandList(GraphicsDevice, CommandListType.Copy);

                copyCommandList.CopyBufferRegion(buffer, 0, this, 0, SizeInBytes);
                copyCommandList.ExecuteAndWaitForCompletion();
            }
            else
            {
                SetDataWithCpuBuffer(buffer);
            }
        }