Improved erasing process by caching some inputs before uploading to the GPU.