Add texture caching mechanism.