public static ConstantBuffer <T> AllocateConstantBuffer <T>(this GraphicsDevice device, HlslBuffer <T> buffer) where T : unmanaged
        {
            ConstantBuffer <T> constantBuffer = new ConstantBuffer <T>(device, buffer.Size);

            constantBuffer.SetData(buffer);

            return(constantBuffer);
        }
        public static ReadWriteBuffer <T> AllocateReadWriteBuffer <T>(this GraphicsDevice device, HlslBuffer <T> buffer) where T : unmanaged
        {
            ReadWriteBuffer <T> readWriteBuffer = new ReadWriteBuffer <T>(device, buffer.Size);

            readWriteBuffer.SetData(buffer);

            return(readWriteBuffer);
        }