copyTextureToBuffer