GRAPHICS: Move staging buffer writes into separate functions.