prepareBufferForViewportSize