Preparing tilemap primitive for rendering