Working code with no staging buffer use.