TextureCache: Implement layered texture support.