/// <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);
            }
        }