some minor changes to integrate texture cache