Optimizing the rendering pipeline